mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
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) {
|
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. */
|
/* No IV passed in, check for cached IV. */
|
||||||
if ((iv == NULL) && (aes->nonceSz != 0)) {
|
if ((iv == NULL) && (aes->nonceSz != 0)) {
|
||||||
/* Use the cached copy. */
|
/* Use the cached copy. */
|
||||||
|
Reference in New Issue
Block a user