Skip to content

Commit 552e425

Browse files
committed
fixup! address some comments from original PR
1 parent e1a77a6 commit 552e425

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

enterprise/dbcrypt/cipher.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ func (a *AES256) Encrypt(plaintext []byte) ([]byte, error) {
4646
if err != nil {
4747
return nil, err
4848
}
49-
// TODO: the below fails with "cipher: message authentication failed"
50-
//return a.aead.Seal(nil, nonce, plaintext, nil), nil
51-
return a.aead.Seal(nonce, nonce, plaintext, nil), nil
49+
dst := make([]byte, len(nonce))
50+
copy(dst, nonce)
51+
return a.aead.Seal(dst, nonce, plaintext, nil), nil
5252
}
5353

5454
func (a *AES256) Decrypt(ciphertext []byte) ([]byte, error) {

0 commit comments

Comments
 (0)