Skip to content

Commit bdef49c

Browse files
committed
For correct tag calculation in AES GCM mode in macOS the function wc_AesGcmSetKey must be used and not wc_AesSetKey
1 parent 2d63a95 commit bdef49c

File tree

1 file changed

+2
-6
lines changed
  • rustls-wolfcrypt-provider/src/aead

1 file changed

+2
-6
lines changed

rustls-wolfcrypt-provider/src/aead/quic.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,10 @@ impl AesCipher {
590590

591591
// Prepare aes_object for encryption
592592
ret = unsafe {
593-
wc_AesSetKey(
593+
wc_AesGcmSetKey(
594594
self.aes_object.as_ptr(),
595595
self.key.as_ptr(),
596596
self.key.len() as word32,
597-
ptr::null_mut(),
598-
0,
599597
)
600598
};
601599
check_if_zero(ret).unwrap();
@@ -633,12 +631,10 @@ impl AesCipher {
633631

634632
// Prepare aes_object for decryption
635633
ret = unsafe {
636-
wc_AesSetKey(
634+
wc_AesGcmSetKey(
637635
self.aes_object.as_ptr(),
638636
self.key.as_ptr(),
639637
self.key.len() as word32,
640-
ptr::null_mut(),
641-
0,
642638
)
643639
};
644640
check_if_zero(ret).unwrap();

0 commit comments

Comments
 (0)