forked from wolfSSL/wolfssl
Merge pull request #6224 from SparkiDev/quic_aes_gcm_stream
AES-GCM streaming: EVP needs to set IV with wc_AesGcmInit
This commit is contained in:
@ -8169,6 +8169,11 @@ int wc_AesGcmInit(Aes* aes, const byte* key, word32 len, const byte* iv,
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
/* Set the IV passed in if it is smaller than a block. */
|
||||
if ((iv != NULL) && (ivSz <= AES_BLOCK_SIZE)) {
|
||||
XMEMCPY((byte*)aes->reg, iv, ivSz);
|
||||
aes->nonceSz = ivSz;
|
||||
}
|
||||
/* No IV passed in, check for cached IV. */
|
||||
if ((iv == NULL) && (aes->nonceSz != 0)) {
|
||||
/* Use the cached copy. */
|
||||
|
Reference in New Issue
Block a user