forked from wolfSSL/wolfssl
Fix buffer overflow in GetOID
When converting BER to DER we switched the pointer for pkiMsg to the DER but not the size which could cause buffer overflow. Fixes ZD13471
This commit is contained in:
@ -10497,8 +10497,10 @@ WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* in,
|
|||||||
|
|
||||||
#ifdef ASN_BER_TO_DER
|
#ifdef ASN_BER_TO_DER
|
||||||
/* check if content was BER and has been converted to DER */
|
/* check if content was BER and has been converted to DER */
|
||||||
if (pkcs7->derSz > 0)
|
if (pkcs7->derSz > 0) {
|
||||||
pkiMsg = in = pkcs7->der;
|
pkiMsg = in = pkcs7->der;
|
||||||
|
pkiMsgSz = inSz = pkcs7->derSz;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
decryptedKey = (byte*)XMALLOC(MAX_ENCRYPTED_KEY_SZ, pkcs7->heap,
|
decryptedKey = (byte*)XMALLOC(MAX_ENCRYPTED_KEY_SZ, pkcs7->heap,
|
||||||
|
Reference in New Issue
Block a user