summaryrefslogtreecommitdiffstats
path: root/src/crypto
Commit message (Collapse)AuthorAgeFilesLines
* Handle RDRAND failures.Adam Langley2015-06-234-17/+75
| | | | | | | | | | | | I mistakenly believed that only RDSEED could fail. However, the Intel manuals state that RDRAND can fail too. This change cherry-picks the following BoringSSL changes: 2cac3506 – Handle RDRAND failures. 248abbd7 – Add missing comma in .type pragma for rdrand code. Change-Id: Icdc56a50ce36e9c525063583882c676a5312d313
* dsa_pub_encode: Write out DSA parameters (p, q, g) in addition to key.Adam Langley2015-06-231-3/+19
| | | | | | This change cherry-picks BoringSSL's e65886a5. Change-Id: I63d5dc280d420b64b658bfd85f180a01adb8a18b
* Fix for CVE-2015-1789.Adam Langley2015-06-231-7/+47
| | | | | | | | | | | | | | | | | | | X509_cmp_time does not properly check the length of the ASN1_TIME string and can read a few bytes out of bounds. In addition, X509_cmp_time accepts an arbitrary number of fractional seconds in the time string. An attacker can use this to craft malformed certificates and CRLs of various sizes and potentially cause a segmentation fault, resulting in a DoS on applications that verify certificates or CRLs. TLS clients that verify CRLs are affected. TLS clients and servers with client authentication enabled may be affected if they use custom verification callbacks. This change cherry-picks the following changes from BoringSSL: d87021d2 – Fix length checks in X509_cmp_time to avoid out-of-bounds reads. Change-Id: Ia7d0c5d889f61a3c4be6ea79a5ab41f67bc3c65c
* Fixes for CVE-2015-1791.Adam Langley2015-06-231-2/+5
| | | | | | | | | | | | | | | | If a NewSessionTicket is received by a multi-threaded client when attempting to reuse a previous ticket then a race condition can occur potentially leading to a double free of the ticket data. This change cherry-picks the following BoringSSL changes: b31040d0 – Get rid of CERT_PKEY slots in SESS_CERT. fd67aa8c – Add SSL_SESSION_from_bytes. 95d31825 – Duplicate SSL_SESSIONs when renewing them. d65bb78c – Add SSL_initial_handshake_complete. 680ca961 – Preserve session->sess_cert on ticket renewal. Change-Id: I474065330842e4ab0066b2485c1489a50e4dfd5b
* Fix Windows SDK build againKenny Root2015-06-082-2/+2
| | | | | | | Windows SDK doesn't like uppercase includes because of MinGW being used on case-sensitive filesystems. Change-Id: I27ec95f26f105798e0da118d06aa82f003be2878
* Bump revision of BoringSSL.Adam Langley2015-06-05107-2821/+3635
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This depends on https://android-review.googlesource.com/#/c/153481/ af0e32c Add SSL_get_tls_unique. 691992b Minor typo fix in comment. cc1e3df Make CBS_get_any_asn1_element accept only DER. 0976096 bytestring: Test out_header_len != NULL before writing. ba5934b Tighten up EMS resumption behaviour. b0eef0a runner: minor tidyups. 9f8ef2d Add |EVP_get_digestbyname|. b7326b0 Implement |PEM_def_callback| and call it where appropriate. e26e590 Avoid unused variable warnings with assert. efad697 Sync vs_toolschain.py up with Chromium. 39da317 Empty commit to kick the bots. 1550a84 Allow compilation for armv6 9a4996e Fix compilation of sha256-armv4.S when using -march=armv6 485a50a Match the ifdef check in bsaes-armv7.S e216288 Unexport and prune EVP_MD_CTX flags. af8731f Remove HMAC_CTX_set_flags. bf3208b Add additional HMAC tests. a1c90a5 Further tidy up cipher logic. 0fa4012 Add a test that DTLS does not support RC4. 9a980ab Fold TLS1_PRF_* into SSL_HANDSHAKE_MAC_* 29864b5 Remove SSL_CIPHER_ALGORITHM2_AEAD. 904dc72 Fold away SSL_PROTOCOL_METHOD hooks shared between TLS and DTLS. a602277 Split ssl_read_bytes hook into app_data and close_notify hooks. c933a47 Switch the ssl_write_bytes hook to ssl_write_app_data. 2c36792 EVP_Digest*Update, EVP_DigestFinal, and HMAC_Update can never fail. e2375e1 Low-level hash 'final' functions cannot fail. 049756b Fix integer types in low-level hash functions. 338e067 Reject sessions with the wrong structure version. f297e02 Reject unknown fields in d2i_SSL_SESSION. 8a228f5 Disable the malloc interceptor without glibc. bd15a8e Fix DTLS handling of multiple records in a packet. 15eaafb Fix bn_test's bc output and shut it up a little. efd8eb3 Tidy up overflows in obj_cmp. 05ead68 Readd CRYPTO_{LOCK|UNLOCK|READ|WRITE}. 71106ad Add |BIO_read_asn1| to read a single ASN.1 object. eb930b8 Fix signed/unsigned warning in bn_test.cc. b3a7b51 Fix off-by-one in BN_rand 074cc04 Reject negative shifts for BN_rshift and BN_lshift. 75fb74a aes/asm/bsaes-armv7.pl: fix compilation with Xcode 6.3. ff81e10 Add OPENSSL_PUT_ERROR line to X509V3_parse_list. 1590811 Fix typo in valid_star. e76ccae Release handshake buffer when sending no certificate. 5f04b65 Release the handshake buffer on the client for abbreviated handshakes. 5c1ce29 Decide whether or not to request client certificates early. 4b30b28 Remove server-side renego session resumption check. 5aea93e Deprecate and no-op SSL_VERIFY_CLIENT_ONCE. 34a1635 Remove fake RLE compression OID. 9c0918f Fix typo in objects.txt 91af02a Add some comments and tweak assertions for cbc.c. 74d8bc2 Don't make SSL_MODE_*HELLO_TIME configurable. 7b5aff4 Have consumers supply OPENSSL_C11_ATOMIC. ac63748 Revert "tool: we don't need -lrt." 444dce4 Do-nothing fns |OpenSSL_add_all_ciphers| and |OpenSSL_add_all_digests|. ece089c Deprecate and no-op SSL_set_state. be05c63 Remove compatibility s->version checks. 8ec8810 Remove SSL_in_before and SSL_ST_BEFORE. cd90f3a Remove renegotiation deferral logic. 44d3eed Forbid caller-initiated renegotiations and all renego as a servers. 3d59e04 Fix test used for not-in-place CBC mode. 5f387e3 Remove s->renegotiate check in SSL_clear. 20f6e97 Switch three more renegotiate checks to initial_handshake_complete. d23d5a5 Remove remnants of DTLS renegotiate. 9a41d1b Deprecate SSL_*_read_ahead and enforce DTLS packet boundaries. 76e48c5 Fix Windows mode. 3fa65f0 Fix some malloc test crashs. 0b635c5 Add malloc test support to unit tests. 3e3090d Pass a dtls1_use_epoch enum down to dtls1_seal_record. 31a0779 Factor SSL_AEAD_CTX into a dedicated type. 69d07d9 Get version-related functions from crypto.h rather than ssl.h. b487df6 Pull version, option, and mode APIs into their own sections. 7270cfc Prune version constants. 7ef9fff Remove ssl_ok. afc9ecd Unexport ssl_get_new_session and ssl_update_cache. 3b7456e Fix some documentation typos. b480428 Also skip #elif lines. 6deacb3 Parse macros in getNameFromDecl. 4831c33 Document some core SSL_CTX and SSL methods. 4dab297 Don't use struct names in ssl.h. 760b1dd Tidy up state machine coverage tests. 3629c7b Add client peer-initiated renego to the state machine tests. cff0b90 Add client-side tests for renegotiation_info enforcement. 6bff1ca Specify argc and argv arguments to refcount_test:main. 12a4768 Try to fix MSVC and __STDC_VERSION__ again. cb56c2a Cast refcounts to _Atomic before use. 0d1d0d5 Try again to only test __STDC_VERSION__ when defined. 7b348dc Disable C11 atomics on OS X. 04edcc8 Tag the mutex functions with OPENSSL_EXPORT. 6e1f645 Don't test __STDC_VERSION__ unless it's defined. 552df47 Remove leftovers of the old-style locks. 6fb174e Remove last references to named locks. 4bdb6e4 Remove remaining calls to the old lock functions. 03163f3 Remove |CRYPTO_add|. 0b5e390 Convert reference counts in ssl/ 0da323a Convert reference counts in crypto/ 6f2e733 Add infrastructure for reference counts. daaff93 Use C11 _Static_assert where available. dc8c739 Implement |DES_ede2_cbc_encrypt|. a7997f1 Set minimum DH group size to 1024 bits. 4a7b70d Add LICENSE file. b3a262c Fix |SSLeay|. f0320d3 Fix use after free in X509. 3dacff9 Always include x86_64-gcc.c in the standalone build. 9660032 Don't use x86_64-gcc.c with NO_ASM. 81091d5 Don't use uninitialized memory in RAND_bytes. d72e284 Support arbitrary elliptic curve groups. a07c0fc Fix SSL_get_current_cipher. 4b27d9f Never resume sessions on renegotiations. 785e07b Copy ecdsa_meth in EC_KEY_copy. 08dc68d Define no-op options consistently. e6df054 Add s->s3->initial_handshake_complete. 897e5e0 Default renegotiations to off. 4690bb5 Port cipher_test to file_test. 771a138 Add missing #include for abort() de12d6c Mind the end of the buffer in aligned case of generic RC4 implementation. 5694b3a Fix invalid assert in CRYPTO_ctr128_encrypt. 9b68e72 Define compatibility function |ERR_remove_state|. 2607383 Fix generate_build_files.py to account for crypto/test. af3d5bd Add no-op |RAND_load_file| function for compatibility. 58e95fc Remove a spurious semicolon after |DECLARE_LHASH_OF|. 3c65171 Add buffer.h for compatibility. c85373d Use EVP_AEAD_CTX in crypto/cipher/internal.h. Change-Id: Ife3698f4520572e1fca48732c6a1cbd4254ec85c
* external/boringssl: fix |SSLeay|.Adam Langley2015-05-191-3/+3
| | | | | | | | | SSLeay is a compatibility function for OpenSSL, but I got it wrong. It doesn't return a string, it returns a number. This doesn't end up making any difference, but it fixes a warning when building OpenSSH. Bug: 21304170 Change-Id: I3e4bb0240b18647cfe2a3ce5869948a4527ff0f0
* external/boringssl: fix use after free in X509.Adam Langley2015-05-191-1/+1
| | | | | | | This change imports upstream's beeb0fa7 and fixes a UAF in X509 if certain, 1.0.2-only, APIs are used. Change-Id: If8268c17828f7202ce57421629da1a53a9e4dcc5
* Copy ecdsa_meth in EC_KEY_copy.Adam Langley2015-05-191-0/+5
| | | | | | | This change imports 785e07b23d965e1e984c2ee9f6a0dbe06d3d658e from upstream into Android. Change-Id: I5fb67b5c39d62d6f2a2dd6980cc97569a7686eac
* Add |BIO_read_asn1| to read a single ASN.1 object.Adam Langley2015-05-192-1/+220
| | | | | | | | | | Android needs to be able to read a PKCS#7 blob from a Java InputStream. This change adds |BIO_read_asn1| which reads a single ASN.1 object from the start of a BIO without overreading. (Taken from upstream's https://boringssl-review.googlesource.com/4800) Change-Id: Id88f34bedfdff4963c72bcd5c84f2915785d1fcd
* external/boringssl: update #define guards for x86_64-gcc.c.Adam Langley2015-05-131-2/+2
| | | | | | | | | | OS X builds with NO_ASM and was getting both generic.c and x86_64-gcc.c. This change updates the latter so that it's excluded in NO_ASM builds. This is a reland of 53b609c9, which got lost in the last BoringSSL sync because I forgot to send it upstream. Change-Id: I82462e5cd1d24fa96176c89d77cafc1f7ed0a0fd
* MinGW on Linux uses lowercase include files, part 2Kenny Root2015-05-132-2/+2
| | | | | | | | On Windows this doesn't matter since the filesystems are case- insensitive, but building BoringSSL on Linux with MinGW has case-sensitive filesystems. Change-Id: I1a145ee8dbb74a9f82e23ac40e7b9d23e03ccffc
* external/boringssl: support arbitrary elliptic curve groups.Adam Langley2015-05-122-4/+38
| | | | | | | This change exposes the functions needed to support arbitrary elliptic curve groups for Android. Change-Id: I66a3662d393deadd718e43d91420fecf050502c2
* external/boringssl: bump revision.Adam Langley2015-05-12288-11388/+17713
| | | | | | This change bumps the BoringSSL revision to the current tip-of-tree. Change-Id: I91d5bf467e16e8d86cb19a4de873985f524e5faa
* Ensure BN_asc2bn, BN_dec2bn, and BN_hex2bn never give -0.Adam Langley2015-04-232-10/+11
| | | | | | | | | | | | | When |BN_dec2bn| and |BN_hex2bn| were merged (way back in the initial BoringSSL change), the neg flag was set too soon and could be cleared by |BN_add_word|. This is an import of upstream's c85573cc. The unittest change isn't included here because bn_test.c has changed significantly in upstream and BoringSSL unittests aren't run in the Android environment. Bug: 20523350 Change-Id: Iaf8efe2fe3419218437f5ebb9a15f73559860a0f
* external/boringssl: add dummy EC_GROUP_set_point_conversion_form.Adam Langley2015-04-201-0/+7
| | | | | | | | BoringSSL always uses uncompressed points. This function aborts if another form is requested or does nothing if uncompressed points are requested. Bug: 20419899 Change-Id: Ib5d0707c4e9eaee67e46a0d73d41be70ce0a9353
* external/boringssl: try to fix aarch64+Clang.Adam Langley2015-04-182-8/+2
| | | | | | | | | | | | It appears that the version of Clang in Android doesn't support the .arch_extension directive. This change removes the .arch and .arch_extension lines (because they are triggering errors) and adds a -march option on the command line instead. The aarch64+Clang build is still broken with this change, but it's broken in binder rather than BoringSSL with it. Change-Id: I32c557bdfde4df66d26794ccdd650356f2bbaf8f
* Merge "Use a different arch feature indicator for clang"Kenny Root2015-04-182-2/+17
|\
| * Use a different arch feature indicator for clangKenny Root2015-04-182-2/+17
| | | | | | | | | | | | | | | | Clang doesn't currently understand the ".arch armv8-a+crypto" syntax and instead requires the specification of ".arch_extension" to enable the crypto functionality. Change-Id: Ib7bab562055e7c7925a47030044479ec172d0a34
* | external/boringssl: update #define guards for x86_64-gcc.c.Adam Langley2015-04-181-2/+2
|/ | | | | | | OS X builds with NO_ASM and was getting both generic.c and x86_64-gcc.c. This change updates the latter so that it's excluded in NO_ASM builds. Change-Id: Idf801013db636bd4d8f6c4588102c241fdb9fbf6
* external/boringssl: fix Clang build.Adam Langley2015-04-181-1/+1
| | | | | | | | | | | The immediate in this operation is too large for ARM. GCC will automatically rewrite it to use bic (where bic does an AND NOT). Clang, however doesn't, and reasonably throws an error. This change switches to using bic in the source file, thus making both happy. Change-Id: I117083f4f70c199e5d2f933c0a0516a6f4059a92
* BoringSSL: support AES-192.Adam Langley2015-04-081-0/+61
| | | | | | Keystore has added support for it so these functions are needed again. Change-Id: Id3bf3dd10e182fe7a9b1c51bd3184ecac4cfde8b
* Add compatibility functions for OpenSSH.Adam Langley2015-04-024-0/+20
| | | | Change-Id: I2fcb67fea859220e7e7bbbdb5dd910fb847c5600
* Changes to work with OpenSSH and wpa_supplicant.Adam Langley2015-03-242-36/+8
| | | | Change-Id: I19ed78acc67bd0ad8b905ce0ac628b39da8bb161
* Include .extern and .hidden in x86-64 asm.Adam Langley2015-03-061-1/+5
| | | | | | | | This is backport of BoringSSL's d216b71f909fe56255813dab0a8d052534bdcb91 and https://boringssl-review.googlesource.com/3810 and should allow asm on x86-64 to build correctly. Change-Id: Id321768930182951223dbf90c4c910e24d9b6798
* Export the PSS padding functions.Adam Langley2015-03-051-9/+0
| | | | | | system/keymaster is using them now. Change-Id: I396e7001e6edf443ed2726d68d21704c7e557748
* Use libmingwex for gmtime_sKenny Root2015-03-041-0/+6
| | | | | | | | gmtime_s first appeared in MSVCR80, but libmingwex has a helper function that tries to find the symbol or falls back to an internal implementation. Change-Id: I5bc27e1cfcc208eb9ea1159d47791fcc90bc7794
* MinGW on Linux uses lowercase include filesKenny Root2015-03-049-13/+13
| | | | | | | | On Windows this doesn't matter since the filesystems are case- insensitive, but building BoringSSL on Linux with MinGW has case-sensitive filesystems. Change-Id: Iefd319cfda89d2d1f8d43cea39c68295bfa65c83
* Merge "Add support for reading PKCS#7 data from PEM files."Kenny Root2015-02-272-1/+146
|\
| * Add support for reading PKCS#7 data from PEM files.Adam Langley2015-02-272-1/+146
| | | | | | | | | | | | | | (This is a backport of upstream BoringSSL's 4e581b5378d7ef435c9abe39ad5c2a334bd7b6e9.) Change-Id: If799791f28cd37ce810c0065939cf1942771c7f7
* | EC_GROUP_cmp: add back the ignored BN_CTX argKenny Root2015-02-271-1/+1
| | | | | | | | Change-Id: If7c25984fadcb98ea9fb26983e04b1be3b6a2ecd
* | Merge "EC_GROUP_cmp should return zero if the groups match."Kenny Root2015-02-272-6/+9
|\ \ | |/ |/|
| * EC_GROUP_cmp should return zero if the groups match.Adam Langley2015-02-252-6/+9
| | | | | | | | | | | | | | | | | | (I got this wrong when reading the OpenSSL code.) (Cherry-picked form upstream BoringSSL's 7c21925a10d451ed13ab201e0161dea40b974397) Change-Id: Icedaa45c9d17e7c2b95fa5be1f7c0bf41cac0880
* | Add functions to parse and generate PKCS#7 files with CRLs.Adam Langley2015-02-273-22/+321
|/ | | | | | | (This is a cherry-pick of upstream BoringSSL's 50073e8c5e81d8151718e05ec54b7c213372b878.) Change-Id: Id29ea889055dbecfbba4fc4a9e01af0c49b8073e
* Add the CTX parameter back to EC_GROUP_cmp.Adam Langley2015-02-252-2/+2
| | | | | | | | | It was a mistake to remove this in the first place. (Cherry-picked from upstream BoringSSL's 93531bd70f48bc63ad7d4aedf32d69c8095170bd.) Change-Id: Iee35482bf11dd8813622e36b0c0eb8f91538007a
* Mark OPENSSL_armcap_P as hidden in asm files.Adam Langley2015-02-133-0/+3
| | | | | | | | | | | | Without this, the linker says: (sha512-armv4.o): requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC This is (I believe) a very misleading error message. The R_ARM_REL32 relocation type is the correct type for position independent code. But unless the target symbol is hidden then the linker doesn't know that it's not going to be overridden by a different ELF module. Change-Id: I9bb5f6b5f85c8de1ad5b6426cf27826976ce8248
* Initial commit of BoringSSL for Android.Adam Langley2015-01-30453-0/+189333