Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Issue 994263002: Rewrite session cache in OpenSSL ports. (Closed)

Created:
5 years, 9 months ago by davidben
Modified:
5 years, 8 months ago
Reviewers:
Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rewrite session cache in OpenSSL ports. The old session cache assumed session IDs were unique and called into BoringSSL internals in the tests. Instead separate it into: - The session cache proper which just implements the keyed map of SSL_SESSIONs with expiration checks and size limits. This can be unit tested without using OpenSSL internals. - SSLClientSocketOpenSSL which hooks into SSL_CTX and SSL as appropriate and looks up or caches sessions. Add additional tests in SSLClientSocket tests to ensure test coverage for the latter. Note: this removes the session removal logic via SSL_CTX_set_sess_remove_cb. It was never called anyway (see https://crbug.com/466352). With that removed, the SSL_SESSION* pointer-keyed map is unnecessary and the cache can just be a base::MRUCache (which is what the original was based on anyway). BUG=454044 Committed: https://crrev.com/dafe4e53058ed802fabc151e67e75ffded76fd18 Cr-Commit-Position: refs/heads/master@{#324292}

Patch Set 1 #

Patch Set 2 : comment and todo #

Patch Set 3 : shutdown thread nuisance #

Patch Set 4 : No more remove_cb #

Patch Set 5 : rebase #

Patch Set 6 : use base::MRUCache (hah, that would have saved me some time...) #

Total comments: 24

Patch Set 7 : sleevi comments #

Total comments: 20

Patch Set 8 : rsleevi comments (buh, also a rebase, sorry) #

Total comments: 13

Patch Set 9 : rebase #

Patch Set 10 : sleevi comments #

Total comments: 10

Patch Set 11 : #

Patch Set 12 : rebase #

Patch Set 13 : reebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+670 lines, -1080 lines) Patch
M net/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -3 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M net/net.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +3 lines, -3 lines 0 comments Download
M net/net_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.h View 1 2 3 4 5 6 7 3 chunks +16 lines, -3 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 12 chunks +51 lines, -34 lines 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +168 lines, -6 lines 0 comments Download
D net/socket/ssl_session_cache_openssl.h View 1 2 3 4 5 6 1 chunk +0 lines, -141 lines 0 comments Download
D net/socket/ssl_session_cache_openssl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -509 lines 0 comments Download
D net/socket/ssl_session_cache_openssl_unittest.cc View 1 chunk +0 lines, -378 lines 0 comments Download
M net/ssl/scoped_openssl_types.h View 1 chunk +1 line, -0 lines 0 comments Download
A net/ssl/ssl_client_session_cache_openssl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +92 lines, -0 lines 0 comments Download
A net/ssl/ssl_client_session_cache_openssl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +107 lines, -0 lines 0 comments Download
A net/ssl/ssl_client_session_cache_openssl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +226 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (9 generated)
davidben
I actually wrote an implementation and tests from scratch before I realized we had a ...
5 years, 9 months ago (2015-03-12 00:03:45 UTC) #2
Ryan Sleevi
https://codereview.chromium.org/994263002/diff/100001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/994263002/diff/100001/net/socket/ssl_client_socket_openssl.cc#newcode2021 net/socket/ssl_client_socket_openssl.cc:2021: if (!SSL_session_reused(ssl_)) { Why is this check needed? Isn't ...
5 years, 9 months ago (2015-03-17 00:50:34 UTC) #3
davidben
Apologies for mixing a rebase into this. But the rebase involved reworking a lot of ...
5 years, 9 months ago (2015-03-20 22:41:27 UTC) #5
Ryan Sleevi
https://codereview.chromium.org/994263002/diff/140001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/994263002/diff/140001/net/socket/ssl_client_socket_openssl.cc#newcode206 net/socket/ssl_client_socket_openssl.cc:206: // every 256 connections. Is there any automated pruning ...
5 years, 9 months ago (2015-03-24 23:47:22 UTC) #6
davidben
https://codereview.chromium.org/994263002/diff/140001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/994263002/diff/140001/net/socket/ssl_client_socket_openssl.cc#newcode206 net/socket/ssl_client_socket_openssl.cc:206: // every 256 connections. On 2015/03/24 23:47:21, Ryan Sleevi ...
5 years, 9 months ago (2015-03-26 20:22:57 UTC) #7
Ryan Sleevi
https://codereview.chromium.org/994263002/diff/160001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/994263002/diff/160001/net/socket/ssl_client_socket_openssl.cc#newcode205 net/socket/ssl_client_socket_openssl.cc:205: // externally. // externally (i.e. by SSLClientSessionCacheOpenSSL). https://codereview.chromium.org/994263002/diff/160001/net/socket/ssl_client_socket_unittest.cc File ...
5 years, 8 months ago (2015-04-02 06:53:15 UTC) #8
davidben
https://codereview.chromium.org/994263002/diff/160001/net/ssl/ssl_client_session_cache_openssl.cc File net/ssl/ssl_client_session_cache_openssl.cc (right): https://codereview.chromium.org/994263002/diff/160001/net/ssl/ssl_client_session_cache_openssl.cc#newcode89 net/ssl/ssl_client_session_cache_openssl.cc:89: return now > expiration; On 2015/04/02 06:53:15, Ryan Sleevi ...
5 years, 8 months ago (2015-04-02 07:21:45 UTC) #9
Ryan Sleevi
https://codereview.chromium.org/994263002/diff/160001/net/ssl/ssl_client_session_cache_openssl.cc File net/ssl/ssl_client_session_cache_openssl.cc (right): https://codereview.chromium.org/994263002/diff/160001/net/ssl/ssl_client_session_cache_openssl.cc#newcode89 net/ssl/ssl_client_session_cache_openssl.cc:89: return now > expiration; I meant re-using a session ...
5 years, 8 months ago (2015-04-02 07:46:55 UTC) #10
davidben
https://codereview.chromium.org/994263002/diff/160001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/994263002/diff/160001/net/socket/ssl_client_socket_openssl.cc#newcode205 net/socket/ssl_client_socket_openssl.cc:205: // externally. On 2015/04/02 06:53:15, Ryan Sleevi wrote: > ...
5 years, 8 months ago (2015-04-02 19:05:10 UTC) #11
Ryan Sleevi
LGTM % nit but I'm not fixated on it https://codereview.chromium.org/994263002/diff/200001/net/socket/ssl_client_socket_unittest.cc File net/socket/ssl_client_socket_unittest.cc (right): https://codereview.chromium.org/994263002/diff/200001/net/socket/ssl_client_socket_unittest.cc#newcode3140 net/socket/ssl_client_socket_unittest.cc:3140: ...
5 years, 8 months ago (2015-04-02 20:00:14 UTC) #12
davidben
Note: diffing between patch set 9 might be more useful. https://codereview.chromium.org/994263002/diff/160001/net/ssl/ssl_client_session_cache_openssl.h File net/ssl/ssl_client_session_cache_openssl.h (right): https://codereview.chromium.org/994263002/diff/160001/net/ssl/ssl_client_session_cache_openssl.h#newcode55 ...
5 years, 8 months ago (2015-04-03 00:37:12 UTC) #13
Ryan Sleevi
LGTM https://codereview.chromium.org/994263002/diff/200001/net/ssl/ssl_client_session_cache_openssl_unittest.cc File net/ssl/ssl_client_session_cache_openssl_unittest.cc (right): https://codereview.chromium.org/994263002/diff/200001/net/ssl/ssl_client_session_cache_openssl_unittest.cc#newcode46 net/ssl/ssl_client_session_cache_openssl_unittest.cc:46: EXPECT_EQ(session3.get(), cache.Lookup("key1")); On 2015/04/03 00:37:11, David Benjamin wrote: ...
5 years, 8 months ago (2015-04-03 00:59:02 UTC) #14
davidben
https://codereview.chromium.org/994263002/diff/200001/net/ssl/ssl_client_session_cache_openssl_unittest.cc File net/ssl/ssl_client_session_cache_openssl_unittest.cc (right): https://codereview.chromium.org/994263002/diff/200001/net/ssl/ssl_client_session_cache_openssl_unittest.cc#newcode46 net/ssl/ssl_client_session_cache_openssl_unittest.cc:46: EXPECT_EQ(session3.get(), cache.Lookup("key1")); On 2015/04/03 00:59:02, Ryan Sleevi wrote: > ...
5 years, 8 months ago (2015-04-07 18:35:36 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/994263002/240001
5 years, 8 months ago (2015-04-08 01:31:25 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_clobber_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_clobber_rel_ng/builds/13874)
5 years, 8 months ago (2015-04-08 04:56:36 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/994263002/240001
5 years, 8 months ago (2015-04-08 18:52:33 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_clobber_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_clobber_rel_ng/builds/14208)
5 years, 8 months ago (2015-04-08 19:02:19 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/994263002/260001
5 years, 8 months ago (2015-04-08 20:12:44 UTC) #27
commit-bot: I haz the power
Committed patchset #13 (id:260001)
5 years, 8 months ago (2015-04-08 22:54:05 UTC) #28
commit-bot: I haz the power
5 years, 8 months ago (2015-04-08 22:54:57 UTC) #29
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/dafe4e53058ed802fabc151e67e75ffded76fd18
Cr-Commit-Position: refs/heads/master@{#324292}

Powered by Google App Engine
This is Rietveld 408576698