boringssl/crypto/dh
David Benjamin cd24a39f1b Limit DHE groups to 4096-bit.
dh.c had a 10k-bit limit but it wasn't quite correctly enforced. However,
that's still 1.12s of jank on the IO thread, which is too long. Since the SSL
code consumes DHE groups from the network, it should be responsible for
enforcing what sanity it needs on them.

Costs of various bit lengths on 2013 Macbook Air:
1024 - 1.4ms
2048 - 14ms
3072 - 24ms
4096 - 55ms
5000 - 160ms
10000 - 1.12s

UMA says that DHE groups are 0.2% 4096-bit and otherwise are 5.5% 2048-bit and
94% 1024-bit and some noise. Set the limit to 4096-bit to be conservative,
although that's already quite a lot of jank.

BUG=554295

Change-Id: I8e167748a67e4e1adfb62d73dfff094abfa7d215
Reviewed-on: https://boringssl-review.googlesource.com/6464
Reviewed-by: Adam Langley <agl@google.com>
2015-11-11 22:18:39 +00:00
..
check.c dh/check.c: check BN_CTX_get's return value. 2014-06-20 13:17:39 -07:00
CMakeLists.txt Unwind DH_METHOD and DSA_METHOD. 2015-11-03 22:54:36 +00:00
dh_asn1.c Inital import. 2014-06-20 13:17:32 -07:00
dh_test.cc Convert dh_test to C++. 2015-05-11 18:47:30 +00:00
dh.c Limit DHE groups to 4096-bit. 2015-11-11 22:18:39 +00:00
internal.h Recognize common DH parameter sets. 2015-01-16 14:46:59 -08:00
params.c Unwind DH_METHOD and DSA_METHOD. 2015-11-03 22:54:36 +00:00