forked from wolfSSL/wolfssl
Merge pull request #6580 from dgarske/sig_verify
Fix for `wc_SignatureGenerate_ex` calling verify twice
This commit is contained in:
@ -525,17 +525,12 @@ int wc_SignatureGenerate_ex(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
/* Generate signature using hash */
|
/* Generate signature using hash (also handles verify) */
|
||||||
ret = wc_SignatureGenerateHash(hash_type, sig_type,
|
ret = wc_SignatureGenerateHash_ex(hash_type, sig_type, hash_data,
|
||||||
hash_data, hash_enc_len, sig, sig_len, key, key_len, rng);
|
hash_enc_len, sig, sig_len, key, key_len, rng, verify);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0 && verify) {
|
|
||||||
ret = wc_SignatureVerifyHash(hash_type, sig_type, hash_data,
|
|
||||||
hash_enc_len, sig, *sig_len, key, key_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(WOLFSSL_SMALL_STACK) || defined(NO_ASN)
|
#if defined(WOLFSSL_SMALL_STACK) || defined(NO_ASN)
|
||||||
XFREE(hash_data, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(hash_data, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user