summaryrefslogtreecommitdiffhomepage
path: root/fuzzer-verify.c
diff options
context:
space:
mode:
authorSteffen Jaeckel <s_jaeckel@gmx.de>2019-09-16 15:50:38 +0200
committerMatt Johnston <matt@ucc.asn.au>2019-09-16 21:50:38 +0800
commit615ed4e46a52b6bfe0bfc581b8c2fbcc6cc488d1 (patch)
tree12b2ba29ae4c42fc65d64d43968c5d03ab3f4452 /fuzzer-verify.c
parentfa116e983b4931010e1082dd5c8bf38bbc77718c (diff)
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
Diffstat (limited to 'fuzzer-verify.c')
-rw-r--r--fuzzer-verify.c12
1 files changed, 7 insertions, 5 deletions
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) {