summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2024-09-17 03:53:24 +0200
committerDamien Miller <djm@mindrot.org>2024-09-17 03:53:24 +0200
commit5fb2b5ad0e748732a27fd8cc16a7ca3c21770806 (patch)
treea8c1ca81d6b691f8ee2620c8e73865bb2ec57cd3
parentupstream: use 64 bit math to avoid signed underflow. upstream code (diff)
downloadopenssh-5fb2b5ad0e748732a27fd8cc16a7ca3c21770806.tar.xz
openssh-5fb2b5ad0e748732a27fd8cc16a7ca3c21770806.zip
fix bug in recently-added sntrup761 fuzzer
key values need to be static to persist across invocations; spotted by the Qualys Security Advisory team.
-rw-r--r--regress/misc/fuzz-harness/sntrup761_dec_fuzz.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/regress/misc/fuzz-harness/sntrup761_dec_fuzz.cc b/regress/misc/fuzz-harness/sntrup761_dec_fuzz.cc
index e508cb151..9aecae0ad 100644
--- a/regress/misc/fuzz-harness/sntrup761_dec_fuzz.cc
+++ b/regress/misc/fuzz-harness/sntrup761_dec_fuzz.cc
@@ -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];