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

Issue 1131763002: Reject renegotiations in SSLClientSocket by default. (Closed)

Created:
5 years, 7 months ago by davidben
Modified:
5 years, 7 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

Reject renegotiations in SSLClientSocket by default. Only HTTP/1.1 (and below) sockets may renegotiate. This fix a crash because SpdyHttpStream didn't account for this properly. (And can't as the renego + client auth hack is inherently incompatible with multiplexing.) Tested manually against hacked up Go servers: - HTTP/1.1 server which renegotiates with client auth before sending a response on a fresh socket. - Same as above but with a reused socket (the server only requests renego when fetching /auth). - HTTP/2 which incorrectly renegotiates with client auth upon requesting /auth. Verified that we get ERR_SSL_PROTOCOL_ERROR and not crash. - HTTP/1.1 server which does two handshakes in a row with Finished and HelloRequest in the same record. NSS and BoringSSL differ in their behavior here, but in neither port should we miss the renego. BUG=484543, 462283 Committed: https://crrev.com/421116c22292293f78c6ab15c7a8d6ca2fc1b68b Cr-Commit-Position: refs/heads/master@{#329466}

Patch Set 1 #

Total comments: 11

Patch Set 2 : sleevi comments #

Patch Set 3 : new API #

Patch Set 4 : stray function prototype #

Total comments: 1

Patch Set 5 : NSS greediness... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -17 lines) Patch
M net/http/http_stream_factory_impl_job.cc View 1 2 1 chunk +17 lines, -3 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 3 4 9 chunks +47 lines, -14 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M net/socket/ssl_client_socket_openssl.cc View 1 2 3 chunks +19 lines, -0 lines 0 comments Download
M net/ssl/ssl_config.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M net/ssl/ssl_config.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 17 (2 generated)
davidben
Unfortunately, my answer to the inevitable "tests?" is a very big sad face. tlslite doesn't ...
5 years, 7 months ago (2015-05-06 23:30:18 UTC) #2
Ryan Sleevi
Can you describe what alternatives you considered? I don't think this is right - or, ...
5 years, 7 months ago (2015-05-06 23:36:59 UTC) #3
davidben
On 2015/05/06 23:36:59, Ryan Sleevi wrote: > Can you describe what alternatives you considered? TBH, ...
5 years, 7 months ago (2015-05-06 23:52:28 UTC) #4
Ryan Sleevi
OK, sounds reasonable, but I'm concerned about places where it's supposed to work that this ...
5 years, 7 months ago (2015-05-07 01:41:26 UTC) #5
davidben
https://codereview.chromium.org/1131763002/diff/1/net/http/http_stream_factory_impl_job.cc File net/http/http_stream_factory_impl_job.cc (right): https://codereview.chromium.org/1131763002/diff/1/net/http/http_stream_factory_impl_job.cc#newcode1123 net/http/http_stream_factory_impl_job.cc:1123: connection_->socket()->SetRenegotiationsAllowed(true); On 2015/05/07 01:41:26, Ryan Sleevi wrote: > This ...
5 years, 7 months ago (2015-05-07 19:12:35 UTC) #6
davidben
Updated with new API per discussion out-of-band.
5 years, 7 months ago (2015-05-08 21:33:00 UTC) #7
davidben
https://codereview.chromium.org/1131763002/diff/60001/net/socket/ssl_client_socket_openssl.cc File net/socket/ssl_client_socket_openssl.cc (right): https://codereview.chromium.org/1131763002/diff/60001/net/socket/ssl_client_socket_openssl.cc#newcode917 net/socket/ssl_client_socket_openssl.cc:917: if (rv == 1) { This function's getting slightly ...
5 years, 7 months ago (2015-05-08 21:34:29 UTC) #8
Ryan Sleevi
LGTM, but please don't CQ right away. Can you make sure the commit note describes ...
5 years, 7 months ago (2015-05-08 22:40:59 UTC) #9
davidben
Updated description and modified the NSS side to account for the fourth case. Assuming it's ...
5 years, 7 months ago (2015-05-09 00:19:25 UTC) #10
davidben
(No rush, but PTAL at the new NSS code, in case that was unclear.)
5 years, 7 months ago (2015-05-12 00:57:20 UTC) #11
Ryan Sleevi
Thanks - still LGTM, go ahead and CQ
5 years, 7 months ago (2015-05-12 01:04:41 UTC) #12
davidben
Repeated the tests manually. Still behaves as expected. CQ'ing.
5 years, 7 months ago (2015-05-12 18:41:39 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1131763002/80001
5 years, 7 months ago (2015-05-12 18:43:13 UTC) #15
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 7 months ago (2015-05-12 19:57:04 UTC) #16
commit-bot: I haz the power
5 years, 7 months ago (2015-05-12 19:58:00 UTC) #17
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/421116c22292293f78c6ab15c7a8d6ca2fc1b68b
Cr-Commit-Position: refs/heads/master@{#329466}

Powered by Google App Engine
This is Rietveld 408576698