boringssl/fuzz
David Benjamin a63d0ad40d Require BN_mod_exp_mont* inputs be reduced.
If the caller asked for the base to be treated as secret, we should
provide that. Allowing unbounded inputs is not compatible with being
constant-time.

Additionally, this aligns with the guidance here:
https://github.com/HACS-workshop/spectre-mitigations/blob/master/crypto_guidelines.md#1-do-not-conditionally-choose-between-constant-and-non-constant-time

Update-Note: BN_mod_exp_mont_consttime and BN_mod_exp_mont now require
inputs be fully reduced. I believe current callers tolerate this.

Additionally, due to a quirk of how certain operations were ordered,
using (publicly) zero exponent tolerated a NULL BN_CTX while other
exponents required non-NULL BN_CTX. Non-NULL BN_CTX is now required
uniformly. This is unlikely to cause problems. Any call site where the
exponent is always zero should just be replaced with BN_value_one().

Change-Id: I7c941953ea05f36dc2754facb9f4cf83a6789c61
Reviewed-on: https://boringssl-review.googlesource.com/27665
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: Steven Valdez <svaldez@google.com>
2018-04-24 18:29:29 +00:00
..
bn_div_corpus Generate bn_div and bn_mod_exp corpus from bn_tests.txt. 2017-10-27 18:57:48 +00:00
bn_mod_exp_corpus Generate bn_div and bn_mod_exp corpus from bn_tests.txt. 2017-10-27 18:57:48 +00:00
cert_corpus
client_corpus Refresh fuzzer corpora. 2017-12-18 21:54:26 +00:00
client_corpus_no_fuzzer_mode Refresh fuzzer corpora. 2017-12-18 21:54:26 +00:00
dtls_client_corpus Refresh fuzzer corpora. 2017-12-18 21:54:26 +00:00
dtls_server_corpus Refresh fuzzer corpora. 2017-12-18 21:54:26 +00:00
pkcs8_corpus
privkey_corpus
read_pem_corpus
server_corpus Refresh fuzzer corpora. 2017-12-18 21:54:26 +00:00
server_corpus_no_fuzzer_mode Refresh fuzzer corpora. 2017-12-18 21:54:26 +00:00
session_corpus
spki_corpus
ssl_ctx_api_corpus
bn_div.cc Generate bn_div and bn_mod_exp corpus from bn_tests.txt. 2017-10-27 18:57:48 +00:00
bn_mod_exp.cc Require BN_mod_exp_mont* inputs be reduced. 2018-04-24 18:29:29 +00:00
cert.cc Run the comment converter on fuzz/ and tool/ 2017-08-18 16:42:13 +00:00
client.cc Add DTLS fuzzers. 2017-09-07 22:26:50 +00:00
CMakeLists.txt Add BN fuzzer. 2017-10-23 16:38:28 +00:00
dtls_client.cc Add DTLS fuzzers. 2017-09-07 22:26:50 +00:00
dtls_server.cc Add DTLS fuzzers. 2017-09-07 22:26:50 +00:00
minimise_corpuses.sh
pkcs8.cc
privkey.cc
read_pem.cc
refresh_ssl_corpora.sh Add DTLS fuzzers. 2017-09-07 22:26:50 +00:00
server.cc Add DTLS fuzzers. 2017-09-07 22:26:50 +00:00
session.cc Remove |X509| things from SSL_SESSION. 2017-02-10 19:12:04 +00:00
spki.cc
ssl_ctx_api.cc Bound ssl_ctx_api more aggressively. 2017-06-06 20:50:55 +00:00