81ea0bf538
When not offering to resume a session, the client populates s->session with a fresh SSL_SESSION before the ServerHello is processed and, in DTLS_ANY_VERSION, before the version is even determined. Don't create a fresh SSL_SESSION until we know we are doing a full handshake. This brings ssl3_send_client_hello closer to ssl23_client_hello in behavior. It also fixes ssl_version in the client in DTLS_ANY_VERSION. SSLv23_client_method is largely unchanged. If no session is offered, s->session continues to be NULL until the ServerHello is received. The one difference is that s->session isn't populated until the entire ServerHello is received, rather than just the first half, in the case of a fragmented ServerHello. Apart from info_callback, no external hooks get called between those points, so this shouldn't expose new missing NULL checks. The other client methods change significantly to match SSLv23_client_method's behavior. For TLS, any exposed missing NULL checks are also in SSLv23_client_method (and version-specific methods are already weird), so that should be safe. For DTLS, I've verified that accesses in d1_*.c either handle NULL or are after the ServerHello. Change-Id: Idcae6bd242480e28a57dbba76ce67f1ac1ae1d1d Reviewed-on: https://boringssl-review.googlesource.com/2404 Reviewed-by: Adam Langley <agl@google.com> |
||
---|---|---|
.. | ||
pqueue | ||
test | ||
CMakeLists.txt | ||
d1_both.c | ||
d1_clnt.c | ||
d1_enc.c | ||
d1_lib.c | ||
d1_meth.c | ||
d1_pkt.c | ||
d1_srtp.c | ||
d1_srvr.c | ||
s3_both.c | ||
s3_cbc.c | ||
s3_clnt.c | ||
s3_enc.c | ||
s3_lib.c | ||
s3_meth.c | ||
s3_pkt.c | ||
s3_srvr.c | ||
s23_clnt.c | ||
s23_lib.c | ||
s23_meth.c | ||
s23_pkt.c | ||
s23_srvr.c | ||
ssl_algs.c | ||
ssl_asn1.c | ||
ssl_cert.c | ||
ssl_ciph.c | ||
ssl_error.c | ||
ssl_lib.c | ||
ssl_locl.h | ||
ssl_rsa.c | ||
ssl_sess.c | ||
ssl_stat.c | ||
ssl_test.c | ||
ssl_txt.c | ||
t1_enc.c | ||
t1_lib.c | ||
t1_reneg.c |