Fix for WOLFSSL_ECDSA_SET_K with normal math. The sign_k mp_int was not initialized.

This commit is contained in:
David Garske
2020-01-14 14:13:12 -08:00
parent 95b6076fe1
commit e9bbf89287

View File

@@ -5118,9 +5118,15 @@ int wc_ecc_sign_set_k(const byte* k, word32 klen, ecc_key* key)
if (key->sign_k == NULL) {
ret = MEMORY_E;
}
else {
XMEMSET(key->sign_k, 0, sizeof(mp_int));
}
}
}
if (ret == 0) {
ret = mp_init(key->sign_k);
}
if (ret == 0) {
ret = mp_read_unsigned_bin(key->sign_k, k, klen);
}