boringssl/crypto/x509v3
Martin Kreichgauer b86be3617d Guard against DoS in name constraints handling.
This guards against the name constraints check consuming large amounts
of CPU time when certificates in the presented chain contain an
excessive number of names (specifically subject email names or subject
alternative DNS names) and/or name constraints.

Name constraints checking compares the names presented in a certificate
against the name constraints included in a certificate higher up in the
chain using two nested for loops.

Move the name constraints check so that it happens after signature
verification so peers cannot exploit this using a chain with invalid
signatures. Also impose a hard limit on the number of name constraints
check loop iterations to further mitigate the issue.

Thanks to NCC for finding this issue.

Change-Id: I112ba76fe75d1579c45291042e448850b830cbb7
Reviewed-on: https://boringssl-review.googlesource.com/19164
Reviewed-by: Martin Kreichgauer <martinkr@google.com>
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-09-06 22:00:46 +00:00
..
CMakeLists.txt Convert the tests in x509v3 to GTest. 2017-07-10 19:05:04 +00:00
ext_dat.h Convert the tests in x509v3 to GTest. 2017-07-10 19:05:04 +00:00
pcy_cache.c
pcy_data.c
pcy_int.h Convert stack.h to use inline functions. 2017-05-22 15:06:04 +00:00
pcy_lib.c Delete some dead code from crypto/x509. 2017-06-09 19:58:08 +00:00
pcy_map.c
pcy_node.c Convert stack.h to use inline functions. 2017-05-22 15:06:04 +00:00
pcy_tree.c Avoid possible memleak in X509_policy_check() 2017-07-06 18:53:18 +00:00
tab_test.cc Convert the tests in x509v3 to GTest. 2017-07-10 19:05:04 +00:00
v3_akey.c
v3_akeya.c
v3_alt.c Fix some error path logic in i2v_AUTHORITY_INFO_ACCESS and i2v_GENERAL_NAME 2017-05-03 17:18:27 +00:00
v3_bcons.c
v3_bitst.c
v3_conf.c Fix an error path leak in do_ext_nconf() 2016-07-26 19:11:01 +00:00
v3_cpols.c Fix a crash in print_notice. 2017-03-21 14:50:26 +00:00
v3_crld.c
v3_enum.c
v3_extku.c
v3_genn.c
v3_ia5.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
v3_info.c Fix some error path logic in i2v_AUTHORITY_INFO_ACCESS and i2v_GENERAL_NAME 2017-05-03 17:18:27 +00:00
v3_int.c
v3_lib.c
v3_ncons.c Guard against DoS in name constraints handling. 2017-09-06 22:00:46 +00:00
v3_pci.c Remove 'file:' feature in v3_pci.c's CONF hooks. 2017-03-10 17:12:55 +00:00
v3_pcia.c
v3_pcons.c
v3_pku.c
v3_pmaps.c
v3_prn.c
v3_purp.c Fix x509v3_cache_extensions locking. 2016-12-05 23:12:49 +00:00
v3_skey.c
v3_sxnet.c
v3_utl.c Use functions that do not depend on the current locale. 2017-07-25 22:53:33 +00:00
v3name_test.cc Convert the tests in x509v3 to GTest. 2017-07-10 19:05:04 +00:00