Bug 1334106 - improve mpi fuzzing, r=bustage
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Sun, 20 Aug 2017 21:57:59 +0200
changeset 13534 b05b124f610577e8bdbd77d86f1ab894df9cdf8d
parent 13533 8606d1442fe4eecd2a4ffebf2828d57f009827a4
child 13536 f4666e28214bfed32f67d0f8255a22b50f3bc403
push id2327
push userfranziskuskiefer@gmail.com
push dateSun, 20 Aug 2017 20:03:39 +0000
reviewersbustage
bugs1334106
Bug 1334106 - improve mpi fuzzing, r=bustage
fuzz/mpi_expmod_target.cc
--- a/fuzz/mpi_expmod_target.cc
+++ b/fuzz/mpi_expmod_target.cc
@@ -16,16 +16,18 @@ extern "C" int LLVMFuzzerTestOneInput(co
   }
   INIT_FOUR_NUMBERS
 
   auto modulus = get_modulus(data, size, ctx);
   // Compare with OpenSSL exp mod
   m1 = &std::get<1>(modulus);
   check_equal(A, &a, max_size);
   check_equal(B, &b, max_size);
+  check_equal(std::get<0>(modulus), m1, max_size);
   print_bn("A", A);
   print_bn("B", B);
+  print_bn("m", std::get<0>(modulus));
   assert(mp_exptmod(&a, &b, m1, &c) == MP_OKAY);
   (void)BN_mod_exp(C, A, B, std::get<0>(modulus), ctx);
   check_equal(C, &c, 2 * max_size);
 
   CLEANUP_AND_RETURN
 }