forked from wolfSSL/wolfssl
prevent buffer overflows if sigSz > MAX_ENCODED_SIG_SZ
This commit is contained in:
@ -3586,14 +3586,12 @@ static int ConfirmSignature(const byte* buf, word32 bufSz,
|
|||||||
break; /* not confirmed */
|
break; /* not confirmed */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sigSz > MAX_ENCODED_SIG_SZ) {
|
|
||||||
WOLFSSL_MSG("Verify Signature is too big");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wc_InitRsaKey(pubKey, heap) != 0) {
|
if (wc_InitRsaKey(pubKey, heap) != 0) {
|
||||||
WOLFSSL_MSG("InitRsaKey failed");
|
WOLFSSL_MSG("InitRsaKey failed");
|
||||||
}
|
}
|
||||||
|
else if (sigSz > MAX_ENCODED_SIG_SZ) {
|
||||||
|
WOLFSSL_MSG("Verify Signature is too big");
|
||||||
|
}
|
||||||
else if (wc_RsaPublicKeyDecode(key, &idx, pubKey, keySz) < 0) {
|
else if (wc_RsaPublicKeyDecode(key, &idx, pubKey, keySz) < 0) {
|
||||||
WOLFSSL_MSG("ASN Key decode error RSA");
|
WOLFSSL_MSG("ASN Key decode error RSA");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user