fix bug in recently-added sntrup761 fuzzer

key values need to be static to persist across invocations;
spotted by the Qualys Security Advisory team.
This commit is contained in:
Damien Miller 2024-09-17 11:53:24 +10:00
parent 0ca128c9ee
commit 5fb2b5ad0e
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -50,8 +50,8 @@ void privkeys(unsigned char *zero_sk, unsigned char *rnd_sk)
int LLVMFuzzerTestOneInput(const uint8_t* input, size_t len)
{
static bool once;
unsigned char zero_sk[crypto_kem_sntrup761_SECRETKEYBYTES];
unsigned char rnd_sk[crypto_kem_sntrup761_SECRETKEYBYTES];
static unsigned char zero_sk[crypto_kem_sntrup761_SECRETKEYBYTES];
static unsigned char rnd_sk[crypto_kem_sntrup761_SECRETKEYBYTES];
unsigned char ciphertext[crypto_kem_sntrup761_CIPHERTEXTBYTES];
unsigned char secret[crypto_kem_sntrup761_BYTES];