]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
fix bug in recently-added sntrup761 fuzzer
authorDamien Miller <djm@mindrot.org>
Tue, 17 Sep 2024 01:53:24 +0000 (11:53 +1000)
committerDamien Miller <djm@mindrot.org>
Tue, 17 Sep 2024 01:53:24 +0000 (11:53 +1000)
key values need to be static to persist across invocations;
spotted by the Qualys Security Advisory team.

regress/misc/fuzz-harness/sntrup761_dec_fuzz.cc

index e508cb15166c9e5c4bb853595b5d06aaeba0e85c..9aecae0ad1862027f91ef378e5e25d322f462d68 100644 (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];