mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 15:50:55 +02:00
validate falcon level before check
This commit is contained in:
@@ -700,6 +700,14 @@ int wc_falcon_check_key(falcon_key* key)
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
if ((key->level != 1) && (key->level != 5)) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
if (!key->pubKeySet || !key->prvKeySet) {
|
||||
return PUBLIC_KEY_E;
|
||||
}
|
||||
|
||||
/* The public key is also decoded and stored within the private key buffer
|
||||
* behind the private key. Hence, we can compare both stored public keys. */
|
||||
if (key->level == 1) {
|
||||
|
||||
Reference in New Issue
Block a user