Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Issue 6835033: net: implement the beginnings of HSTS pinning (Closed)

Created:
9 years, 8 months ago by agl
Modified:
9 years, 7 months ago
Reviewers:
cevans, Chris Evans
CC:
chromium-reviews
Visibility:
Public.

Description

net: implement the beginnings of HSTS pinning (Based on a patch by Chris Evans.) Doesn't yet actually get the information from the HSTS header, but all the infrastructure is in place. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=81584

Patch Set 1 #

Total comments: 20
Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -7 lines) Patch
M chrome/browser/resources/net_internals/hstsview.js View 3 chunks +11 lines, -2 lines 0 comments Download
M chrome/browser/resources/net_internals/index.html View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/resources/net_internals/main.js View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/net_internals_ui.cc View 7 chunks +43 lines, -1 line 4 comments Download
M net/base/transport_security_state.h View 2 chunks +10 lines, -0 lines 0 comments Download
M net/base/transport_security_state.cc View 6 chunks +57 lines, -1 line 8 comments Download
M net/base/transport_security_state_unittest.cc View 1 chunk +33 lines, -0 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 1 chunk +15 lines, -0 lines 8 comments Download

Messages

Total messages: 6 (0 generated)
agl
There are three places where the format of the pins appears: 1) Our JSON database ...
9 years, 8 months ago (2011-04-13 20:26:08 UTC) #1
Chris Evans
Thx! Mostly nits... http://codereview.chromium.org/6835033/diff/1/chrome/browser/ui/webui/net_internals_ui.cc File chrome/browser/ui/webui/net_internals_ui.cc (right): http://codereview.chromium.org/6835033/diff/1/chrome/browser/ui/webui/net_internals_ui.cc#newcode1077 chrome/browser/ui/webui/net_internals_ui.cc:1077: hashes_str += ","; I'd be inclined ...
9 years, 8 months ago (2011-04-13 21:26:34 UTC) #2
Chris Evans
On 2011/04/13 21:26:34, Chris Evans wrote: > Thx! Mostly nits... > > http://codereview.chromium.org/6835033/diff/1/chrome/browser/ui/webui/net_internals_ui.cc > File ...
9 years, 8 months ago (2011-04-14 00:07:11 UTC) #3
Chris Evans
One more comment and one style nit. http://codereview.chromium.org/6835033/diff/1/net/url_request/url_request_http_job.cc File net/url_request/url_request_http_job.cc (right): http://codereview.chromium.org/6835033/diff/1/net/url_request/url_request_http_job.cc#newcode659 net/url_request/url_request_http_job.cc:659: ssl_info.is_valid() && ...
9 years, 8 months ago (2011-04-14 02:31:53 UTC) #4
Chris Evans
One final thing. LGTM with the various nits and questions fixed; feel free to TODO ...
9 years, 8 months ago (2011-04-14 04:02:29 UTC) #5
agl
9 years, 8 months ago (2011-04-14 14:31:51 UTC) #6
http://codereview.chromium.org/6835033/diff/1/chrome/browser/ui/webui/net_int...
File chrome/browser/ui/webui/net_internals_ui.cc (right):

http://codereview.chromium.org/6835033/diff/1/chrome/browser/ui/webui/net_int...
chrome/browser/ui/webui/net_internals_ui.cc:1077: hashes_str += ",";
On 2011/04/13 21:26:34, Chris Evans wrote:
> I'd be inclined to use JoinString instead of doing it manually.

Done.

http://codereview.chromium.org/6835033/diff/1/chrome/browser/ui/webui/net_int...
chrome/browser/ui/webui/net_internals_ui.cc:1122: i = type_and_b64s.begin(); i
!= type_and_b64s.end(); i++) {
On 2011/04/13 21:26:34, Chris Evans wrote:
> Nit: I must admit ignorance to what the style guide says in this case of
> 80-character for loop overflow, but it reads differently to what I've seen
> elsewhere.

Really too minor to bother with, but I think that moving the "i =" clause up
looks slightly worse. I don't think the style guide says anything about this.

http://codereview.chromium.org/6835033/diff/1/net/base/transport_security_sta...
File net/base/transport_security_state.cc (right):

http://codereview.chromium.org/6835033/diff/1/net/base/transport_security_sta...
net/base/transport_security_state.cc:324: std::string
hash_str(reinterpret_cast<const char*>(j->data),
On 2011/04/13 21:26:34, Chris Evans wrote:
> I think const_cast might work in this case?

Sadly not, |data| is an unsigned char.

http://codereview.chromium.org/6835033/diff/1/net/base/transport_security_sta...
net/base/transport_security_state.cc:369: ListValue* pins_list;
On 2011/04/13 21:26:34, Chris Evans wrote:
> Optional: we don't need to, but intializing to NULL might prevent some
> hypothetical future linter from complaining.

Done.

http://codereview.chromium.org/6835033/diff/1/net/base/transport_security_sta...
net/base/transport_security_state.cc:385: }
On 2011/04/13 21:26:34, Chris Evans wrote:
> Perhaps add a TODO here, e.g. "consider whether we should drop the whole entry
> if we fail to parse a cert pin list"

Hmm. We might add hashes in the future and they would fail to parse. I guess it
only affects developers who might go forward and back in versions, although
users switch channels too. I think we're ok as is.

http://codereview.chromium.org/6835033/diff/1/net/base/transport_security_sta...
net/base/transport_security_state.cc:578: }
On 2011/04/14 04:02:30, Chris Evans wrote:
> If we get here, please LOG(ERROR) a string of the concatenation of the
incoming
> "hashes". It's really useful.

Done.

http://codereview.chromium.org/6835033/diff/1/net/url_request/url_request_htt...
File net/url_request/url_request_http_job.cc (right):

http://codereview.chromium.org/6835033/diff/1/net/url_request/url_request_htt...
net/url_request/url_request_http_job.cc:656: // Take care of any mandates for
certificate locking.
On 2011/04/13 21:26:34, Chris Evans wrote:
> Did you want to add a TODO to take care of the *.example.com connection reuse
> vs. http://foo.example.com SNI situation?

Done.

http://codereview.chromium.org/6835033/diff/1/net/url_request/url_request_htt...
net/url_request/url_request_http_job.cc:659: ssl_info.is_valid() &&
On 2011/04/14 02:31:53, Chris Evans wrote:
> Ah, did you want to check your new flag is_issued_by_known_root here?

Yep, noticed that on later review, but thanks!

http://codereview.chromium.org/6835033/diff/1/net/url_request/url_request_htt...
net/url_request/url_request_http_job.cc:665: false /* pretend that SNI isn't
available */) &&
On 2011/04/13 21:26:34, Chris Evans wrote:
> You can just use the new static method IsSNIAvailable(context_)

Done.

http://codereview.chromium.org/6835033/diff/1/net/url_request/url_request_htt...
net/url_request/url_request_http_job.cc:666:
!domain_state.IsChainOfPublicKeysPermitted(ssl_info.public_key_hashes)){
On 2011/04/14 02:31:53, Chris Evans wrote:
> Nit: missing space after )

Doesn't fit on the line otherwise :)

Powered by Google App Engine
This is Rietveld 408576698