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

Issue 433123003: Centralize the logic for checking public key pins (Closed)

Created:
6 years, 4 months ago by Ryan Hamilton
Modified:
6 years, 4 months ago
Reviewers:
palmer, wtc, agl, Ryan Sleevi
CC:
cbentzel+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Centralize the logic for checking public key pins from ClientSocketNSS and ProofVerifierChromium to TransportSecurityState::CheckPublicKeyPins. This required adding an is_issued_by_known_root argument to this method. In addition, CheckPublicKeyPins now only checks static pins if the TransportSecurityState's enable_static_pins_ member is true. This defaults to true only for official desktop builds. This also means that dynamic pins are now checked on mobile and on non-official builds. BUG=398925, 391033 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288435

Patch Set 1 #

Patch Set 2 : add comment #

Total comments: 1

Patch Set 3 : Rebase #

Total comments: 15

Patch Set 4 : fix comments #

Total comments: 12

Patch Set 5 : fix comments from agl #

Total comments: 12

Patch Set 6 : Fix comments from sleevi #

Total comments: 14

Patch Set 7 : Fix more comments from sleevi #

Patch Set 8 : small cleanup #

Patch Set 9 : make IsBuildTimely and ReportUMAOnPinFailure static, as per wtc #

Total comments: 26

Patch Set 10 : git cl format #

Patch Set 11 : more fixes #

Patch Set 12 : final fixes? Hah! #

Total comments: 7

Patch Set 13 : fix final comments #

Patch Set 14 : Rebase #

Patch Set 15 : fewer friends #

Unified diffs Side-by-side diffs Delta from patch set Stats (+233 lines, -174 lines) Patch
M net/http/http_security_headers_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +24 lines, -8 lines 0 comments Download
M net/http/transport_security_state.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +17 lines, -6 lines 0 comments Download
M net/http/transport_security_state.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +88 lines, -36 lines 0 comments Download
M net/http/transport_security_state_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 13 chunks +87 lines, -36 lines 0 comments Download
M net/quic/crypto/proof_verifier_chromium.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -46 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +9 lines, -42 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
Ryan Hamilton
6 years, 4 months ago (2014-08-05 17:30:02 UTC) #1
Ryan Hamilton
https://codereview.chromium.org/433123003/diff/40001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/40001/net/http/transport_security_state.cc#newcode696 net/http/transport_security_state.cc:696: if (!cert_verify_result.is_issued_by_known_root || I wonder if I should pass ...
6 years, 4 months ago (2014-08-05 17:42:37 UTC) #2
wtc
Review comments on patch set 3: Thank you very much for writing this CL! 1. ...
6 years, 4 months ago (2014-08-05 18:16:24 UTC) #3
wtc
https://codereview.chromium.org/433123003/diff/20001/net/quic/crypto/proof_verifier_chromium.h File net/quic/crypto/proof_verifier_chromium.h (right): https://codereview.chromium.org/433123003/diff/20001/net/quic/crypto/proof_verifier_chromium.h#newcode40 net/quic/crypto/proof_verifier_chromium.h:40: std::string pinning_failure_log; In my preferred API design, pinning_failure_log would ...
6 years, 4 months ago (2014-08-05 18:18:57 UTC) #4
Ryan Hamilton
Addressed your comments. Will ping other reviewers. https://codereview.chromium.org/433123003/diff/40001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/40001/net/http/transport_security_state.cc#newcode674 net/http/transport_security_state.cc:674: On 2014/08/05 ...
6 years, 4 months ago (2014-08-06 21:51:02 UTC) #5
Ryan Hamilton
+agl,palmer,rsleevi: Can you guys take a look at this to figure out the right API ...
6 years, 4 months ago (2014-08-07 15:23:08 UTC) #6
agl
LGTM https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc#newcode675 net/http/transport_security_state.cc:675: #if defined(OFFICIAL_BUILD) && !defined(OS_ANDROID) && !defined(OS_IOS) Now that ...
6 years, 4 months ago (2014-08-07 18:32:59 UTC) #7
Ryan Sleevi
Will take a look. This is not an immediate rush, is it? If not, I'd ...
6 years, 4 months ago (2014-08-07 18:36:49 UTC) #8
Ryan Hamilton
On 2014/08/07 18:36:49, Ryan Sleevi wrote: > Will take a look. This is not an ...
6 years, 4 months ago (2014-08-07 18:39:46 UTC) #9
Ryan Hamilton
https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc#newcode675 net/http/transport_security_state.cc:675: #if defined(OFFICIAL_BUILD) && !defined(OS_ANDROID) && !defined(OS_IOS) On 2014/08/07 18:32:59, ...
6 years, 4 months ago (2014-08-07 18:44:26 UTC) #10
palmer
https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc#newcode702 net/http/transport_security_state.cc:702: if (CheckPublicKeyPins(host, Does it make sense to just move ...
6 years, 4 months ago (2014-08-07 18:50:50 UTC) #11
Ryan Sleevi
https://codereview.chromium.org/433123003/diff/80001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/80001/net/http/transport_security_state.cc#newcode676 net/http/transport_security_state.cc:676: return true; // TODO(rsleevi): http://crbug.com/391035 - Enable dynamic PKP ...
6 years, 4 months ago (2014-08-07 18:58:41 UTC) #12
Ryan Hamilton
While I work on other comments, I'm curious to get your input on this... https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc ...
6 years, 4 months ago (2014-08-07 20:09:38 UTC) #13
Ryan Sleevi
https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc#newcode702 net/http/transport_security_state.cc:702: if (CheckPublicKeyPins(host, On 2014/08/07 20:09:38, Ryan Hamilton wrote: > ...
6 years, 4 months ago (2014-08-07 20:40:17 UTC) #14
Ryan Hamilton
OK, PTAL, I've reworked this CL slightly as per feedback from sleevi and palmer. https://codereview.chromium.org/433123003/diff/60001/net/http/transport_security_state.cc ...
6 years, 4 months ago (2014-08-07 22:07:12 UTC) #15
Ryan Sleevi
Mostly LG, some pedantry/comments I feel like you should at least add a test to ...
6 years, 4 months ago (2014-08-07 22:19:07 UTC) #16
Ryan Hamilton
Thanks for pointing out transport_security_state_unittest.cc. I missed that it existed. I modified a number of ...
6 years, 4 months ago (2014-08-07 22:49:39 UTC) #17
wtc
Patch set 6 LGTM. Please update ssl_client_socket_openssl.cc. https://codereview.chromium.org/433123003/diff/120001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/120001/net/http/transport_security_state.cc#newcode141 net/http/transport_security_state.cc:141: !TransportSecurityState::IsBuildTimely() || ...
6 years, 4 months ago (2014-08-07 22:51:44 UTC) #18
Ryan Hamilton
I think I would prefer to make the openssl changes in a different CL, which ...
6 years, 4 months ago (2014-08-07 23:19:04 UTC) #19
Ryan Sleevi
https://codereview.chromium.org/433123003/diff/180001/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/180001/net/http/transport_security_state.cc#newcode143 net/http/transport_security_state.cc:143: return true; Re-git-cl-format this? https://codereview.chromium.org/433123003/diff/180001/net/http/transport_security_state.cc#newcode811 net/http/transport_security_state.cc:811: return false; Ugh ...
6 years, 4 months ago (2014-08-07 23:31:19 UTC) #20
wtc
Patch set 9 LGTM. https://codereview.chromium.org/433123003/diff/180001/net/http/http_security_headers_unittest.cc File net/http/http_security_headers_unittest.cc (right): https://codereview.chromium.org/433123003/diff/180001/net/http/http_security_headers_unittest.cc#newcode676 net/http/http_security_headers_unittest.cc:676: state.enable_static_pinning_ = true; Move this ...
6 years, 4 months ago (2014-08-07 23:39:13 UTC) #21
Ryan Sleevi
Further comment on the tests, which I think should be golden for this HSTS/HPKP split, ...
6 years, 4 months ago (2014-08-07 23:48:40 UTC) #22
Ryan Hamilton
https://codereview.chromium.org/433123003/diff/180001/net/http/http_security_headers_unittest.cc File net/http/http_security_headers_unittest.cc (right): https://codereview.chromium.org/433123003/diff/180001/net/http/http_security_headers_unittest.cc#newcode676 net/http/http_security_headers_unittest.cc:676: state.enable_static_pinning_ = true; On 2014/08/07 23:39:12, wtc wrote: > ...
6 years, 4 months ago (2014-08-08 00:54:01 UTC) #23
Ryan Sleevi
LGTM. Please double check with Wan-Teh or Adam, given the modifications.
6 years, 4 months ago (2014-08-08 01:18:49 UTC) #24
wtc
Patch set 12 LGTM. IMPORTANT: please update the CL's description to reflect the final code. ...
6 years, 4 months ago (2014-08-08 15:37:00 UTC) #25
wtc
https://codereview.chromium.org/433123003/diff/150007/net/http/transport_security_state_unittest.cc File net/http/transport_security_state_unittest.cc (right): https://codereview.chromium.org/433123003/diff/150007/net/http/transport_security_state_unittest.cc#newcode480 net/http/transport_security_state_unittest.cc:480: TEST_F(TransportSecurityStateTest, PreloadedPins) { On 2014/08/08 15:36:59, wtc wrote: > ...
6 years, 4 months ago (2014-08-08 15:56:11 UTC) #26
Ryan Hamilton
Thanks for the review! https://codereview.chromium.org/433123003/diff/150007/net/http/transport_security_state.cc File net/http/transport_security_state.cc (right): https://codereview.chromium.org/433123003/diff/150007/net/http/transport_security_state.cc#newcode132 net/http/transport_security_state.cc:132: // Perform pin validation if, ...
6 years, 4 months ago (2014-08-08 16:21:43 UTC) #27
Ryan Hamilton
The CQ bit was checked by rch@chromium.org
6 years, 4 months ago (2014-08-08 16:35:51 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rch@chromium.org/433123003/290001
6 years, 4 months ago (2014-08-08 16:36:58 UTC) #29
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-08-08 16:45:59 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-08 16:48:23 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/39207) ios_dbg_simulator on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator/builds/3842) ios_rel_device ...
6 years, 4 months ago (2014-08-08 16:48:24 UTC) #32
Ryan Hamilton
The CQ bit was checked by rch@chromium.org
6 years, 4 months ago (2014-08-08 17:23:26 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rch@chromium.org/433123003/310001
6 years, 4 months ago (2014-08-08 17:24:31 UTC) #34
Ryan Hamilton
The CQ bit was checked by rch@chromium.org
6 years, 4 months ago (2014-08-08 18:09:01 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rch@chromium.org/433123003/330001
6 years, 4 months ago (2014-08-08 18:09:52 UTC) #36
commit-bot: I haz the power
6 years, 4 months ago (2014-08-08 21:22:52 UTC) #37
Message was sent while issue was closed.
Change committed as 288435

Powered by Google App Engine
This is Rietveld 408576698