Merge pull request #325 from kaleb-himes/CID-66016-coverity

Always execute wc_InitRsaKey if we are always going to execute wc_Fre…
This commit is contained in:
dgarske
2016-02-25 08:45:06 +01:00

View File

@@ -3586,13 +3586,12 @@ static int ConfirmSignature(const byte* buf, word32 bufSz,
break; /* not confirmed */
}
#endif
if (sigSz > MAX_ENCODED_SIG_SZ) {
WOLFSSL_MSG("Verify Signature is too big");
}
else if (wc_InitRsaKey(pubKey, heap) != 0) {
if (wc_InitRsaKey(pubKey, heap) != 0) {
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) {
WOLFSSL_MSG("ASN Key decode error RSA");
}