forked from wolfSSL/wolfssl
linuxkm/lkcapi_glue.c: in km_AesGet(), only null aes_copy->streamData in
WOLFSSL_AESGCM_STREAM builds, and in km_AesFree(), remove ad hoc zeroization of (*aes)->streamData gated on FIPS_VERSION3_LT(6,0,0) because it doesn't include WOLFSSL_AESGCM_STREAM.
This commit is contained in:
@@ -485,7 +485,7 @@ static int km_AesGet(struct km_AesCtx *ctx, int decrypt_p, int copy_p, Aes **aes
|
|||||||
if (aes_copy == NULL)
|
if (aes_copy == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
XMEMCPY(aes_copy, ret, sizeof(Aes));
|
XMEMCPY(aes_copy, ret, sizeof(Aes));
|
||||||
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_AESNI)
|
#if defined(WOLFSSL_AESGCM_STREAM) && defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_AESNI)
|
||||||
aes_copy->streamData = NULL;
|
aes_copy->streamData = NULL;
|
||||||
#endif
|
#endif
|
||||||
*aes = aes_copy;
|
*aes = aes_copy;
|
||||||
@@ -500,14 +500,6 @@ static int km_AesGet(struct km_AesCtx *ctx, int decrypt_p, int copy_p, Aes **aes
|
|||||||
static void km_AesFree(Aes **aes) {
|
static void km_AesFree(Aes **aes) {
|
||||||
if ((! aes) || (! *aes))
|
if ((! aes) || (! *aes))
|
||||||
return;
|
return;
|
||||||
#if defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
|
|
||||||
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_AESNI)
|
|
||||||
if ((*aes)->streamData) {
|
|
||||||
ForceZero((*aes)->streamData, 5 * AES_BLOCK_SIZE);
|
|
||||||
free((*aes)->streamData);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
wc_AesFree(*aes);
|
wc_AesFree(*aes);
|
||||||
#if defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
|
#if defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
|
||||||
ForceZero(*aes, sizeof **aes);
|
ForceZero(*aes, sizeof **aes);
|
||||||
|
Reference in New Issue
Block a user