From 27b5ac421ef39cf2b536f34714ba2ec598ea306f Mon Sep 17 00:00:00 2001 From: Andras Fekete Date: Wed, 28 Dec 2022 15:10:28 -0500 Subject: [PATCH] Use the actual size of the structure --- src/ssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index f6c89fbad..6cce03433 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -39305,7 +39305,7 @@ int wolfSSL_RAND_poll(void) case AES_192_CBC_TYPE : case AES_256_CBC_TYPE : WOLFSSL_MSG("AES CBC"); - XMEMCPY(ctx->iv, &ctx->cipher.aes.reg, AES_BLOCK_SIZE); + XMEMCPY(ctx->iv, &ctx->cipher.aes.reg, ctx->ivSz); break; #endif #ifdef HAVE_AESGCM @@ -39313,7 +39313,7 @@ int wolfSSL_RAND_poll(void) case AES_192_GCM_TYPE : case AES_256_GCM_TYPE : WOLFSSL_MSG("AES GCM"); - XMEMCPY(ctx->iv, &ctx->cipher.aes.reg, AES_BLOCK_SIZE); + XMEMCPY(ctx->iv, &ctx->cipher.aes.reg, ctx->ivSz); break; #endif /* HAVE_AESGCM */ #ifdef HAVE_AES_ECB