external/boringssl: Sync to a9670a8b476470e6f874fef3554e8059683e1413.

This includes the following changes:

https://boringssl.googlesource.com/boringssl/+log/66e61c577d39e757bf491468f651461fa79fd5e1..a9670a8b476470e6f874fef3554e8059683e1413

* No-op change to test the bots.
* Remove outdated comment in ECDSA implementation.
* Add missing assert.h include.
* Check tag class and constructed bit in d2i_ASN1_OBJECT.
Update-Note: d2i_ASN1_OBJECT will now notice more incorrect tags. It was
already checking for tag number 6, so it is unlikely anyone was relying
on this as a non-tag-checking parser.
* Don't parse constructed BIT STRINGs in crypto/bytestring
Update-Note: PKCS#7 and PKCS#12 parsers will now reject BER constructed
BIT STRINGs. We were previously misparsing them, as was OpenSSL. Given
how long the incorrect parse has been out there, without anyone noticing
(other parsers handle it correctly), it is unlikely these exist.
* Enforce DER rules for BIT STRING values.
* Remove support for indefinite lengths in crypto/asn1.
Update-Note: Invalid certificates (and the few external structures using
asn1t.h) with BER indefinite lengths will now be rejected.
* Remove support for constructed strings in crypto/asn1.
Update-Note: Invalid certificates (and the few external structures using
asn1t.h) with BER constructed strings will now be rejected.
* Check for trailing data in extensions.
Update-Note: Some previously accepted invalid certicates may be
rejected, either in certificate verification or in X509_get_ext_d2i.
* Update tools.
* Fold x509v3/pcy_int.h into x509v3/internal.h.
* Switch kModuleDigestSize to a macro.
* Switch DEPS actions on bots to Python 3.
* Match OPENSSL_EXPORT in ssl/internal.h friend declarations.
* Add a function to express the desired record version protocol.
* Add CRYPTO_BUFFER_new_from_static_data_unsafe.
* Finish documenting asn1.h.
* Trim some undocumented symbols from asn1.h.
* Add magic tag to BoringSSL binaries.
* Document and const-correct multi-string types.
* Fully unexport X509_VAL.
Update-Note: The last remnants of the now (barely usable) X509_VAL are
no longer exported. It is unlikely anyone was relying on this.
* Document ASN1_OBJECT, i2c, and c2i functions.
* Unexport ASN1_OBJECT_new.
Update-Note: ASN1_OBJECT_new is no longer exported. While this function
does remain in OpenSSL, it is extremely unlikely anyone has found a use
for this function.
* Return 0x80 in all ASN1_get_object error paths.
Update-Note: ASN1_get_object's calling convention is slightly
simplified.
* Document low-level encoding functions in asn1.h.
* Use C preprocessor comments in assembly headers.
* Document and const-correct ASN1_TYPE functions.
* Fix error-handling for i2a_ASN1_OBJECT.
* Document i2a_ASN1_* functions.
* Fold i2a_ASN1_ENUMERATED into i2a_ASN1_INTEGER.
* Fix BIT STRING comparison in ASN1_STRING_cmp.
Update-Note: ASN1_STRING_cmp no longer incorrectly treats BIT STRINGs
with different padding bits as equal.
* Rewrite ASN1_item_pack and ASN1_item_unpack.
Update-Note: ASN1_item_unpack now checks for trailing data.
* Document some more ASN1_ITEM-associated functions.
* Reword ASN1_BOOLEAN exception.
* Move M_ASN1_* to the deprecated section.
* Fix up some doc.go nits in asn1.h.
* Document new/free/d2i/i2d for singly-typed ASN1_STRINGs.
* Document ASN1_NULL.
* Const-correct the low-level ASN1 i2d functions.
Update-Note: The type signature of some i2d functions, such as
i2d_ASN1_OCTET_STRING, is now const-correct.
* Start documenting ASN1_ITEM.
* Tidy up SSLTest.SetVersion.
* Deduplicate d2i and i2d documentation.
* Check tag class and constructed bit in d2i_ASN1_BOOLEAN.
* Use typedefs in i2d and d2i_ASN1_BOOLEAN.
* Forward-declare SSL_CLIENT_HELLO.
* Fix BN_CTX usage in BN_mod_sqrt malloc error paths.
* Make ASN1_NULL an opaque pointer.
Update-Note: Code that was assuming ASN1_NULL was an int typedef will
fail to compile. Given this was never dereferencable, it is hard to
imagine anything relying on this.
* Remove remnants of ASN.1 print function generators.
* Fold x509_vfy.h into x509.h.
* Make ASN1_STRING_TABLE_add thread-safe and document.
Update-Note: ASN1_STRING_TABLE_add no longer allows overwrite existing
entries. In most cases, this would crash or trigger a race condition
anyway.
* Test ASN1_STRING_set_by_NID with custom NIDs.
* Test ASN1_STRING_set_by_NID with built-in NIDs.
* Test that built-in ASN1_STRING_TABLEs are sorted.
* Extract common rotl/rotr functions.
* Remove X509_STORE_set0_additional_untrusted.
* Enable X509_V_FLAG_TRUSTED_FIRST by default.
Update-Note: X509_verify_cert will now build slightly different chains
by default. Hopefully, this fixes more issues than it causes, but there
is a risk of trusted_first breaking other scenarios. Those scenarios
will also break OpenSSL 1.1.x defaults, so hopefully this is fine.
* Switch x509_test.cc to modify the existing X509_VERIFY_PARAM.
* Add note to HMAC test vectors from NIST
* Add log tag for Trusty.
* Fix CRYPTO_malloc, etc., definitions.
* Keep EVP_CIPHER/EVP_MD lookup and do_all functions in sync
* aarch64: Add missing LR validation in 'vpaes_cbc_encrypt'

Test: atest CtsLibcoreTestCases CtsLibcoreOkHttpTestCases
Change-Id: I0fc8c0f6505d4ee04193404cf02ec776bced8d40
209 files changed