Skip to content

Commit 25dd8b6

Browse files
committed
added check on error out from wc_PKCS7_EncodeAuthEnvelopedData
1 parent bcbb544 commit 25dd8b6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

wolfcrypt/src/pkcs7.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13624,7 +13624,14 @@ WOLFSSL_API int wc_PKCS7_DecodeAuthEnvelopedData(PKCS7* pkcs7, byte* in,
1362413624
}
1362513625
XFREE(decryptedKey, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
1362613626
}
13627+
#else
13628+
if (ret < 0) {
13629+
ForceZero(encryptedContent, (word32)encryptedContentSz);
13630+
XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
13631+
ForceZero(decryptedKey, MAX_ENCRYPTED_KEY_SZ);
13632+
}
1362713633
#endif
13634+
1362813635
#ifndef NO_PKCS7_STREAM
1362913636
if (ret != 0 && ret != WC_NO_ERR_TRACE(WC_PKCS7_WANT_READ_E)) {
1363013637
wc_PKCS7_ResetStream(pkcs7);

0 commit comments

Comments
 (0)