Fix to use inLen for raw public key copy. No need to throw an error for other curve types as this function may be used for software only import/export. In the TLS case with only SECP256R1 there are other places where an error will be thrown.

This commit is contained in:
David Garske
2018-09-07 16:46:42 -07:00
parent 53c2264327
commit c51c607e96

View File

@ -6314,7 +6314,7 @@ int wc_ecc_import_x963_ex(const byte* in, word32 inLen, ecc_key* key,
/* For SECP256R1 only save raw public key for hardware */
if (curve_id == ECC_SECP256R1 && !compressed &&
inLen <= sizeof(key->pubkey_raw)) {
XMEMCPY(key->pubkey_raw, (byte*)in, sizeof(key->pubkey_raw));
XMEMCPY(key->pubkey_raw, (byte*)in, inLen);
}
#endif