boringssl/ssl
David Benjamin 98e882ead1 Clean up s23_srvr.c.
ssl23_get_client_hello has lots of remnants of SSLv2 support and remnants of an
even older SSL_OP_NON_EXPORT_FIRST option (see upstream's
d92f0bb6e9ed94ac0c3aa0c939f2565f2ed95935) which complicates the logic.

Split it into three states and move V2ClientHello parsing into its own
function. Port it to CBS and CBB to give bounds checks on the V2ClientHello
parse.

This fixes a minor bug where, if the SSL_accept call in ssl23_get_client_hello
failed, cb would not be NULL'd and SSL_CB_ACCEPT_LOOP would get reported an
extra time.

It also unbreaks the invariant between s->packet, s->packet_length,
s->s3->rbuf.buf, and s->s3->rbuf.offset at the point the switch, although this
was of no consequence because the first ssl3_read_n call passes extend = 0
which resets s->packet and s->packet_length.

It also makes us tolerant to major version bumps in the ClientHello. Add tests
for TLS tolerance of both minor and major version bumps as well as the HTTP
request error codes.

Change-Id: I948337f4dc483f4ebe1742d3eba53b045b260257
Reviewed-on: https://boringssl-review.googlesource.com/1455
Reviewed-by: Adam Langley <agl@google.com>
2014-08-12 21:10:56 +00:00
..
pqueue Move public headers to include/openssl/ 2014-07-14 22:42:18 +00:00
test Clean up s23_srvr.c. 2014-08-12 21:10:56 +00:00
CMakeLists.txt Add visibility rules. 2014-07-31 22:03:11 +00:00
d1_both.c Remove some duplicate DTLS code. 2014-08-07 21:09:32 +00:00
d1_clnt.c Remove ssl3_check_finished. 2014-07-23 15:52:38 +00:00
d1_enc.c Remove crypto/comp and SSL_COMP support code. 2014-06-24 17:22:06 +00:00
d1_lib.c Windows build fixes. 2014-08-11 22:10:02 +00:00
d1_meth.c Inital import. 2014-06-20 13:17:32 -07:00
d1_pkt.c Remove OPENSSL_NO_TLS{,1} 2014-08-04 19:20:19 +00:00
d1_srtp.c Fix typo in DTLS-SRTP extension parsing. 2014-07-18 00:52:51 +00:00
d1_srvr.c Fix server-side ClientHello state machine. 2014-08-05 18:07:13 +00:00
s3_both.c Windows build fixes. 2014-08-11 22:10:02 +00:00
s3_cbc.c Remove OPENSSL_NO_SHA512 2014-08-04 20:13:54 +00:00
s3_clnt.c Fixed reporting wrong function to OPENSSL_PUT_ERROR. 2014-08-11 18:46:56 +00:00
s3_enc.c Remove support code for export cipher suites. 2014-07-24 21:14:08 +00:00
s3_lib.c Remove remnants of OPENSSL_NO_CAMELLIA 2014-08-04 19:19:35 +00:00
s3_meth.c Inital import. 2014-06-20 13:17:32 -07:00
s3_pkt.c Retry sending record split fragment when SSL write fails. 2014-08-07 00:08:44 +00:00
s3_srvr.c Remove SSL_OP_TLS_ROLLBACK_BUG. 2014-08-08 17:04:53 +00:00
s23_clnt.c Remove OPENSSL_MAX_TLS1_2_CIPHER_LENGTH. 2014-08-04 19:00:30 +00:00
s23_lib.c Remove some remnants of SSLv2 support. 2014-07-24 21:10:41 +00:00
s23_meth.c Remove OPENSSL_NO_TLS{,1} 2014-08-04 19:20:19 +00:00
s23_pkt.c Inital import. 2014-06-20 13:17:32 -07:00
s23_srvr.c Clean up s23_srvr.c. 2014-08-12 21:10:56 +00:00
ssl_algs.c Inital import. 2014-06-20 13:17:32 -07:00
ssl_asn1.c unifdef OPENSSL_NO_PSK. 2014-07-24 21:11:05 +00:00
ssl_cert.c Don't X509_up_ref X509_STOREs. 2014-08-07 02:44:31 +00:00
ssl_ciph.c Make disabling last cipher work. 2014-07-28 17:05:13 -07:00
ssl_error.c Clean up s23_srvr.c. 2014-08-12 21:10:56 +00:00
ssl_lib.c Add X509_up_ref and use it internally. 2014-08-07 00:06:34 +00:00
ssl_locl.h Windows build fixes. 2014-08-11 22:10:02 +00:00
ssl_rsa.c Add X509_up_ref and use it internally. 2014-08-07 00:06:34 +00:00
ssl_sess.c unifdef OPENSSL_NO_PSK. 2014-07-24 21:11:05 +00:00
ssl_stat.c Clean up s23_srvr.c. 2014-08-12 21:10:56 +00:00
ssl_test.c Fix magic SSL reason codes. 2014-07-16 18:54:06 +00:00
ssl_txt.c unifdef OPENSSL_NO_PSK. 2014-07-24 21:11:05 +00:00
t1_clnt.c Inital import. 2014-06-20 13:17:32 -07:00
t1_enc.c Remove support code for export cipher suites. 2014-07-24 21:14:08 +00:00
t1_lib.c Windows build fixes. 2014-08-11 22:10:02 +00:00
t1_meth.c Inital import. 2014-06-20 13:17:32 -07:00
t1_reneg.c Port ssl3_get_client_hello to CBS. 2014-07-15 18:30:09 +00:00
t1_srvr.c Inital import. 2014-06-20 13:17:32 -07:00