boringssl/crypto
David Benjamin 378cca8016 Handle a modulus of -1 correctly.
Historically, OpenSSL's modular exponentiation functions tolerated negative
moduli by ignoring the sign bit. The special case for a modulus of 1 should do
the same. That said, this is ridiculous and the only reason I'm importing this
is BN_abs_is_word(1) is marginally more efficient than BN_is_one() and we
haven't gotten around to enforcing positive moduli yet.

Thanks to Guido Vranken and OSSFuzz for finding this issue and reporting to
OpenSSL.

(Imported from upstream's 235119f015e46a74040b78b10fd6e954f7f07774.)

Change-Id: I526889dfbe2356753aa1e6ecfd3aa3dc3a8cd2b8
Reviewed-on: https://boringssl-review.googlesource.com/31085
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2018-08-16 15:57:10 +00:00
..
asn1 Use new encoding functions in ASN1_mbstring_ncopy. 2018-05-11 21:58:47 +00:00
base64
bio Remove files from Trusty which can't link because of Trusty libc. 2018-04-19 19:06:58 +00:00
bn_extra
buf
bytestring Properly advance the CBS when parsing BER structures. 2018-06-26 07:23:10 +00:00
chacha Align on a single CMake style. 2018-08-10 16:22:31 +00:00
cipher_extra Align on a single CMake style. 2018-08-10 16:22:31 +00:00
cmac Support 3DES-CMAC. 2018-05-15 22:23:26 +00:00
conf
curve25519 Align on a single CMake style. 2018-08-10 16:22:31 +00:00
dh
digest_extra Add SHA256_TransformBlocks. 2018-04-25 17:51:50 +00:00
dsa Fix some timing leaks in the DSA code. 2018-06-15 02:37:45 +00:00
ec_extra Store EC_KEY's private key as an EC_SCALAR. 2018-03-07 21:17:31 +00:00
ecdh_extra Use newly-sharded ECDH tests. 2018-08-10 18:25:51 +00:00
ecdsa_extra
engine
err Support OpenSSL APIs SSL[_CTX]_set1_sigalgs[_list]. 2018-08-09 16:57:09 +00:00
evp Add new curve/hash ECDSA combinations from Wycheproof. 2018-08-10 18:26:06 +00:00
fipsmodule Handle a modulus of -1 correctly. 2018-08-16 15:57:10 +00:00
hkdf
hmac_extra
lhash Add lh_FOO_retrieve_key to avoid stack-allocating SSL_SESSION. 2018-07-03 22:56:46 +00:00
obj Update citations to RFC 8410. 2018-08-10 14:14:38 +00:00
pem Don't allow RC4 in PEM. 2018-08-16 15:33:43 +00:00
perlasm
pkcs7 Add a bunch of compatibility functions for PKCS#7. 2018-06-26 18:42:49 +00:00
pkcs8 Bound two other cases of PKCS#12 iteration counts. 2018-08-13 21:42:06 +00:00
poly1305 Align on a single CMake style. 2018-08-10 16:22:31 +00:00
pool Add some TSan coverage of CRYPTO_BUFFER. 2018-07-23 19:04:44 +00:00
rand_extra [fuchsia] Update to zx_cprng_draw 2018-06-28 21:08:18 +00:00
rc4
rsa_extra Add a thread test for RSA. 2018-07-23 19:00:03 +00:00
stack Avoid modifying stack in sk_find. 2018-04-12 21:02:12 +00:00
test Add RSA-PSS tests from Wycheproof. 2018-08-10 18:26:00 +00:00
x509 Add a pile of compatibility functions. 2018-08-13 23:13:26 +00:00
x509v3 Add a pile of compatibility functions. 2018-08-13 23:13:26 +00:00
CMakeLists.txt Don't allow RC4 in PEM. 2018-08-16 15:33:43 +00:00
compiler_test.cc
constant_time_test.cc Add a test for CRYPTO_memcmp. 2018-03-27 16:22:47 +00:00
cpu-aarch64-fuchsia.c
cpu-aarch64-linux.c
cpu-arm-linux.c
cpu-arm.c
cpu-intel.c Change OPENSSL_cpuid_setup to reserve more extended feature space. 2018-04-19 20:48:58 +00:00
cpu-ppc64le.c
crypto.c Add a pile of compatibility functions. 2018-08-13 23:13:26 +00:00
ex_data.c
internal.h Move the MSan sanity check to a source file. 2018-07-25 15:15:19 +00:00
mem.c Remove unused string.h include. 2018-04-24 17:42:39 +00:00
refcount_c11.c
refcount_lock.c
refcount_test.cc Add a basic TSan test for ref-counts. 2018-07-23 18:57:19 +00:00
self_test.cc
thread_none.c
thread_pthread.c
thread_test.cc Use std::thread in thread_test.cc. 2018-06-04 17:32:48 +00:00
thread_win.c Reland "Fix bssl client/server's error-handling." 2018-05-07 17:19:59 +00:00
thread.c