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

Issue 11274032: Separate http_security_headers from transport_security_state (Closed)

Created:
8 years, 2 months ago by unsafe
Modified:
7 years, 11 months ago
Reviewers:
palmer, eroman, agl, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org, eroman, darin-cc_chromium.org
Base URL:
https://src.chromium.org/chrome/trunk/src/
Visibility:
Public.

Description

This is the first in an intended sequence of CLs to refactor TransportSecurityState, fix some book-keeping bugs, and hopefully add TACK. This sequence of CLs will be derived from the original, overly-large CL #11191005. This CL does a few things: - Adds a high-level API for processing HSTS/HPKP - Move the code for handling HSTS/HPKP headers out of transport_security_state - Move HashValue out of x509_cert_types - Addresses several HSTS/HPKP parsing bugs identified during review of the cleanup - Ignore unknown HSTS/HPKP directives - Ignore unknown hash algorithms - Handle overly-large (> int64) expirations without parsing issues - Reject invalid pins entered by users Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175595

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 46

Patch Set 6 : #

Patch Set 7 : #

Total comments: 12

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Total comments: 51

Patch Set 14 : #

Total comments: 2

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Total comments: 13

Patch Set 19 : #

Total comments: 32

Patch Set 20 : #

Total comments: 21

Patch Set 21 : #

Patch Set 22 : #

Total comments: 20

Patch Set 23 : #

Total comments: 10

Patch Set 24 : #

Total comments: 4

Patch Set 25 : #

Patch Set 26 : #

Patch Set 27 : #

Total comments: 2

Patch Set 28 : #

Total comments: 1

Patch Set 29 : #

Patch Set 30 : #

Patch Set 31 : #

Patch Set 32 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1327 lines, -1137 lines) Patch
M AUTHORS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/net/transport_security_persister.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +3 lines, -11 lines 0 comments Download
M chrome/browser/ui/webui/net_internals/net_internals_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 4 chunks +41 lines, -35 lines 0 comments Download
A net/base/hash_value.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +125 lines, -0 lines 0 comments Download
A net/base/hash_value.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +123 lines, -0 lines 0 comments Download
M net/base/transport_security_state.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 chunks +10 lines, -19 lines 0 comments Download
M net/base/transport_security_state.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 8 chunks +78 lines, -408 lines 0 comments Download
M net/base/transport_security_state_static.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +105 lines, -53 lines 0 comments Download
M net/base/transport_security_state_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +1 line, -401 lines 0 comments Download
M net/base/x509_cert_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +1 line, -82 lines 0 comments Download
M net/base/x509_cert_types.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 chunks +0 lines, -65 lines 0 comments Download
A net/http/http_security_headers.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +60 lines, -0 lines 0 comments Download
A net/http/http_security_headers.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +330 lines, -0 lines 0 comments Download
A net/http/http_security_headers_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +424 lines, -0 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 chunks +5 lines, -0 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +20 lines, -63 lines 0 comments Download

Messages

Total messages: 61 (0 generated)
Ryan Sleevi
Hi Trevor - first run through on this, highlighting the low-hanging fruits and just getting ...
8 years, 2 months ago (2012-10-25 01:59:09 UTC) #1
unsafe
Hi Ryan, I responded to your comments and uploaded a new version. My initial goal ...
8 years, 1 month ago (2012-10-25 06:59:53 UTC) #2
unsafe
Fixed a couple try errors I think (added NET_EXPORT_PRIVATE) to http_security_headers. Not sure what's going ...
8 years, 1 month ago (2012-10-26 01:09:59 UTC) #3
Ryan Sleevi
You're failing on Android for the reasons in the unit test that I point out ...
8 years, 1 month ago (2012-10-29 09:01:24 UTC) #4
unsafe
See below - the nits are fixed but I'm still not sure why verifier->Verify() failed ...
8 years, 1 month ago (2012-10-29 22:30:55 UTC) #5
Ryan Sleevi
I'll take another pass tomorrow, but I'm running out of nits, and that's a great ...
8 years, 1 month ago (2012-10-29 23:46:25 UTC) #6
unsafe
On 2012/10/29 23:46:25, Ryan Sleevi wrote: > Hence why I said to rip it all ...
8 years, 1 month ago (2012-10-30 01:21:10 UTC) #7
unsafe
Recovered from IETF, back in action... Per conversation w/rsleevi did a bit more refactoring: - ...
8 years, 1 month ago (2012-11-13 09:12:20 UTC) #8
palmer
> * Rsleevi may have mentioned that HPKP header processing in > url_request_http_job should parse ...
8 years, 1 month ago (2012-11-13 18:20:42 UTC) #9
Ryan Sleevi
will follow up with palmer@ re: coalescing or not. You can choose to interpret that ...
8 years, 1 month ago (2012-11-13 19:02:30 UTC) #10
palmer
https://codereview.chromium.org/11274032/diff/40006/net/base/hash_value.cc File net/base/hash_value.cc (right): https://codereview.chromium.org/11274032/diff/40006/net/base/hash_value.cc#newcode117 net/base/hash_value.cc:117: return NULL != bsearch(hash.data, array, arraylen, base::kSHA1Length, Perhaps it's ...
8 years, 1 month ago (2012-11-13 19:35:04 UTC) #11
Ryan Sleevi
https://codereview.chromium.org/11274032/diff/40006/net/url_request/url_request_http_job.cc File net/url_request/url_request_http_job.cc (right): https://codereview.chromium.org/11274032/diff/40006/net/url_request/url_request_http_job.cc#newcode708 net/url_request/url_request_http_job.cc:708: security_state->AddHPKPHeader(request_info_.url.host(), value, ssl_info); On 2012/11/13 19:35:04, Chris P. wrote: ...
8 years, 1 month ago (2012-11-13 19:43:15 UTC) #12
Chris Palmer
> So yeah, it seems like only one PKP header may be present. I'm not ...
8 years, 1 month ago (2012-11-13 19:47:56 UTC) #13
unsafe
OK, I think I addressed all comments. Open questions: - do you really want 1-space ...
8 years, 1 month ago (2012-11-13 23:20:18 UTC) #14
Ryan Sleevi
https://codereview.chromium.org/11274032/diff/40006/chrome/browser/ui/webui/net_internals/net_internals_ui.cc File chrome/browser/ui/webui/net_internals/net_internals_ui.cc (right): https://codereview.chromium.org/11274032/diff/40006/chrome/browser/ui/webui/net_internals/net_internals_ui.cc#newcode1196 chrome/browser/ui/webui/net_internals/net_internals_ui.cc:1196: Base64StringToHashes(hashes_str, &state.dynamic_spki_hashes); On 2012/11/13 23:20:18, unsafe wrote: > On ...
8 years, 1 month ago (2012-11-13 23:32:05 UTC) #15
unsafe
On 2012/11/13 23:32:05, Ryan Sleevi wrote: > > > In the original code, if a ...
8 years, 1 month ago (2012-11-14 02:15:28 UTC) #16
unsafe
Regarding unknown hash algos: I just changed HPKP header parsing to skip them, but left ...
8 years, 1 month ago (2012-11-14 06:41:34 UTC) #17
palmer
> My assumption - for both this and unknown-hash-algs - is that a "bad"/incomplete > ...
8 years, 1 month ago (2012-11-14 21:01:20 UTC) #18
palmer
> Regarding unknown hash algos: I just changed HPKP header parsing to skip them, > ...
8 years, 1 month ago (2012-11-14 21:03:04 UTC) #19
unsafe
On 2012/11/14 21:03:04, Chris P. wrote: > > To summarize: this CL changes HPKP header ...
8 years, 1 month ago (2012-11-14 21:56:35 UTC) #20
Chris Palmer
On Wed, Nov 14, 2012 at 1:56 PM, <unsafe@trevp.net> wrote: > So, this CL changes ...
8 years, 1 month ago (2012-11-16 00:30:35 UTC) #21
unsafe
On 2012/11/16 00:30:35, Chris Palmer wrote: > > That sounds good, thanks! Cool, let me ...
8 years ago (2012-11-28 00:58:10 UTC) #22
palmer
Some nits, but that's it. I think we are getting close; what do rsleevi and ...
8 years ago (2012-12-06 21:20:17 UTC) #23
unsafe
Addressed Chris's nits, I believe. https://codereview.chromium.org/11274032/diff/43010/chrome/browser/ui/webui/net_internals/net_internals_ui.cc File chrome/browser/ui/webui/net_internals/net_internals_ui.cc (right): https://codereview.chromium.org/11274032/diff/43010/chrome/browser/ui/webui/net_internals/net_internals_ui.cc#newcode1103 chrome/browser/ui/webui/net_internals/net_internals_ui.cc:1103: std::string HashesToBase64String(const net::HashValueVector& hashes) ...
8 years ago (2012-12-07 09:58:26 UTC) #24
palmer
> Here's my case for changing it to binary: > > On a connection, any ...
8 years ago (2012-12-07 20:54:06 UTC) #25
agl
Thoughts will be delayed until Monday I'm afraid. Too much happening.
8 years ago (2012-12-07 20:56:38 UTC) #26
Ryan Sleevi
Sorry for the delays. I first focused on the correctness of the code in terms ...
8 years ago (2012-12-07 23:37:21 UTC) #27
unsafe
https://codereview.chromium.org/11274032/diff/50001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc File chrome/browser/ui/webui/net_internals/net_internals_ui.cc (right): https://codereview.chromium.org/11274032/diff/50001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc#newcode1165 chrome/browser/ui/webui/net_internals/net_internals_ui.cc:1165: result->SetString("static_spki_hashes", hashes_str); On 2012/12/07 23:37:21, Ryan Sleevi wrote: > ...
8 years ago (2012-12-08 09:22:42 UTC) #28
agl
https://codereview.chromium.org/11274032/diff/61001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc File chrome/browser/ui/webui/net_internals/net_internals_ui.cc (right): https://codereview.chromium.org/11274032/diff/61001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc#newcode130 chrome/browser/ui/webui/net_internals/net_internals_ui.cc:130: if (hash_str.substr(0, 4) != "sha1" && hash_str.substr(0, 6) != ...
8 years ago (2012-12-10 17:13:44 UTC) #29
unsafe
I'll send out Go diff separately; removed the extra file-ending LF from new files, but ...
8 years ago (2012-12-10 20:59:18 UTC) #30
agl
On Mon, Dec 10, 2012 at 3:59 PM, <unsafe@trevp.net> wrote: > I'll send out Go ...
8 years ago (2012-12-10 21:00:52 UTC) #31
unsafe
Diff for transport_security_state_static_generate.go: func writeCertsOutput(out *bufio.Writer, pins []pin) { out.WriteString(`// These are SubjectPublicKeyInfo hashes for ...
8 years ago (2012-12-10 21:06:18 UTC) #32
unsafe
On 2012/12/10 21:06:18, unsafe wrote: > Diff for transport_security_state_static_generate.go: Oops, copy/paste error, this is correct: ...
8 years ago (2012-12-10 21:09:22 UTC) #33
agl
go change LGTM. (Note, that code lives here now: https://github.com/agl/transport-security-state-generate) Cheers AGL
8 years ago (2012-12-10 21:11:00 UTC) #34
unsafe
I updated the CL description to a better synopsis. Also, made one last fix: On ...
8 years ago (2012-12-18 23:12:36 UTC) #35
Ryan Sleevi
Sorry for the delays! I have a few nits, mostly around the comments then the ...
8 years ago (2012-12-20 23:44:13 UTC) #36
unsafe
https://codereview.chromium.org/11274032/diff/80001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc File chrome/browser/ui/webui/net_internals/net_internals_ui.cc (right): https://codereview.chromium.org/11274032/diff/80001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc#newcode131 chrome/browser/ui/webui/net_internals/net_internals_ui.cc:131: if (hash_str.empty()) /* pair of commas with no content ...
8 years ago (2012-12-21 02:56:49 UTC) #37
Ryan Sleevi
Still a few nits, but we're in the home stretch. Note the comments about the ...
8 years ago (2012-12-22 00:56:29 UTC) #38
unsafe
https://codereview.chromium.org/11274032/diff/82003/chrome/browser/ui/webui/net_internals/net_internals_ui.cc File chrome/browser/ui/webui/net_internals/net_internals_ui.cc (right): https://codereview.chromium.org/11274032/diff/82003/chrome/browser/ui/webui/net_internals/net_internals_ui.cc#newcode134 chrome/browser/ui/webui/net_internals/net_internals_ui.cc:134: hash_str.compare(0, 7, "sha256/") != 0) On 2012/12/22 00:56:30, Ryan ...
8 years ago (2012-12-22 05:49:43 UTC) #39
Ryan Sleevi
Oof. I feel your pain for long reviews - especially after I had vowed not ...
7 years, 11 months ago (2013-01-03 01:11:32 UTC) #40
unsafe
On 2013/01/03 01:11:32, Ryan Sleevi wrote: > I've submitted tryjobs based on Patch Set 24 ...
7 years, 11 months ago (2013-01-04 09:09:36 UTC) #41
unsafe
https://codereview.chromium.org/11274032/diff/97001/net/http/http_security_headers.cc File net/http/http_security_headers.cc (right): https://codereview.chromium.org/11274032/diff/97001/net/http/http_security_headers.cc#newcode23 net/http/http_security_headers.cc:23: // is returned on any parse error. On 2013/01/03 ...
7 years, 11 months ago (2013-01-04 09:09:54 UTC) #42
Ryan Sleevi
https://codereview.chromium.org/11274032/diff/121001/net/http/http_security_headers_unittest.cc File net/http/http_security_headers_unittest.cc (right): https://codereview.chromium.org/11274032/diff/121001/net/http/http_security_headers_unittest.cc#newcode290 net/http/http_security_headers_unittest.cc:290: std::min(kMaxHSTSAgeSecs, (int64)GG_INT64_C(39408299))); NACK: We don't use C-style casts It ...
7 years, 11 months ago (2013-01-04 19:46:37 UTC) #43
unsafe
Fix for try failures, hopefully (flying bind, I can't reproduce and don't really understand issue...) ...
7 years, 11 months ago (2013-01-04 21:55:18 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/unsafe@trevp.net/11274032/136001
7 years, 11 months ago (2013-01-07 23:51:10 UTC) #45
commit-bot: I haz the power
Presubmit check for 11274032-136001 failed and returned exit status 1. Running presubmit commit checks ...
7 years, 11 months ago (2013-01-07 23:51:19 UTC) #46
Ryan Sleevi
Missed that the long lines need wrapping. Luckily C strings can be continued without special ...
7 years, 11 months ago (2013-01-07 23:55:59 UTC) #47
eroman
LGTM for net_internals/* https://chromiumcodereview.appspot.com/11274032/diff/136001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc File chrome/browser/ui/webui/net_internals/net_internals_ui.cc (right): https://chromiumcodereview.appspot.com/11274032/diff/136001/chrome/browser/ui/webui/net_internals/net_internals_ui.cc#newcode137 chrome/browser/ui/webui/net_internals/net_internals_ui.cc:137: if (hash_str.compare(0, 5, "sha1/") != 0 ...
7 years, 11 months ago (2013-01-08 00:18:09 UTC) #48
unsafe
On 2013/01/07 23:55:59, Ryan Sleevi wrote: > Missed that the long lines need wrapping. Luckily ...
7 years, 11 months ago (2013-01-08 01:58:41 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/unsafe@trevp.net/11274032/134003
7 years, 11 months ago (2013-01-08 02:02:57 UTC) #50
commit-bot: I haz the power
Presubmit check for 11274032-134003 failed and returned exit status 1. Running presubmit commit checks ...
7 years, 11 months ago (2013-01-08 02:03:06 UTC) #51
unsafe
On 2013/01/08 02:03:06, I haz the power (commit-bot) wrote: > mailto:unsafe@trevp.net is not in AUTHORS ...
7 years, 11 months ago (2013-01-08 05:17:26 UTC) #52
Ryan Sleevi
Editing the CL description to be clearer Original description as follows: This is the first ...
7 years, 11 months ago (2013-01-08 05:30:34 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/unsafe@trevp.net/11274032/147002
7 years, 11 months ago (2013-01-08 05:35:55 UTC) #54
commit-bot: I haz the power
Failed to apply patch for AUTHORS: While running patch -p0 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 11 months ago (2013-01-08 05:36:00 UTC) #55
Ryan Sleevi
On 2013/01/08 05:36:00, I haz the power (commit-bot) wrote: > Failed to apply patch for ...
7 years, 11 months ago (2013-01-08 05:41:33 UTC) #56
unsafe
On 2013/01/08 05:41:33, Ryan Sleevi wrote: > > +Trevor Perrin <mailto:unsafe@trevp.net> > > Heh, you ...
7 years, 11 months ago (2013-01-08 05:56:47 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/unsafe@trevp.net/11274032/133003
7 years, 11 months ago (2013-01-08 05:59:53 UTC) #58
commit-bot: I haz the power
Retried try job too often on win_aura for step(s) content_browsertests
7 years, 11 months ago (2013-01-08 09:34:23 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/unsafe@trevp.net/11274032/133003
7 years, 11 months ago (2013-01-08 19:50:21 UTC) #60
commit-bot: I haz the power
7 years, 11 months ago (2013-01-08 22:07:35 UTC) #61
Message was sent while issue was closed.
Change committed as 175595

Powered by Google App Engine
This is Rietveld 408576698