2143 Commits

Author SHA1 Message Date
Brian Smith
5c473e72cb Tell GitHub that PerlAsm files are assembly language files. 2015-10-10 21:05:26 -10:00
Brian Smith
180f71de10 Remove crypto/dh. 2015-10-10 16:30:19 -10:00
Brian Smith
423288a88c Remove deprecated |d2i_ECDSA_SIG| and |i2d_ECDSA_SIG|. 2015-10-09 13:38:35 -10:00
Brian Smith
32db993d68 Replace |ECDH_compute_key| with |ECDH_compute_key_ex|.
|ECDH_compute_key_ex| provides a safer interface with a better
implementation. In particular, the error checking in
|ECDH_compute_key_ex| seems better.
2015-10-09 13:38:35 -10:00
Brian Smith
208aad0c7a Remove openssl/evp.h.
crypto/evp was removed a while back, but this header was accidentally
retained.
2015-10-09 13:38:34 -10:00
Brian Smith
88a29de6da Remove the last |EC_KEY| mutator, |EC_KEY_set_public_key|.
After recent changes, |EC_KEY_set_public_key| is now dead code.
|EC_KEY| is immutable, though note that |EC_KEY| instances reference
|EC_GROUP| instances that aren't immutable. Now operations that take
|EC_KEY*| parameters use the private key, whereas operations that use
only public keys do not take |EC_KEY*| or |const EC_KEY*| parameters.
2015-10-09 13:38:34 -10:00
Brian Smith
6a4796be92 Replace |ECDSA_verify| and |ECDSA_do_verify|.
This gives some test coverage to |ECDSA_verify_signed_digest| and
|ECDSA_do_verify_point|. The new functions do not require the caller to
construct an |EC_KEY| and now there are no callers of
|EC_KEY_set_public_key|.

Importantly, this also removes |ECDSA_verify_signed_digest|'s indirect
dependency on the |CBB_*| code, which reduces code size for
applications that don't have other dependencies on |CBB_*|.
2015-10-09 13:38:33 -10:00
Brian Smith
5857f7684a Replace |EC_KEY_generate_key| with |EC_KEY_generate_key_ex|.
The |EC_KEY_generate_key_ex| API is less error-prone and the
implementation becomes simpler if we don't have to worry about also
implementing |EC_KEY_generate_key|.
2015-10-09 13:38:32 -10:00
Brian Smith
92e8bb51f7 Remove |EC_KEY_precompute_mult|.
This function only does per-group precomputation, not key-specific
precomputation, so using it is no better than using
|EC_GROUP_precompute_mult|. Worse, an unsuspecting caller may not
realize that this is modifying a possibly-shared |EC_GROUP|, so it
seems dangerous.
2015-10-09 13:38:32 -10:00
Brian Smith
f3dc192d5f Remove some exported EC_POINT functions. 2015-10-09 13:38:31 -10:00
Brian Smith
bf482572d3 Remove |EC_POINT_set_affine_coordinates_GFp|. 2015-10-09 13:38:31 -10:00
Brian Smith
995c288a4e Remove unused public |EC_KEY| functions.
|EC_KEY_new_method| was removed in a previous commit, but that commit
accidentally left the declaration in ec_key.h.
2015-10-09 13:38:30 -10:00
Brian Smith
9b5b758f02 Remove |EC_POINT_add|, |EC_POINT_dbl|, and |EC_POINT_invert|. 2015-10-09 13:38:30 -10:00
Brian Smith
2dbc92ff41 Remove dead code for curves where |a| != -3.
All of the curves that *ring* supports have a == -3.
2015-10-09 13:38:29 -10:00
Brian Smith
6364691986 Remove unused "simple" EC method implementations. 2015-10-09 13:38:29 -10:00
Brian Smith
2d853c4e45 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.
2015-10-09 13:38:28 -10:00
Brian Smith
3ed0b17d16 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.
2015-10-09 13:38:28 -10:00
Brian Smith
dff8a15447 Remove the |group_copy| method of |EC_METHOD| (dead code).
With |EC_GROUP_copy| gone, this is all dead code.
2015-10-09 13:38:27 -10:00
Brian Smith
18093e10b9 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. |OPENSSL_cleanse| the temporary buffer.
5. Remove conditional logic in cleanup section.
2015-10-09 13:36:59 -10:00
Brian Smith
a347436e9e 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|.
2015-10-09 13:26:14 -10:00
Brian Smith
c424bc9dc0 Build the tool on Windows. 2015-10-09 13:25:49 -10:00
Brian Smith
0d70ddfc9c Fix the tool to account for API changes.
The build system has not been building the tool, so of course it
bitrotted.
2015-10-09 13:25:14 -10:00
Brian Smith
28e98f3270 Export new ECC API so that tests and |bssl speed| can use them. 2015-10-08 21:03:19 -10:00
Brian Smith
4ef4095398 Remove old ECC {EC_GROUP,EC_KEY}_{new,copy,dup} API.
The new API is better for performance and also more clearly safe.
2015-10-07 11:38:01 -10:00
Brian Smith
75ccaf227a Remove |EC_POINT_make_affine| (dead code).
All the callers use |EC_POINTs_make_affine|.
2015-10-07 11:38:00 -10:00
Brian Smith
3e63ce6f9d Remove |EC_GROUP_get_curve_GFp| (dead code). 2015-10-07 11:38:00 -10:00
Brian Smith
89b8805088 Remove |group_check_discriminant| from |EC_METHOD| (dead code). 2015-10-07 11:37:59 -10:00
Brian Smith
7714e639c9 Remove EC_GROUP_get_cofactor (dead code).
All the curves supported by the openssl/ec.h API in *ring* have
cofactor 1. It isn't clear how well the code even works when the
cofactor isn't 1.
2015-10-07 11:37:52 -10:00
Brian Smith
3909ad4864 Remove deprecated API from openssl/ec.h. 2015-10-07 11:08:46 -10:00
Brian Smith
510606db3f Remove crypto/buf, in particular |BUF_memdup|. 2015-10-07 11:08:45 -10:00
Brian Smith
99de785f9b Remove |DHparams_dup|.
Besides the function being unnecessary for *ring*, this also allows us
to remove |BUF_memdup|.
2015-10-07 10:51:03 -10:00
Brian Smith
8489707da7 Take BoringSSL 82aa28f: Make |BUF_memdup| look for zero length, not NULL. 2015-10-07 09:32:28 -10:00
Brian Smith
4395fad0b9 Ignore BoringSSL c608d6b.
This is a change to code that has already been removed in *ring*.
2015-10-07 09:31:49 -10:00
Adam Langley
82aa28fa81 Make |BUF_memdup| look for zero length, not NULL.
BUF_memdup tries to avoid mallocing zero bytes (and thus unduly
returning an error for a NULL return value) by testing whether the input
buffer is NULL. This goes back to the original OpenSSL code.

However, when |ext_npn_parse_serverhello| tries to use |BUF_memdup| to
copy an NPN value returned by a callback, some callbacks just set the
output /length/ to zero to indicate an empty value. Thus, when
|BUF_memdup| tests the pointer, it's an uninitialised value and MSan
throws an error.

Since passing a NULL pointer to |BUF_memdup| better imply that the
length is zero, while the reverse empirically isn't true, testing the
length seems safer.

Change-Id: I06626f7dfb761de631fd997bda60057b76b8da94
2015-10-06 18:11:33 -07:00
Chuck Hays
c608d6b02b Updating Bazel outputs to work on other platforms.
Bazel on Mac requires some alterations to the generated build files.
This change updates generate_build_files.py to emit suitable Bazel
files. This will require some tweaks to projects that build with Bazel.

Change-Id: I3d68ec754b8abaa41a348f86c32434477f2c5e1c
Reviewed-on: https://boringssl-review.googlesource.com/6146
Reviewed-by: Adam Langley <agl@google.com>
2015-10-07 00:57:20 +00:00
Brian Smith
bdc325d470 Add VS2015 + Rust 1.3 configuration to Appveyor CI.
This was an unintended omission.
2015-10-06 13:32:15 -10:00
Brian Smith
2ddc282b60 Ignore BoringSSL 2060568..1aec2cb.
These are all changes to code that has already been removed in *ring*.
2015-10-05 14:19:28 -10:00
Brian Smith
b35d77b85b Merge BoringSSL d4ebc99: Remove always-zero |bulk| variables in crypto/cipher/e_aes.c.
This is the BoringSSL version of *ring* 6491d50.
2015-10-05 14:18:39 -10:00
Brian Smith
fc42b9da1c Merge BoringSSL bc41cdf: Add tests from cipher_test.txt to the AEAD test suite.
This is the BoringSSL version of *ring* 6491d50.
2015-10-05 14:16:09 -10:00
Brian Smith
f9f3fd1ece Make |gcm128_context| memcpy-safe.
This removes the confusion about whether |gcm128_context| copies the
key (it didn't) or whether the caller is responsible for keeping the
key alive for the lifetime of the |gcm128_context| (it was).
2015-10-05 12:01:05 -10:00
Brian Smith
06b550adc4 Fix constness of |gcm128_context.key|.
The key is never modified through the key pointer member, and the
calling code relies on that fact for maintaining its own
const-correctness.

Change-Id: I63946451aa7c400cd127895a61c30d9a647b1b8c
2015-10-05 12:01:04 -10:00
Brian Smith
fa2324001a Remove support for GCM nonces that aren't exactly 96 bits.
The test cases for other sizes of nonces were removed from gcm_test.c.
Since the new API doesn't provide any way of providing a non-96-bit
nonce, there's no way of testing those cases at this level. Similar
scenerios are tested in the AES-GCM tests.
2015-10-05 12:01:04 -10:00
Brian Smith
d0cd214be3 Remove always-zero |bulk| variable in AES-GCM AEAD. 2015-10-05 12:01:04 -10:00
Brian Smith
e91d7c3c73 Remove non-AEAD crypto/cipher interface. 2015-10-05 12:01:03 -10:00
Brian Smith
9e6f673f59 Remove crypto/cmac. 2015-10-05 10:38:26 -10:00
Brian Smith
1ab1eca2ee Remove non-AEAD interface for AES-GCM. 2015-10-05 10:38:25 -10:00
Brian Smith
6491d50f38 Add AES-GCM tests from cipher_test.txt to the AEAD test suite. 2015-10-05 10:29:34 -10:00
Brian Smith
18adc8d177 Fix comment typo in poly1305_test.txt. 2015-10-05 10:25:52 -10:00
Eric Roman
1aec2cbad2 Reject iterationCount == 0 when parsing PBKDF2-params.
Previously a value of 0 would be accepted and intepreted as equivalent
to 1. This contradicts RFC 2898 which defines:

     iterationCount INTEGER (1..MAX),

BUG=https://crbug.com/534961

Change-Id: I89623980f99fde3ca3780880d311955d3f6fe0b5
Reviewed-on: https://boringssl-review.googlesource.com/5971
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
2015-10-02 16:19:04 +00:00
David Benjamin
20c0e90d11 Allow NULL inputs in SSL_SESSION_get_time.
Some code relies on OpenSSL's behavior where it allowed for NULL. But this time
add a comment so people don't think this is the convention for new functions.

BUG=538292

Change-Id: I66566e0e24566fafe17e05369276248be3b05591
Reviewed-on: https://boringssl-review.googlesource.com/6070
Reviewed-by: Adam Langley <agl@google.com>
2015-10-01 20:16:49 +00:00