Merge pull request #8636 from douzzer/20250403-linuxkm-lkcapi-fixes

20250403-linuxkm-lkcapi-fixes
pull/8637/head
Sean Parkinson 2025-04-04 15:45:34 +10:00 committed by GitHub
commit 827516c040
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 9 deletions

View File

@ -485,7 +485,7 @@ static int km_AesGet(struct km_AesCtx *ctx, int decrypt_p, int copy_p, Aes **aes
if (aes_copy == NULL)
return -ENOMEM;
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;
#endif
*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) {
if ((! aes) || (! *aes))
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);
#if defined(HAVE_FIPS) && FIPS_VERSION3_LT(6,0,0)
ForceZero(*aes, sizeof **aes);