mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
ecc_free should be called only upon ecc_import_x963 success.
This commit is contained in:
@@ -3056,7 +3056,8 @@ static int ConfirmSignature(const byte* buf, word32 bufSz,
|
|||||||
if (ecc_import_x963(key, keySz, pubKey) < 0) {
|
if (ecc_import_x963(key, keySz, pubKey) < 0) {
|
||||||
CYASSL_MSG("ASN Key import error ECC");
|
CYASSL_MSG("ASN Key import error ECC");
|
||||||
}
|
}
|
||||||
else if (ecc_verify_hash(sig, sigSz, digest, digestSz, &verify,
|
else {
|
||||||
|
if (ecc_verify_hash(sig, sigSz, digest, digestSz, &verify,
|
||||||
pubKey) != 0) {
|
pubKey) != 0) {
|
||||||
CYASSL_MSG("ECC verify hash error");
|
CYASSL_MSG("ECC verify hash error");
|
||||||
}
|
}
|
||||||
@@ -3066,6 +3067,7 @@ static int ConfirmSignature(const byte* buf, word32 bufSz,
|
|||||||
ret = 1; /* match */
|
ret = 1; /* match */
|
||||||
|
|
||||||
ecc_free(pubKey);
|
ecc_free(pubKey);
|
||||||
|
}
|
||||||
#ifdef CYASSL_SMALL_STACK
|
#ifdef CYASSL_SMALL_STACK
|
||||||
XFREE(pubKey, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(pubKey, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user