You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A region-key rotation replaces the wrapped CEK and its key version and
nothing else, but the only way to write that was PutEncryptionParams,
which rewrites every column. The ciphertext is unchanged across a
rotation, so a caller that got the nonce, chunk size, AAD or header
length wrong on the re-supplied set would corrupt a decryptable row.
RewrapEncryptionParams takes only the two parameters that change:
- Postgres issues a plain UPDATE of the two columns. Zero rows affected
means the blob has no row — not encrypted, or already shredded — so it
returns ErrNotFound instead of reporting success.
- ValidateRewrap rejects an empty CEK or key version, so a rotation
cannot blank out the material the decrypt path needs.
PutEncryptionParams keeps its upsert semantics for re-encryption, which
does replace the whole set.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
0 commit comments