Always initialize 'decryptedKey'

Warning 750167.5627928
This commit is contained in:
Andras Fekete
2024-01-19 10:58:29 -05:00
parent 7069a1805a
commit dbc209d8ea

View File

@ -11830,10 +11830,6 @@ WOLFSSL_API int wc_PKCS7_DecodeAuthEnvelopedData(PKCS7* pkcs7, byte* in,
} }
#endif #endif
#ifndef WOLFSSL_SMALL_STACK
XMEMSET(decryptedKey, 0, MAX_ENCRYPTED_KEY_SZ);
#endif
switch (pkcs7->state) { switch (pkcs7->state) {
case WC_PKCS7_START: case WC_PKCS7_START:
case WC_PKCS7_INFOSET_START: case WC_PKCS7_INFOSET_START:
@ -11872,6 +11868,7 @@ WOLFSSL_API int wc_PKCS7_DecodeAuthEnvelopedData(PKCS7* pkcs7, byte* in,
pkcs7->stream->key = decryptedKey; pkcs7->stream->key = decryptedKey;
#endif #endif
#endif #endif
XMEMSET(decryptedKey, 0, MAX_ENCRYPTED_KEY_SZ);
FALL_THROUGH; FALL_THROUGH;
case WC_PKCS7_DECRYPT_KTRI: case WC_PKCS7_DECRYPT_KTRI: