From 615ed4e46a52b6bfe0bfc581b8c2fbcc6cc488d1 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 16 Sep 2019 15:50:38 +0200 Subject: update ltm to 1.1.0 and enable FIPS 186.4 compliant key-generation (#79) * make key-generation compliant to FIPS 186.4 * fix includes in tommath_class.h * update fuzzcorpus instead of error-out * fixup fuzzing make-targets * update Makefile.in * apply necessary patches to ltm sources * clean-up not required ltm files * update to vanilla ltm 1.1.0 this already only contains the required files * remove set/get double --- fuzzer-verify.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'fuzzer-verify.c') diff --git a/fuzzer-verify.c b/fuzzer-verify.c index bbef524..8ecbcdb 100644 --- a/fuzzer-verify.c +++ b/fuzzer-verify.c @@ -37,11 +37,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { if (type == DROPBEAR_SIGNKEY_DSS) { /* So far have seen dss keys with bad p/q/g domain parameters */ - int pprime, qprime; - assert(mp_prime_is_prime(key->dsskey->p, 5, &pprime) == MP_OKAY); - assert(mp_prime_is_prime(key->dsskey->q, 18, &qprime) == MP_OKAY); - boguskey = !(pprime && qprime); - /* Could also check g**q mod p == 1 */ + int pprime, qprime, trials; + trials = mp_prime_rabin_miller_trials(mp_count_bits(key->dsskey->p)); + assert(mp_prime_is_prime(key->dsskey->p, trials, &pprime) == MP_OKAY); + trials = mp_prime_rabin_miller_trials(mp_count_bits(key->dsskey->q)); + assert(mp_prime_is_prime(key->dsskey->q, trials, &qprime) == MP_OKAY); + boguskey = !(pprime && qprime); + /* Could also check g**q mod p == 1 */ } if (!boguskey) { -- cgit v1.2.3