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

Issue 826423009: Treat HSTS and HPKP state independently. (Closed)

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

Description

Treat HSTS and HPKP state independently. Although we have historically, and in static preloads, treated HSTS and HPKP as part of the same underlying mechanism, the new headers consider them completely orthogonal. Our current implementation has bugs where, particular where includeSubdomains is involved, HPKP and HSTS entries get mixed together. This CL does the following: - Include separate domain strings for HPKP and HSTS in the output of GetDynamicDomainState. This allows net-internals to report on the two separately. - Switch tests to query TransportSecurityState's public API rather than manipulate DomainState directly, to reduce dependency on it. - Make AddHSTSHeader, AddHSTS, etc., follow the same codepath. Notably the header variants called GetDynamicDomainState to get the template which means an includeSubdomains HPKP state on a parent domain would get copied over. - AddHPKPHeader no longer appends the old pins to the new set. - Make DeleteAllDynamicDataSince clear STS and PKP state independently. Notably, the old version would almost never drop DomainState entries because pkp.last_observed would be uninitialized and never pass the check. - Make GetDynamicDomainState stitch together the appropriate STS and PKP results to form its output DomainState. This avoids includeSubdomains and expiration from one mechanism interacting with that of another. - Add tests for all this. We should remove DomainState altogether and leave PKPState and STSState as separate entities (with some consideration for how they were historically stored on disk), but this CL leaves that alone for now. BUG=444511 Committed: https://crrev.com/ffd3a3bf5a45013052f6ae319983a7a249f4db38 Cr-Commit-Position: refs/heads/master@{#311734}

Patch Set 1 #

Patch Set 2 : Add another test and simplify some code. #

Patch Set 3 : test header parsing too #

Total comments: 22

Patch Set 4 : rsleevi comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+438 lines, -192 lines) Patch
M chrome/browser/resources/net_internals/hsts_view.js View 1 chunk +8 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/net_internals/net_internals_ui.cc View 2 chunks +4 lines, -7 lines 0 comments Download
M chrome/test/data/webui/net_internals/hsts_view.js View 4 chunks +10 lines, -6 lines 0 comments Download
M net/http/http_security_headers.cc View 1 2 3 1 chunk +1 line, -15 lines 0 comments Download
M net/http/http_security_headers_unittest.cc View 1 2 3 4 chunks +41 lines, -5 lines 0 comments Download
M net/http/transport_security_state.h View 1 2 3 9 chunks +47 lines, -23 lines 0 comments Download
M net/http/transport_security_state.cc View 13 chunks +123 lines, -85 lines 0 comments Download
M net/http/transport_security_state_unittest.cc View 1 2 3 4 chunks +204 lines, -46 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
davidben
Here's an initial pass at this. There's probably many more tests to be added and ...
5 years, 11 months ago (2015-01-13 01:15:22 UTC) #2
davidben
Updated to add a test for a case I hadn't considered (but accidentally fixed anyway). ...
5 years, 11 months ago (2015-01-13 18:19:32 UTC) #3
Ryan Sleevi
Wow, huge props for cleanup. A few comments below, mostly LG [Note, if you do ...
5 years, 11 months ago (2015-01-13 21:56:41 UTC) #4
davidben
https://codereview.chromium.org/826423009/diff/40001/net/http/http_security_headers.cc File net/http/http_security_headers.cc (right): https://codereview.chromium.org/826423009/diff/40001/net/http/http_security_headers.cc#newcode288 net/http/http_security_headers.cc:288: hashes->clear(); On 2015/01/13 21:56:40, Ryan Sleevi wrote: > BUG: ...
5 years, 11 months ago (2015-01-13 23:30:48 UTC) #5
Ryan Sleevi
LGTM. Adding Matt for the net-internals review.
5 years, 11 months ago (2015-01-15 01:20:26 UTC) #7
mmenke
net-internals cc and js files LGTM (Largely deferring to Sleevi)
5 years, 11 months ago (2015-01-15 15:32:20 UTC) #8
palmer
LGTM. Thank you!
5 years, 11 months ago (2015-01-15 19:24:53 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/826423009/60001
5 years, 11 months ago (2015-01-15 20:45:46 UTC) #11
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 11 months ago (2015-01-15 21:05:14 UTC) #12
commit-bot: I haz the power
5 years, 11 months ago (2015-01-15 21:06:59 UTC) #13
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/ffd3a3bf5a45013052f6ae319983a7a249f4db38
Cr-Commit-Position: refs/heads/master@{#311734}

Powered by Google App Engine
This is Rietveld 408576698