Fix ECC sign with custom curves so the custom params (dp) are passed to public key used for sign.

This commit is contained in:
David Garske 2017-07-24 14:43:38 -07:00
parent f147b01674
commit 5180cf4cce

View File

@ -3538,6 +3538,13 @@ int wc_ecc_sign_hash_ex(const byte* in, word32 inlen, WC_RNG* rng,
/* don't use async for key, since we don't support async return here */
if (wc_ecc_init_ex(&pubkey, key->heap, INVALID_DEVID) == MP_OKAY) {
#ifdef WOLFSSL_CUSTOM_CURVES
/* if custom curve, apply params to pubkey */
if (key->idx == ECC_CUSTOM_IDX) {
wc_ecc_set_custom_curve(&pubkey, key->dp);
}
#endif
for (;;) {
if (++loop_check > 64) {
err = RNG_FAILURE_E;