mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
check key for NULL in wc_ecc_import_private_key_ex()
This commit is contained in:
@@ -5315,15 +5315,15 @@ int wc_ecc_import_private_key_ex(const byte* priv, word32 privSz,
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (key == NULL || priv == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
/* public optional, NULL if only importing private */
|
||||
if (pub != NULL) {
|
||||
ret = wc_ecc_import_x963_ex(pub, pubSz, key, curve_id);
|
||||
key->type = ECC_PRIVATEKEY;
|
||||
}
|
||||
else {
|
||||
if (key == NULL || priv == NULL)
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
/* make sure required variables are reset */
|
||||
wc_ecc_reset(key);
|
||||
|
||||
@@ -5335,7 +5335,6 @@ int wc_ecc_import_private_key_ex(const byte* priv, word32 privSz,
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
|
||||
#ifdef WOLFSSL_ATECC508A
|
||||
/* TODO: Implement equiv call to ATECC508A */
|
||||
return BAD_COND_E;
|
||||
|
Reference in New Issue
Block a user