1097 Commits

Author SHA1 Message Date
Brian Smith
291a26ac4a Take BoringSSL efb42fb: Make BN_mod_exp_mont_consttime take a const context. 2015-11-07 17:03:22 -10:00
Brian Smith
4f04b96424 Merge BoringSSL d9e8173: Fix several warnings that arise in Android. 2015-11-07 16:49:45 -10:00
Brian Smith
8ecfd1a5c6 Merge BoringSSL '278d342': Get rid of all compiler version checks in perlasm files.
The changes to crypto/sha/asm/sha512-x86_64.pl were moved to
crypto/sha/asm/sha-x86_64.pl.
2015-11-07 16:36:06 -10:00
Adam Langley
efb42fbb60 Make BN_mod_exp_mont_consttime take a const context.
BN_mod_exp_mont_consttime does not modify its |BN_MONT_CTX| so that
value should be const.

Change-Id: Ie74e48eec8061899fd056fbd99dcca2a86b02cad
Reviewed-on: https://boringssl-review.googlesource.com/6403
Reviewed-by: Adam Langley <agl@google.com>
2015-11-03 01:58:12 +00:00
Brian Smith
be8a11ceaf Remove include/openssl/aead.h. 2015-10-31 23:01:44 -10:00
Brian Smith
17f6149c64 Remove SHA-224. 2015-10-31 22:30:01 -10:00
Brian Smith
b1dd1f596d Remove include/openssl/digest.h. 2015-10-31 22:28:48 -10:00
Brian Smith
2ca12aabde Remove crypto/digest except for crypto/digest/md32_common.h. 2015-10-31 16:27:58 -10:00
Brian Smith
4f3535ed43 Remove OAEP and PSS support from crypto/rsa.
This removes the last non-test dependency on |EVP_Digest*|.
2015-10-31 16:10:11 -10:00
Brian Smith
6eef3756f6 Remove |EVP_DigestInit| and |EVP_DigestFinal| (dead code). 2015-10-31 10:09:30 -10:00
Brian Smith
c8a7001677 Remove |EVP_MD_CTX_create| and |EVP_MD_CTX_destroy| (dead code). 2015-10-31 10:03:40 -10:00
Adam Langley
d9e817309a Fix several warnings that arise in Android.
Android is now using Ninja so it doesn't spew so much to the terminal
and thus any warnings in BoringSSL (which builds really early in the
process) and much more obvious.

Thus this change fixes a few warnings that appear in the Android build.

Change-Id: Id255ace90fece772a1c3a718c877559ce920b960
Reviewed-on: https://boringssl-review.googlesource.com/6400
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
2015-10-30 21:11:48 +00:00
David Benjamin
51a01a5cd4 Revert most of "Refactor ChaCha20-Poly1305 AEAD nonce handling."
This reverts most of commit 271777f5ac6c7f7d1aaf95b91c5a5bef86da6363. The old
ChaCha20-Poly1305, though being transitioned to the old name, should not change
in behavior. This also avoids adding a special-case to SSL_AEAD_CTX.

Also revert the name change to SSL_CIPHER_is_CHACHA20POLY1305. The one consumer
for that function doesn't need to distinguish the old and new variants, so
avoid unnecessary turbulence.

Change-Id: I5a6f97fccc5839d4d25e74e304dc002329d21b4b
Reviewed-on: https://boringssl-review.googlesource.com/6385
Reviewed-by: Adam Langley <agl@google.com>
2015-10-29 18:40:33 +00:00
Brian Smith
19a17881a9 Merge BoringSSL f0523e9: Avoid hard-coded linkage of WNAF-based multiplication.
This is *ring*'s 2d853c4e4521de2db474446e4f547e6cf25f4ca2. Adam Langley
addressed the "TODO" that was left in that commit.
2015-10-28 16:24:08 -10:00
Brian Smith
dc9607b4f7 Remove crypto/cipher/aead_test.cc and aead_test.Windows vcxproj.
These should have been removed in
8e089dddc183b363012b005135c44bcedf786b04. They were already removed
from the build in that commit; i.e. this is dead code.
2015-10-28 16:02:40 -10:00
Brian Smith
5f574a3fd6 Merge BoringSSL e80a2ec, 3e23e4c, 271777f.
These changes are BoringSSL's tweaked versions of
f0015bc1d5ad64bbdb25ac6b39248542468fa4fd
f7f104da72ee7002edaab83d5ee5a5feac04b06f
9923038056ad0b13d211339045789e3205281748
9937d39743e8f8c19728306519b47522fc028137.

|ring::aead::CHACHA20_POLY1305_DEPRECATED| was renamed to
|ring::aead::CHACHA20_POLY1305_OLD| to match the BoringSSL name.
2015-10-28 15:55:32 -10:00
Brian Smith
26052ee6d0 Remove crypto/cipher/test/chacha20_poly1305_tests.txt.
This was supposed to be renamed to
crypto/cipher/test/chacha20_poly1305_rfc7539_tests.txt, but apparently
that file was added as a separate file instead.
2015-10-28 15:43:28 -10:00
Brian Smith
96b9f3b68c Switch rsa_test.cc to use the new RSA encrypt/decrypt API.
Change-Id: I799e289a402612446e08f64f59e0243f164cf695
Reviewed-on: https://boringssl-review.googlesource.com/6372
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
2015-10-28 23:36:44 +00:00
David Benjamin
278d34234f Get rid of all compiler version checks in perlasm files.
Since we pre-generate our perlasm, having the output of these files be
sensitive to the environment the run in is unhelpful. It would be bad to
suddenly change what features we do or don't compile in whenever workstations'
toolchains change or if developers do or don't have CC variables set.

Previously, all compiler-version-gated features were turned on in
https://boringssl-review.googlesource.com/6260, but this broke the build. I
also wasn't thorough enough in gathering performance numbers. So, flip them all
to off instead. I'll enable them one-by-one as they're tested.

This should result in no change to generated assembly.

Change-Id: Ib4259b3f97adc4939cb0557c5580e8def120d5bc
Reviewed-on: https://boringssl-review.googlesource.com/6383
Reviewed-by: Adam Langley <agl@google.com>
2015-10-28 19:33:04 +00:00
Brian Smith
71487c6a09 Take BoringSSL 6dc1851: Fix aarch64 (64-bit ARM) guard on chacha_vec_arm.S. 2015-10-27 20:51:11 -10:00
Brian Smith
a7f1480027 Merge BoringSSL 953cfc8: Document how to regenerate crypto/chacha/chacha_vec_arm.S. 2015-10-27 20:50:24 -10:00
Brian Smith
fe1e2fca80 Merge BoringSSL 0f9f0ea: Fix the shared builders by exporting GCM symbols.
Note that the main effect of this change is to make modes.h private.
2015-10-27 20:43:31 -10:00
Brian Smith
d982ba8559 Merge BoringSSL 75885e2: Revert "Get rid of all compiler version checks in perlasm files." 2015-10-27 20:40:51 -10:00
Brian Smith
2ace2131ff Merge BoringSSL 0f8bfde: Make |gcm128_context| memcpy-safe.
This merge is complicated by the fact that *ring* had already had made
this change, but BoringSSL used a slightly modified version. In
particular, the |_sk| suffixes were removed and the |OPENSSL_EXPORT|
was removed from each function in the BoringSSL version. In this merge,
the removal of the |_sk| suffixes was done. However, the removal of
|OPENSSL_EXPORT| would have broke the build, so it was not done.
2015-10-27 20:36:47 -10:00
Brian Smith
ea6132c7d8 Merge BoringSSL eca509c: Clarify confusing conditionals in crypto/gcm/gcm.c.
This is BoringSSL's modified version of *ring*'s
7f865ff3072b2a89e30fdd9f795fcceaefd34595.
2015-10-27 20:05:35 -10:00
Brian Smith
d8bfb9fc08 Merge BoringSSL e564a5b: |assert| → |OPENSSL_STATIC_ASSERT| where possible.
crypto/modes/cfb.c, crypto/modes/ofb.c, and ssl/t1_lib.c have already
been removed in *ring*.
2015-10-27 19:58:54 -10:00
Brian Smith
38a4fda0f1 Merge BoringSSL b9c2601: Get rid of all compiler version checks in perlasm files.
Note that crypto/bn/asm/rsaz-x86_64.pl had already been deleted in *ring*.
2015-10-27 19:54:21 -10:00
Brian Smith
6ffa3f144e Merge BoringSSL e189c86: Consistently disable the Intel SHA Extensions code.
See also the previous commit.
2015-10-27 19:53:03 -10:00
Brian Smith
b209a68790 Merge BoringSSL 178a88c. Synchronize sha512-x86_64.pl with upstream.
Note that this change seems more significant than the BoringSSL commit
message hints at, at least for OpenSSL. See also the following commit.
2015-10-27 19:48:16 -10:00
Brian Smith
af68f3653f Merge BoringSSL ccf2517: Only emit RSA_R_BAD_VERSION on bad RSAPrivateKey versions. 2015-10-27 17:26:25 -10:00
Brian Smith
2c30f81d46 Take BoringSSL 12f7737: Remove BN_MONT_CTX_init. 2015-10-27 16:59:11 -10:00
Brian Smith
cab42955f3 Take BoringSSL 1b92f64: Fix comment style in crypto/rand/rand.c. 2015-10-27 16:37:58 -10:00
Brian Smith
e136a90a2f Take BoringSSL 9f6b526: Fix typo. 2015-10-27 16:36:30 -10:00
Brian Smith
6466d19400 Take BoringSSL 036152e: Fix incorrect error-handling in BN_div_recp. 2015-10-27 16:35:57 -10:00
Brian Smith
a89ad67d8f Merge BoringSSL 6a7cfbe: Allow ARM capabilities to be set at compile time.
The changes to BUILDING.md were not merged.
2015-10-27 16:32:52 -10:00
Adam Langley
de659cdc2e Fix PKCS#8 on 32-bit systems.
The previous commit fixed a signed/unsigned warning but, on 32-bit
systems, long is only 32 bits, so the fix was incorrect there.

Change-Id: I6afe340164de0e176c7f710fcdd095b2a4cddee4
2015-10-27 16:18:51 -07:00
Adam Langley
13f1dd497f Fix a couple more signed/unsigned compares.
Different compilers find different problems.

Change-Id: I732611005ae1cbfcb4bc70c3f98af2c18b0a04da
2015-10-27 16:07:26 -07:00
Adam Langley
96c2a28171 Fix all sign/unsigned warnings with Clang and GCC.
Change-Id: If2a83698236f7b0dcd46701ccd257a85463d6ce5
Reviewed-on: https://boringssl-review.googlesource.com/4992
Reviewed-by: Adam Langley <agl@google.com>
2015-10-27 22:48:00 +00:00
Brian Smith
0dc2a8aee2 Clean up |ECDH_compute_key|.
1. Check for the presence of the private key before allocating or
   computing anything.
2. Check the return value of |BN_CTX_get|.
3. Don't bother computing the Y coordinate since it is not used.
4. Remove conditional logic in cleanup section.

Change-Id: I4d8611603363c7e5d16a8e9f1d6c3a56809f27ae
Reviewed-on: https://boringssl-review.googlesource.com/6171
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 17:00:25 +00:00
Brian Smith
274341dd6e Change the type of |EC_GROUP_get_degree| and friends to |unsigned|.
These functions ultimately return the result of |BN_num_bits|, and that
function's return type is |unsigned|. Thus, these functions' return
type should also be |unsigned|.

Change-Id: I2cef63e6f75425857bac71f7c5517ef22ab2296b
Reviewed-on: https://boringssl-review.googlesource.com/6170
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 16:48:04 +00:00
Adam Langley
05ee4fda1c Add no-op functions |CRYPTO_malloc_init| and |ENGINE_load_builtin_engines|.
This reduces the impact on Netty. See
904b84ce41 (commitcomment-12159877)

Change-Id: I22f9e1edaeb9e721326867ae2b4f3da2c5441437
Reviewed-on: https://boringssl-review.googlesource.com/5535
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 16:41:40 +00:00
Adam Langley
2e3c978d14 Add OPENSSL_SMALL.
Intel's P-256 code has very large tables and things like Chromium just
don't need that extra size. However, servers generally do so this change
adds an OPENSSL_SMALL define that currently just drops the 64-bit P-224
but will gate Intel's P-256 in the future too.

Change-Id: I2e55c6e06327fafabef9b96d875069d95c0eea81
Reviewed-on: https://boringssl-review.googlesource.com/6362
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 16:40:20 +00:00
Adam Langley
5dbdad9c33 For now, give the unsuffixed ChaCha20 AEAD name to the old version.
QUIC has a complex relationship with BoringSSL owing to it living both
in Chromium and the Google-internal repository. In order for it to
handle the ChaCha20-Poly1305 AEAD switch more easily this change gives
the unsuffixed name to the old AEAD, for now.

Once QUIC has moved to the “_old” version the unsuffixed name can be
given to the new version.

Change-Id: Id8a77be6e3fe2358d78e022413fe088e5a274dca
Reviewed-on: https://boringssl-review.googlesource.com/6361
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 16:39:12 +00:00
Brian Smith
f0523e9f20 Avoid hard-coded linkage of WNAF-based multiplication.
If the application is only using the P-256 implementation in p256-64.c,
then the WNAF code would all be dead code. The change reorganizes the
code so that all modern toolchains should be able to recognize that
fact and eliminate the WNAF-based code when it is unused.

Change-Id: I9f94bd934ca7d2292de4c29bb89e17c940c7cd2a
Reviewed-on: https://boringssl-review.googlesource.com/6173
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 16:38:25 +00:00
Brian Smith
80c5fabc63 Simplify |EC_METHOD| by removing invariant methods.
None of these methods vary per group. Factoring these out of
|EC_METHOD| should help some toolchains to do a better job optimizing
the code for size.

Change-Id: Ibd22a52992b4d549f12a8d22bddfdb3051aaa891
Reviewed-on: https://boringssl-review.googlesource.com/6172
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 15:55:47 +00:00
Brian Smith
58600f15b4 Remove deprecated, duplicative, RSA API functions.
See also 978f16e.
2015-10-26 21:21:26 -10:00
Brian Smith
f44cd25afc Merge BoringSSL 978f16e: size_t RSA functions. 2015-10-26 20:55:35 -10:00
Brian Smith
28f1ea5ae3 Make more tests silent when they succeed. 2015-10-26 18:32:31 -10:00
Brian Smith
8ad3c35cc1 Make ecdsa_test silent on test success. 2015-10-26 18:32:30 -10:00
Brian Smith
f15e075b73 Add more tests for the RFC 7539 ChaCha20-Poly1305 AEAD.
The tests in crypto/cipher/test/chacha20_poly1305_deprecated_tests.txt
were adapted to the RFC 7539 AEAD construction by recalculating the tags.
Also a few additional vectors were added. These vectors were verified
against nettle. See
feb7292bf1.

Change-Id: Ib3f2797d5825bc1e32c55f845b5070b6993e4aff
Reviewed-on: https://boringssl-review.googlesource.com/6144
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27 01:34:33 +00:00