openssl/ssl
Benjamin Kaduk 3be08e3011 Provide SSL_CTX.stats.sess_accept for switched ctxs
We currently increment the SSL_CTX stats.sess_accept field in
tls_setup_handshake(), which is invoked from the state machine well
before ClientHello processing would have had a chance to switch
the SSL_CTX attached to the SSL object due to a provided SNI value.
However, stats.sess_accept_good is incremented in tls_finish_handshake(),
and uses the s->ctx.stats field (i.e., the new SSL_CTX that was switched
to as a result of SNI processing).  This leads to the confusing
(nonsensical) situation where stats.sess_accept_good is larger than
stats.sess_accept, as the "sess_accept" value was counted on the
s->session_ctx.

In order to provide some more useful numbers, increment
s->ctx.stats.sess_accept after SNI processing if the SNI processing
changed s->ctx to differ from s->session_ctx.  To preserve the
property that any given accept is counted only once, make the
corresponding decrement to s->session_ctx.stats.sess_accept when
doing so.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/4549)
2017-10-30 10:21:10 -05:00
..
record Remove parentheses of return. 2017-10-18 16:05:06 +01:00
statem Provide SSL_CTX.stats.sess_accept for switched ctxs 2017-10-30 10:21:10 -05:00
bio_ssl.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
build.info
d1_lib.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
d1_msg.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
d1_srtp.c
methods.c
packet_locl.h
packet.c
pqueue.c
s3_cbc.c
s3_enc.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
s3_lib.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
s3_msg.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
ssl_asn1.c
ssl_cert_table.h
ssl_cert.c Simplify the stack reservation 2017-10-26 14:34:35 -04:00
ssl_ciph.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
ssl_conf.c
ssl_err.c Session resume broken switching contexts 2017-10-04 10:21:08 +10:00
ssl_init.c
ssl_lib.c Use atomics for SSL_CTX statistics 2017-10-30 10:18:09 -05:00
ssl_locl.h Move supportedgroup ext-block fields out of NO_EC 2017-10-11 08:25:40 -05:00
ssl_mcnf.c
ssl_rsa.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
ssl_sess.c Use atomics for SSL_CTX statistics 2017-10-30 10:18:09 -05:00
ssl_stat.c
ssl_txt.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
ssl_utst.c
t1_enc.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
t1_lib.c Various clean-ups 2017-10-20 22:58:46 -04:00
t1_trce.c
tls13_enc.c
tls_srp.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00