Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-09-21Use pthreads on MinGW.David Benjamin
Android uses MinGW for some host tools on Windows. That toolchain doesn't support the #pragma tricks we use for thread-local destructors, but does appear to support pthreads. This also lets us remove the INIT_ONCE workaround, although that's removable anyway since Android's MinGW is now new enough. Change-Id: I8d1573923fdaac880a50d84acbebbf87461c50d2 Reviewed-on: https://boringssl-review.googlesource.com/11125 Reviewed-by: David Benjamin <davidben@google.com> Reviewed-by: Kenny Root <kroot@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-21Pack an SSL* a little better.Adam Langley
On 64-bit systems the SSL structure is 1/16th padding. This change reorders some fields and changes one to a bitfield in order to reduce the memory usage a little. Change-Id: Id7626a44d22652254717d544bdc2e08f1b0d705f Reviewed-on: https://boringssl-review.googlesource.com/11140 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-19Release TLS 1.3 key shares earlier in TLS 1.2.David Benjamin
This isn't hugely important since the hs object will actually be released at the end of the handshake, but no sense in holding on to them longer than needed. Also release |public_key| when we no longer need it and document what the fields mean. Change-Id: If677cb4a915c75405dabe7135205630527afd8bc Reviewed-on: https://boringssl-review.googlesource.com/10360 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-19Define __STDC_CONSTANT_MACROS in bn_test.cc.David Benjamin
C99 decided that, like PRI* macros, UINT64_C and friends should be conditioned on __STDC_CONSTANT_MACROS in C++. C++11 then decided this was ridiculous and overruled this decision. However, Android's headers in older NDKs mistakenly followed the C99 rules for C++, so work around this. This fixes the android_arm bots. Change-Id: I3b49e8dfc20190ebfa78876909bd0dccd3e210ea Reviewed-on: https://boringssl-review.googlesource.com/11089 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-18Add BN_set_u64.David Benjamin
Android currently implements this manually (see NativeBN_putULongInt) by reaching into BIGNUM's internals. BN_ULONG is a somewhat unfortunate API anyway as the size is platform-dependent, so add a platform-independent way to do this. The other things Android needs are going to need more work, but this one's easy. BUG=97 Change-Id: I4af4dc29f9845bdce0f0663c379b4b5d3e1dc46e Reviewed-on: https://boringssl-review.googlesource.com/11088 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-17Add EVP_AEAD_CTX_aead.David Benjamin
Code acting generically on an EVP_AEAD_CTX may wish to get at the underlying EVP_AEAD. Change-Id: I9cc905522ba76402bda4c255aa1488158323b02c Reviewed-on: https://boringssl-review.googlesource.com/11085 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Matt Braithwaite <mab@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2016-09-16Don't pass -Wa,-g on clang.David Benjamin
clang's integrated assembler does not appear to support debug symbols yet. (And somehow CMake has another statefulness bug that causes this to only manifest on a second run, so the try bots aren't noticing.) Also don't clobber the existing CMAKE_ASM_FLAGS value. Change-Id: Ia04345f0dc2f9833ac13912d761cfab3479c10cd Reviewed-on: https://boringssl-review.googlesource.com/11083 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2016-09-16Don't send the access_denied alert innappropriately.David Benjamin
access_denied is only used to indicate client cert errors and Chrome maps it to ERR_SSL_BAD_CLIENT_AUTH_CERT accordingly: access_denied A valid certificate was received, but when access control was applied, the sender decided not to proceed with negotiation. This message is always fatal. We don't appear to be the cause of Chrome's recent ERR_SSL_BAD_CLIENT_AUTH_CERT spike, but we should send these correctly nonetheless. If the early callback fails, handshake_failure seems the most appropriate ("I was unable to find suitable parameters"). There isn't really an alert that matches DoS, but internal_error seems okay? internal_error An internal error unrelated to the peer or the correctness of the protocol (such as a memory allocation failure) makes it impossible to continue. This message is always fatal. There's nothing wrong, per se, with your ClientHello, but I just can't deal with it right now. Please go away. Change-Id: Icd1c998c09dc42daa4b309c1a4a0f136b85eb69d Reviewed-on: https://boringssl-review.googlesource.com/11084 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-16Add a few more scopers.David Benjamin
Conscrypt uses these types. Note that BORINGSSL_MAKE_STACK_DELETER requires DECLARE_STACK_OF to work. Otherwise the compiler gives some really confusing error. Change-Id: I8d194067ea6450937e4a8fcb4acbbf98a2550bce Reviewed-on: https://boringssl-review.googlesource.com/11082 Reviewed-by: Kenny Root <kroot@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-16Remove a few more remnants of RC4/TLS.David Benjamin
Change-Id: I5d7fd9ba0688a3ebd6f6d36768cc3c0e33e2da52 Reviewed-on: https://boringssl-review.googlesource.com/11081 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Matt Braithwaite <mab@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2016-09-16Remove RC4 from TLS for real.Matthew Braithwaite
This withdraws support for -DBORINGSSL_ENABLE_RC4_TLS, and removes the RC4 AEADs. Change-Id: I1321b76bfe047d180743fa46d1b81c5d70c64e81 Reviewed-on: https://boringssl-review.googlesource.com/10940 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-14Add SSL_CTX_get_keylog_callback.David Benjamin
Conscrypt would like to write a CTS test that the callback isn't set unexpectedly. Change-Id: I11f987422daf0544e90f5cff4d7aaf557ac1f5a2 Reviewed-on: https://boringssl-review.googlesource.com/11060 Reviewed-by: Kenny Root <kroot@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-14Move android-cmake README to METADATA file.Adam Langley
A METADATA file provides more structured information about included third-party code. Change-Id: I58b285ac2d73139e5b3843ba33d4d923b676afb7 Reviewed-on: https://boringssl-review.googlesource.com/11042 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-14Move gcm_test to C++Adam Langley
Since gcm_test now contains variable decls in for loops it needs -std=c11. However, tests are compiled with C++ test_support files in Bazel, which doesn't work with -std=c11. Change-Id: Ife18c2d80b01448bb3b7ee2728412289bf749bd9 Reviewed-on: https://boringssl-review.googlesource.com/11041 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-14Implement BIO_eof() for compatibilityAlessandro Ghedini
This function (actually a macro in OpenSSL) is used by several projects (e.g. OpenResty, OpenVPN, ...) so it can useuful to provide it for compatibility. However, depending on the semantics of the BIO type (e.g. BIO_pair), the return value can be meaningless, which might explain why it was removed. Change-Id: I0e432c92222c267eb994d32b0bc28e999c4b40a7 Reviewed-on: https://boringssl-review.googlesource.com/11020 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
2016-09-14Use C99 for size_t loops in gcm.c.David Benjamin
The stuff around i being reused for |len| rounded to a number of blocks is a little weird. Change-Id: I6f07a82fe84d077062e5b34ce75cc68250be8a4a Reviewed-on: https://boringssl-review.googlesource.com/10802 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-13Update API-CONVENTIONS.md for the new scopers.David Benjamin
Change-Id: Ic28156544d7c0b468022c0cf3b36c781a4ec8036 Reviewed-on: https://boringssl-review.googlesource.com/10860 Reviewed-by: Matt Braithwaite <mab@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-13Remove identical tests.David Benjamin
I'm not sure what happened here. These are both the same as MissingKeyShare-Client. Change-Id: I6601ed378d8639c1b59034f1e96c09a683bb62ca Reviewed-on: https://boringssl-review.googlesource.com/11007 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2016-09-13Use fewer macros in C ChaCha implementation.David Benjamin
I hear our character set includes such novel symbols as '+'. Change-Id: I96591a563317e71299748a948d68a849e15b5d60 Reviewed-on: https://boringssl-review.googlesource.com/11009 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2016-09-13Revert of Determining certificate_auth and key_exchange based on SSL.David Benjamin
Reason for revert: Right now in TLS 1.3, certificate_auth is exactly the same as whether we're doing resumption. With the weird reauth stuff punted to later in the spec, having extra state is just more room for bugs to creep in. Original issue's description: > Determining certificate_auth and key_exchange based on SSL. > > This allows us to switch TLS 1.3 to use non-cipher based negotiation > without needing to use separate functions between 1.3 and below. > > BUG=77 > > Change-Id: I9207e7a6793cb69e8300e2c15afe3548cbf82af2 > Reviewed-on: https://boringssl-review.googlesource.com/10803 > Reviewed-by: David Benjamin <davidben@google.com> > Commit-Queue: David Benjamin <davidben@google.com> > CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> > Change-Id: I240e3ee959ffd1f2481a06eabece3af554d20ffa Reviewed-on: https://boringssl-review.googlesource.com/11008 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-13Add tests for trailing data in handshake messages.David Benjamin
It's easy to forget to check those. Unfortunately, it's also easy to forget to check inner structures, which is going to be harder to stress, but do these to start with. In doing, so fix up and unify some error-handling, and add a missing check when parsing TLS 1.2 CertificateRequest. This was also inspired by the recent IETF posting. Change-Id: I27fe3cd3506258389a75d486036388400f0a33ba Reviewed-on: https://boringssl-review.googlesource.com/10963 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Factor per-message test machinery out.David Benjamin
This will let us use the same test scenarios for testing messages with trailing garbage or skipped messages. Change-Id: I9f177983e8dabb6c94d3d8443d224b79a58f40b1 Reviewed-on: https://boringssl-review.googlesource.com/10962 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Build debug symbols for assembly.David Benjamin
We build with them for C files, so include it for the assembly files too. Change-Id: I1c595e18314b245330a6f047d0a97a031d55b115 Reviewed-on: https://boringssl-review.googlesource.com/9150 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Use C99 for size_t loops.David Benjamin
This was done just by grepping for 'size_t i;' and 'size_t j;'. I left everything in crypto/x509 and friends alone. There's some instances in gcm.c that are non-trivial and pulled into a separate CL for ease of review. Change-Id: I6515804e3097f7e90855f1e7610868ee87117223 Reviewed-on: https://boringssl-review.googlesource.com/10801 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Replace CBC_MAC_ROTATE_IN_PLACE with an N lg N rotation.David Benjamin
Really the only thing we should be doing with these ciphers is hastening their demise, but it was the weekend and this seemed like fun. EVP_tls_cbc_copy_mac needs to rotate a buffer by a secret amount. (It extracts the MAC, but rotated.) We have two codepaths for this. If CBC_MAC_ROTATE_IN_PLACE is defined (always on), we make some assumptions abuot cache lines, play games with volatile, and hope that doesn't leak anything. Otherwise, we do O(N^2) work to constant-time select the rotation incidences. But we can do O(N lg N). Rotate by powers of two and constant-time select by the offset's bit positions. (Handwaivy lower-bound: an array position has N possible values, so, armed with only a constant-time select, we need O(lg N) work to resolve it. There's N array positions, so O(N lg N).) A microbenchmark of EVP_tls_cbc_copy_mac shows this is 27% faster than the old one, but still 32% slower than the in-place version. in-place: Did 15724000 CopyFromMAC operations in 20000744us (786170.8 ops/sec) N^2: Did 8443000 CopyFromMAC operations in 20001582us (422116.6 ops/sec) N lg N: Did 10718000 CopyFromMAC operations in 20000763us (535879.6 ops/sec) This results in the following the CBC ciphers. I measured AES-128-CBC-SHA1 and AES-256-CBC-SHA384 which are, respectively, the cipher where the other bits are the fastest and the cipher where N is largest. in-place: Did 2634000 AES-128-CBC-SHA1 (16 bytes) open operations in 10000739us (263380.5 ops/sec): 4.2 MB/s Did 1424000 AES-128-CBC-SHA1 (1350 bytes) open operations in 10002782us (142360.4 ops/sec): 192.2 MB/s Did 531000 AES-128-CBC-SHA1 (8192 bytes) open operations in 10002460us (53086.9 ops/sec): 434.9 MB/s N^2: Did 2529000 AES-128-CBC-SHA1 (16 bytes) open operations in 10001474us (252862.7 ops/sec): 4.0 MB/s Did 1392000 AES-128-CBC-SHA1 (1350 bytes) open operations in 10006659us (139107.4 ops/sec): 187.8 MB/s Did 528000 AES-128-CBC-SHA1 (8192 bytes) open operations in 10001276us (52793.3 ops/sec): 432.5 MB/s N lg N: Did 2531000 AES-128-CBC-SHA1 (16 bytes) open operations in 10003057us (253022.7 ops/sec): 4.0 MB/s Did 1390000 AES-128-CBC-SHA1 (1350 bytes) open operations in 10003287us (138954.3 ops/sec): 187.6 MB/s Did 531000 AES-128-CBC-SHA1 (8192 bytes) open operations in 10002448us (53087.0 ops/sec): 434.9 MB/s in-place: Did 1249000 AES-256-CBC-SHA384 (16 bytes) open operations in 10001767us (124877.9 ops/sec): 2.0 MB/s Did 879000 AES-256-CBC-SHA384 (1350 bytes) open operations in 10009244us (87818.8 ops/sec): 118.6 MB/s Did 344000 AES-256-CBC-SHA384 (8192 bytes) open operations in 10025897us (34311.1 ops/sec): 281.1 MB/s N^2: Did 1072000 AES-256-CBC-SHA384 (16 bytes) open operations in 10008090us (107113.3 ops/sec): 1.7 MB/s Did 780000 AES-256-CBC-SHA384 (1350 bytes) open operations in 10007787us (77939.3 ops/sec): 105.2 MB/s Did 333000 AES-256-CBC-SHA384 (8192 bytes) open operations in 10016332us (33245.7 ops/sec): 272.3 MB/s N lg N: Did 1168000 AES-256-CBC-SHA384 (16 bytes) open operations in 10007671us (116710.5 ops/sec): 1.9 MB/s Did 836000 AES-256-CBC-SHA384 (1350 bytes) open operations in 10001536us (83587.2 ops/sec): 112.8 MB/s Did 339000 AES-256-CBC-SHA384 (8192 bytes) open operations in 10018522us (33837.3 ops/sec): 277.2 MB/s TLS CBC performance isn't as important as it was before, and the costs aren't that high, so avoid making assumptions about cache lines. (If we care much about CBC open performance, we probably should get the malloc out of EVP_tls_cbc_digest_record at the end.) Change-Id: Ib8d8271be4b09e5635062cd3b039e1e96f0d9d3d Reviewed-on: https://boringssl-review.googlesource.com/11003 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Serialize unresumable sessions to a placeholder value.Steven Valdez
Change-Id: I676d7fb00d63d74946b96c22ae2705072033c5f7 Reviewed-on: https://boringssl-review.googlesource.com/10620 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Determining certificate_auth and key_exchange based on SSL.Steven Valdez
This allows us to switch TLS 1.3 to use non-cipher based negotiation without needing to use separate functions between 1.3 and below. BUG=77 Change-Id: I9207e7a6793cb69e8300e2c15afe3548cbf82af2 Reviewed-on: https://boringssl-review.googlesource.com/10803 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Remove trailing ';' from macrosAlessandro Ghedini
For consistency and to avoid a pedantic GCC warning (even though it's mostly old legacy code). Change-Id: Iea63eb0a82ff52914adc33b83e48450f4f6a49ef Reviewed-on: https://boringssl-review.googlesource.com/11021 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Only allow SSL_set_session before the handshake.David Benjamin
Otherwise things break horribly. Explicitly abort to help catch bugs. Change-Id: I66e2bf8808199b3331b3adde68d73758a601eb8c Reviewed-on: https://boringssl-review.googlesource.com/10761 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12Remove unused crypto/perlasm/cbc.pl.David Benjamin
In OpenSSL, they're used in the 32-bit x86 Blowfish, CAST, DES, and RC5 assembly bits. We don't have any of those. Change-Id: I36f22ca873842a200323cd3f398d2446f7bbabca Reviewed-on: https://boringssl-review.googlesource.com/10780 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
2016-09-12Use a common state to begin the handshake.David Benjamin
This simplifies the logic around SSL_clear to reset the state for a new handshake. The state around here is still a little iffy, but this is a slight improvement. The SSL_ST_CONNECT and SSL_ST_ACCEPT states are still kept separate to avoid problems with the info callback reporting SSL_ST_INIT. Glancing through info callback consumers, although they're all debugging, they tend to assume that all intermediate states either have only SSL_ST_CONNECT set or only SSL_ST_ACCEPT set. (They also all look identical which makes me think it's copy-and-pasted from OpenSSL command-line tool or something.) Change-Id: I55503781e52b51b4ca829256c14de6f5942dae51 Reviewed-on: https://boringssl-review.googlesource.com/10760 Reviewed-by: Adam Langley <agl@google.com>
2016-09-12Temporary remove the TLS 1.3 anti-downgrade mechanism.David Benjamin
This mechanism is incompatible with deploying draft versions of TLS 1.3. Suppose a draft M client talks to a draft N server, M != N. (Either M or N could also be the final standard revision should there be lingering draft clients or servers.) The server will notice the mismatch and pretend ClientHello.version is TLS 1.2, not TLS 1.3. But this will trigger anti-downgrade signal and cause an interop failure! And if it doesn't trigger, all the clever tricks around ServerHello.random being signed in TLS 1.2 are moot. We'll put this back when the dust has settled. Change-Id: Ic3cf72b7c31ba91e5cca0cfd7a3fca830c493a43 Reviewed-on: https://boringssl-review.googlesource.com/11005 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-12We no longer allow out < in in-place operationsDavid Benjamin
The (rather long...) preamble to aead.h still said we allowed this. Change-Id: I4ba02ef196c6d5439408000cf3c296111b55ff36 Reviewed-on: https://boringssl-review.googlesource.com/11004 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2016-09-10Fix IWYU violation in speed.cc.David Benjamin
We need time.h for clock_gettime on Linux. Previously, scoped_types.h was pulling in everything and getting it for us, but now it doesn't exist. We seem to have been pulling it in on accident anyway but it seems Android's system headers end up not doing so. Change-Id: I0a04495b1462649d77d62018e317c416803ac58d Reviewed-on: https://boringssl-review.googlesource.com/11000 Reviewed-by: Matt Braithwaite <mab@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-10Print out the signature algorithm in bssl client.David Benjamin
I keep wishing we had that available and patching this in. Change-Id: I4ef04fcc6be5b00a9fcbdc2771a7ee7e2313b5c5 Reviewed-on: https://boringssl-review.googlesource.com/10980 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-09crypto/bn/*: x86[_64] division instruction doesn't handle constants, change ↵Steven Valdez
constraint from 'g' to 'rm'. (Imported from upstream's 2a20b6d9731488bcb500e58a434375f59fb9adcc) Change-Id: If3db4dac3d4cd675cf7854c4e154823d25d00eb9 Reviewed-on: https://boringssl-review.googlesource.com/10921 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-09Make forward-declaring bssl::UniquePtr<T> actually work.David Benjamin
The compiler complains about: error: explicit specialization of 'bssl::internal::Deleter<evp_pkey_st>' after instantiation This is because, although the deleter's operator() is not instantiated without emitting std::unique_ptr's destructor, the deleter itself *is*. Deleters are allowed to have non-zero size, so a std::unique_ptr actually embeds a copy of the deleter, so it needs the size of the deleter. As with all problems in computer science, we fix this with a layer of indirection. Instead of specializing the deleter, we specialize bssl::internal::DeleterImpl which, when specialized, has a static method Free. That is only instantiated inside bssl::internal::Deleter::operator(), giving us the desired properties. (Did I mention forward decls are terrible? I wish people wouldn't want them so much.) Also appease clang-format. Change-Id: I9a07b2fd13e8bdfbd204e225ac72c52d20a397dc Reviewed-on: https://boringssl-review.googlesource.com/10964 Reviewed-by: Matt Braithwaite <mab@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-09Fix a few leaks in X509_REQ_to_X509.Steven Valdez
(Imported from upstream's a404656a8b40d9f1172e5e330f7e2d9d87cabab8) Change-Id: I4ddebfbaeab433bae7c1393a8258d786801bb633 Reviewed-on: https://boringssl-review.googlesource.com/10920 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-09Add tests around compression methods.David Benjamin
Not that this matters in the slightest, but the recent IETF mailing reminded me we don't test this. Change-Id: I300c96d6a63733d538a7019a7cb74d4e65d0498f Reviewed-on: https://boringssl-review.googlesource.com/10961 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-09Test that SNI warning alerts are ignored.David Benjamin
Although RFC 6066 recommends against it, some servers send a warning alert prior to ServerHello on SNI mismatch, and, per spec, TLS 1.2 allows it. We're fine here, but add a test for it. It interacts interestingly with TLS 1.3 forbidding warning alerts because it happens before version negotiation. Change-Id: I0032313c986c835b6ae1aa43da6ee0dad17a97c2 Reviewed-on: https://boringssl-review.googlesource.com/10800 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-08Blacklist STLPort from C++ scopers.David Benjamin
It lacks std::unique_ptr, despite some consumers using it with C++11 in the compiler enabled. Change-Id: Icc79ac4f2385440b36aa6b01b1477abcfa8a9388 Reviewed-on: https://boringssl-review.googlesource.com/10841 Reviewed-by: Matt Braithwaite <mab@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-08Fold stack-allocated types into headers.David Benjamin
Now that we have the extern "C++" trick, we can just embed them in the normal headers. Move the EVP_CIPHER_CTX deleter to cipher.h and, in doing so, take away a little bit of boilerplate in defining deleters. Change-Id: I4a4b8d0db5274a3607914d94e76a38996bd611ec Reviewed-on: https://boringssl-review.googlesource.com/10804 Reviewed-by: Matt Braithwaite <mab@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-07Fix bssl client -session-out.David Benjamin
It was switched to using the callbacks, but the callbacks require SSL_SESS_CACHE_CLIENT be set. (We should possibly just stop conditioning the callback on that bit since it doesn't do anything.) Change-Id: I96277b8a75975a86393260a6291eafc9cb2c6a78 Reviewed-on: https://boringssl-review.googlesource.com/10805 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-07Fix a typo in ssl.h.Martin Kreichgauer
Change-Id: I431c6e5b8f7de4663ba3db52f6fe0062caaf88ba Reviewed-on: https://boringssl-review.googlesource.com/10820 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-06const-correct a variable.David Benjamin
Change-Id: I00507014c55b2c7fd442a5aa2c3afcbf8c48049b Reviewed-on: https://boringssl-review.googlesource.com/10741 CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
2016-09-02Replace Scoped* heap types with bssl::UniquePtr.Matt Braithwaite
Unlike the Scoped* types, bssl::UniquePtr is available to C++ users, and offered for a large variety of types. The 'extern "C++"' trick is used to make the C++ bits digestible to C callers that wrap header files in 'extern "C"'. Change-Id: Ifbca4c2997d6628e33028c7d7620c72aff0f862e Reviewed-on: https://boringssl-review.googlesource.com/10521 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-09-01Update pinned revisions in util/bot.David Benjamin
Change-Id: Ieee80e5949e7f5cda77a643bae8fb1c521eb3587 Reviewed-on: https://boringssl-review.googlesource.com/10762 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-08-31Enable RSA-PSS in TLS 1.2 by default.David Benjamin
Add a test that RSA-PSS is available in TLS 1.2 by default, both for signing and verifying. Note that if a custom SSL_PRIVATE_KEY_METHOD is used and it sets signing preferences, it won't use RSA-PSS if it doesn't know about it. (See *-Sign-Negotiate-* tests.) Change-Id: I3776a0c95480188a135795f7ebf31f2b0e0626cc Reviewed-on: https://boringssl-review.googlesource.com/10723 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-08-30Import NIST ECDSA verification tests.David Benjamin
Change-Id: Idaec86866c600b87cda662b1b31c864cb1d141ac Reviewed-on: https://boringssl-review.googlesource.com/10702 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2016-08-30Test that the early callback can affect max_version.David Benjamin
The early callback needs to run before even version negotiation has been resolved. Change-Id: Ibb449ccec07dedef19b7827400ef318fa2f422c0 Reviewed-on: https://boringssl-review.googlesource.com/10722 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>