boringssl/ssl
David Benjamin 4298d77379 Implement draft-ietf-tls-curve25519-01 in C.
The new curve is not enabled by default.

As EC_GROUP/EC_POINT is a bit too complex for X25519, this introduces an
SSL_ECDH_METHOD abstraction which wraps just the raw ECDH operation. It
also tidies up some of the curve code which kept converting back and
force between NIDs and curve IDs. Now everything transits as curve IDs
except for API entry points (SSL_set1_curves) which take NIDs. Those
convert immediately and act on curve IDs from then on.

Note that, like the Go implementation, this slightly tweaks the order of
operations. The client sees the server public key before sending its
own. To keep the abstraction simple, SSL_ECDH_METHOD expects to
generate a keypair before consuming the peer's public key. Instead, the
client handshake stashes the serialized peer public value and defers
parsing it until it comes time to send ClientKeyExchange. (This is
analogous to what it was doing before where it stashed the parsed peer
public value instead.)

It still uses TLS 1.2 terminology everywhere, but this abstraction should also
be compatible with TLS 1.3 which unifies (EC)DH-style key exchanges.
(Accordingly, this abstraction intentionally does not handle parsing the
ClientKeyExchange/ServerKeyExchange framing or attempt to handle asynchronous
plain RSA or the authentication bits.)

BUG=571231

Change-Id: Iba09dddee5bcdfeb2b70185308e8ab0632717932
Reviewed-on: https://boringssl-review.googlesource.com/6780
Reviewed-by: Adam Langley <agl@google.com>
2015-12-22 21:51:30 +00:00
..
pqueue Add a run_tests target to run all tests. 2015-10-26 20:33:44 +00:00
test Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
CMakeLists.txt Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
custom_extensions.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
d1_both.c Rewrite DTLS handshake message sending logic. 2015-11-06 21:43:32 +00:00
d1_clnt.c Pull ChangeCipherSpec into the handshake state machine. 2015-12-16 18:36:57 +00:00
d1_lib.c Separate CCS and handshake writing in DTLS. 2015-11-04 00:11:14 +00:00
d1_meth.c Pull ChangeCipherSpec into the handshake state machine. 2015-12-16 18:36:57 +00:00
d1_pkt.c Slightly simplify SSL3_RECORD. 2015-12-16 18:41:59 +00:00
d1_srtp.c Add defines for SRTP profiles using GCM ciphers from RFC 7714. 2015-12-10 23:18:16 +00:00
d1_srvr.c Pull ChangeCipherSpec into the handshake state machine. 2015-12-16 18:36:57 +00:00
dtls_record.c Reject empty records of unexpected type. 2015-08-28 22:03:00 +00:00
internal.h Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
s3_both.c Pull ChangeCipherSpec into the handshake state machine. 2015-12-16 18:36:57 +00:00
s3_clnt.c Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
s3_enc.c Change some "int" variables to "size_t" in ssl3_handshake_mac(). 2015-09-24 00:04:59 +00:00
s3_lib.c Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
s3_meth.c Pull ChangeCipherSpec into the handshake state machine. 2015-12-16 18:36:57 +00:00
s3_pkt.c Slightly simplify SSL3_RECORD. 2015-12-16 18:41:59 +00:00
s3_srvr.c Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
ssl_aead_ctx.c Implement draft-ietf-tls-chacha20-poly1305-04. 2015-12-16 23:34:56 +00:00
ssl_asn1.c Check for overflow when parsing a CBS with d2i_*. 2015-11-16 23:17:42 +00:00
ssl_buffer.c Remove SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER. 2015-12-15 19:14:00 +00:00
ssl_cert.c Remove unreachable code to duplicate DH keys. 2015-12-16 21:20:12 +00:00
ssl_cipher.c Implement draft-ietf-tls-chacha20-poly1305-04. 2015-12-16 23:34:56 +00:00
ssl_ecdh.c Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
ssl_file.c More SSL_SESSION serialization functions. 2015-10-26 17:57:50 +00:00
ssl_lib.c Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
ssl_rsa.c Add get0 getters for EVP_PKEY. 2015-11-20 23:34:12 +00:00
ssl_session.c Remove the CRYPTO_EX_new callback. 2015-12-15 21:29:46 +00:00
ssl_stat.c Document alert handling. 2015-10-20 19:03:24 +00:00
ssl_test.cc Implement draft-ietf-tls-chacha20-poly1305-04. 2015-12-16 23:34:56 +00:00
t1_enc.c *_Update of length zero is legal. 2015-12-16 19:46:57 +00:00
t1_lib.c Implement draft-ietf-tls-curve25519-01 in C. 2015-12-22 21:51:30 +00:00
tls_record.c Remove |need_record_splitting| from |SSL3_STATE|. 2015-12-16 18:45:48 +00:00