mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
Fix for wc_ecc_import_raw_private
using 0 for key size. Add check in silabs_ecc.
This commit is contained in:
@@ -10865,7 +10865,7 @@ static int wc_ecc_import_raw_private(ecc_key* key, const char* qx,
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \
|
||||
defined(WOLFSSL_SILABS_SE_ACCEL) || defined(WOLFSSL_CRYPTOCELL)
|
||||
defined(WOLFSSL_CRYPTOCELL)
|
||||
word32 keySz = 0;
|
||||
#endif
|
||||
|
||||
@@ -11116,7 +11116,7 @@ static int wc_ecc_import_raw_private(ecc_key* key, const char* qx,
|
||||
}
|
||||
#elif defined(WOLFSSL_SILABS_SE_ACCEL)
|
||||
if (err == MP_OKAY) {
|
||||
err = silabs_ecc_import(key, keySz, 1, (d != NULL));
|
||||
err = silabs_ecc_import(key, key->dp->size, 1, (d != NULL));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -206,7 +206,7 @@ int silabs_ecc_import(ecc_key* key, word32 keysize, int pub, int priv)
|
||||
word32 used;
|
||||
|
||||
key->key.type = silabs_map_key_type(key->dp->id);
|
||||
if (key->key.type == SILABS_UNSUPPORTED_KEY_TYPE)
|
||||
if (key->key.type == SILABS_UNSUPPORTED_KEY_TYPE || keysize == 0)
|
||||
return WC_HW_E;
|
||||
|
||||
key->key.size = keysize;
|
||||
|
Reference in New Issue
Block a user