aboutsummaryrefslogtreecommitdiff
path: root/fuzz/bn_mod_exp.cc
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2017-10-26 22:34:55 -0400
committerCQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>2017-10-27 18:57:48 +0000
commitaf92418b8b2c8de26e50eee069d86511a7030029 (patch)
tree3e82fb6803e34e9b729e49c707f57a3de7be28b0 /fuzz/bn_mod_exp.cc
parent51073ce05587f413d46f908407b47e884d6d325e (diff)
downloadboringssl-af92418b8b2c8de26e50eee069d86511a7030029.zip
boringssl-af92418b8b2c8de26e50eee069d86511a7030029.tar.gz
boringssl-af92418b8b2c8de26e50eee069d86511a7030029.tar.bz2
Generate bn_div and bn_mod_exp corpus from bn_tests.txt.
Also switch them to accepting a u16 length prefix. We appear not to have any such tests right now, but RSA-2048 would involve modulus well larger and primes just a hair larger than a u8 length prefix alows. Change-Id: Icce8f1d976e159b945302fbba732e72913c7b724 Reviewed-on: https://boringssl-review.googlesource.com/22284 Commit-Queue: Steven Valdez <svaldez@google.com> Reviewed-by: Steven Valdez <svaldez@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Diffstat (limited to 'fuzz/bn_mod_exp.cc')
-rw-r--r--fuzz/bn_mod_exp.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/fuzz/bn_mod_exp.cc b/fuzz/bn_mod_exp.cc
index e38236d..bcc5097 100644
--- a/fuzz/bn_mod_exp.cc
+++ b/fuzz/bn_mod_exp.cc
@@ -61,12 +61,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
CBS cbs, child0, child1, child2;
uint8_t sign;
CBS_init(&cbs, buf, len);
- if (!CBS_get_u8_length_prefixed(&cbs, &child0) ||
+ if (!CBS_get_u16_length_prefixed(&cbs, &child0) ||
!CBS_get_u8(&child0, &sign) ||
CBS_len(&child0) == 0 ||
- !CBS_get_u8_length_prefixed(&cbs, &child1) ||
+ !CBS_get_u16_length_prefixed(&cbs, &child1) ||
CBS_len(&child1) == 0 ||
- !CBS_get_u8_length_prefixed(&cbs, &child2) ||
+ !CBS_get_u16_length_prefixed(&cbs, &child2) ||
CBS_len(&child2) == 0) {
return 0;
}