Skip to content

Commit 17680a2

Browse files
committed
Fix leak in PKCS7 RSA-OAEP
1 parent 4551926 commit 17680a2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/pkcs7.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10494,7 +10494,7 @@ static int wc_PKCS7_DecryptKtri(wc_PKCS7* pkcs7, byte* in, word32 inSz,
1049410494
DYNAMIC_TYPE_TMP_BUFFER);
1049510495
#ifndef WC_NO_RSA_OAEP
1049610496
if (encOID == RSAESOAEPk) {
10497-
if (!outKey) {
10497+
if (outKey) {
1049810498
XFREE(outKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
1049910499
}
1050010500
}
@@ -10510,7 +10510,7 @@ static int wc_PKCS7_DecryptKtri(wc_PKCS7* pkcs7, byte* in, word32 inSz,
1051010510
WC_FREE_VAR_EX(privKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
1051110511
#ifndef WC_NO_RSA_OAEP
1051210512
if (encOID == RSAESOAEPk) {
10513-
if (!outKey) {
10513+
if (outKey) {
1051410514
XFREE(outKey, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER);
1051510515
}
1051610516
}

0 commit comments

Comments
 (0)