boringssl/ssl
David Benjamin 1269ddd377 Never use the internal session cache for a client.
The internal session cache is keyed on session ID, so this is completely
useless for clients (indeed we never look it up internally). Along the way,
tidy up ssl_update_cache to be more readable. The slight behavior change is
that SSL_CTX_add_session's return code no longer controls the external
callback. It's not clear to me what that could have accomplished. (It can only
fail on allocation error. We only call it for new sessions, so the duplicate
case is impossible.)

The one thing of value the internal cache might have provided is managing the
timeout. The SSL_CTX_flush_sessions logic would flip the not_resumable bit and
cause us not to offer expired sessions (modulo SSL_CTX_flush_sessions's delay
and any discrepancies between the two caches). Instead, just check expiration
when deciding whether or not to offer a session.

This way clients that set SSL_SESS_CACHE_CLIENT blindly don't accidentally
consume gobs of memory.

BUG=531194

Change-Id: If97485beab21874f37737edc44df24e61ce23705
Reviewed-on: https://boringssl-review.googlesource.com/6321
Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-26 19:27:28 +00:00
..
pqueue Deprecate SSL_library_init. 2015-10-26 18:36:23 +00:00
test Deprecate SSL_library_init. 2015-10-26 18:36:23 +00:00
CMakeLists.txt Remove SSL_SESSION_print*. 2015-10-13 19:24:14 +00:00
custom_extensions.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
d1_both.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
d1_clnt.c Document the info callback. 2015-10-26 18:12:22 +00:00
d1_lib.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
d1_meth.c Ditch remaining filename comments from public headers and ssl/ 2015-10-20 18:40:05 +00:00
d1_pkt.c Document the info callback. 2015-10-26 18:12:22 +00:00
d1_srtp.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
d1_srvr.c Document the info callback. 2015-10-26 18:12:22 +00:00
dtls_record.c Reject empty records of unexpected type. 2015-08-28 22:03:00 +00:00
internal.h Never use the internal session cache for a client. 2015-10-26 19:27:28 +00:00
s3_both.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
s3_clnt.c Never use the internal session cache for a client. 2015-10-26 19:27:28 +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 Convert ssl3_send_channel_id to CBB. 2015-10-20 18:16:46 +00:00
s3_meth.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
s3_pkt.c Document the info callback. 2015-10-26 18:12:22 +00:00
s3_srvr.c Remove all the logic around custom session IDs and retrying on collisions. 2015-10-26 19:00:14 +00:00
ssl_aead_ctx.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
ssl_asn1.c Unexport SSL_SESSION_ASN1_VERSION. 2015-10-20 18:41:08 +00:00
ssl_buffer.c Fix buffer size computation. 2015-09-01 20:18:21 +00:00
ssl_cert.c Document certificate verification functions in SSL. 2015-09-23 23:31:18 +00:00
ssl_cipher.c Deprecate all the string macros. 2015-10-26 18:15:33 +00:00
ssl_file.c More SSL_SESSION serialization functions. 2015-10-26 17:57:50 +00:00
ssl_lib.c Never use the internal session cache for a client. 2015-10-26 19:27:28 +00:00
ssl_rsa.c Adding more options for signing digest fallback. 2015-09-23 21:55:01 +00:00
ssl_session.c Tidy up SSL_CTX_add_session. 2015-10-26 19:22:40 +00:00
ssl_stat.c Document alert handling. 2015-10-20 19:03:24 +00:00
ssl_test.cc Never use the internal session cache for a client. 2015-10-26 19:27:28 +00:00
t1_enc.c Align the SSL stack on #include style. 2015-09-15 23:32:07 +00:00
t1_lib.c Update references to the padding draft. 2015-10-21 14:49:23 -07:00
tls_record.c Add use counters for SSL_OP_TLS_D5_BUG and SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER. 2015-10-20 18:22:47 +00:00