mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-28 06:12:20 +01:00
For ED255219 and ED448 if importing private only and public key is already set then check it.
This commit is contained in:
@@ -1054,6 +1054,11 @@ int wc_ed25519_import_private_only(const byte* priv, word32 privSz,
|
||||
XMEMCPY(key->k, priv, ED25519_KEY_SIZE);
|
||||
key->privKeySet = 1;
|
||||
|
||||
if (key->pubKeySet) {
|
||||
/* Validate loaded public key */
|
||||
return wc_ed25519_check_key(key);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -997,6 +997,11 @@ int wc_ed448_import_private_only(const byte* priv, word32 privSz,
|
||||
key->privKeySet = 1;
|
||||
}
|
||||
|
||||
if ((ret == 0) && key->pubKeySet) {
|
||||
/* Validate loaded public key */
|
||||
ret = wc_ed448_check_key(key);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user