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

Issue 92443002: Extract Certificate Transparency SCTs from stapled OCSP responses (Closed)

Created:
7 years ago by ekasper
Modified:
7 years ago
Reviewers:
Yoyo Zhou, wtc, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@extract_scts
Visibility:
Public.

Description

Extract Certificate Transparency SCTs from stapled OCSP responses BUG=309578 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=240721

Patch Set 1 #

Patch Set 2 : rebase and wire extracted SCTs to the CT verifier #

Total comments: 30

Patch Set 3 : review comments #

Total comments: 47

Patch Set 4 : redo ASN.1 #

Patch Set 5 : format #

Total comments: 12

Patch Set 6 : comments #

Patch Set 7 : fix win build #

Patch Set 8 : clean up subs #

Total comments: 27

Patch Set 9 : review comments #

Total comments: 40

Patch Set 10 : more review comments #

Total comments: 2

Patch Set 11 : fix unit test #

Patch Set 12 : rebase #

Total comments: 18

Patch Set 13 : rsleevi's comments #

Patch Set 14 : rebase #

Patch Set 15 : formatting nit #

Patch Set 16 : add missing init #

Patch Set 17 : indent #

Patch Set 18 : rebase #

Total comments: 1

Patch Set 19 : fix template bug #

Patch Set 20 : few more comments #

Total comments: 8

Patch Set 21 : fix format errors #

Total comments: 2

Patch Set 22 : Fix C++11 compile error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1012 lines, -108 lines) Patch
M net/cert/ct_objects_extractor.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +12 lines, -0 lines 0 comments Download
M net/cert/ct_objects_extractor_nss.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 chunks +351 lines, -8 lines 0 comments Download
M net/cert/ct_objects_extractor_openssl.cc View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M net/cert/ct_objects_extractor_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +53 lines, -0 lines 0 comments Download
M net/cert/ct_verifier.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +11 lines, -5 lines 0 comments Download
M net/cert/multi_log_ct_verifier.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/cert/multi_log_ct_verifier.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +11 lines, -3 lines 0 comments Download
M net/cert/multi_log_ct_verifier_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +6 lines, -3 lines 0 comments Download
M net/socket/ssl_client_socket.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +14 lines, -6 lines 0 comments Download
M net/socket/ssl_client_socket.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -5 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 14 15 16 17 18 19 10 chunks +64 lines, -47 lines 0 comments Download
M net/socket/ssl_client_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +67 lines, -8 lines 0 comments Download
M net/test/ct_test_util.h View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M net/test/ct_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +69 lines, -0 lines 0 comments Download
M net/test/spawned_test_server/base_test_server.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +6 lines, -3 lines 0 comments Download
M net/test/spawned_test_server/base_test_server.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +11 lines, -6 lines 0 comments Download
M net/tools/testserver/testserver.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 6 chunks +20 lines, -6 lines 0 comments Download
M third_party/tlslite/README.chromium View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
A third_party/tlslite/patches/status_request.patch View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +208 lines, -0 lines 0 comments Download
M third_party/tlslite/tlslite/TLSConnection.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +22 lines, -7 lines 0 comments Download
M third_party/tlslite/tlslite/constants.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/tlslite/tlslite/messages.py View 6 chunks +53 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
ekasper
The bad news is that this patch is a little more invasive than I'd hoped ...
7 years ago (2013-11-27 19:49:36 UTC) #1
wtc
Emilia: we need to use rsleevi's chromium.org email address for Chromium code reviews. I may ...
7 years ago (2013-11-27 20:02:47 UTC) #2
ekasper
Whoops, thanks for noticing the reviewer mix-up. I know it's a short week in the ...
7 years ago (2013-11-27 20:32:22 UTC) #3
ekasper
In case you'd already started looking at this CL, please note that I've now also ...
7 years ago (2013-12-02 11:50:14 UTC) #4
wtc
Review comments on patch set 2: The CL seems good, but I did a rather ...
7 years ago (2013-12-03 01:18:06 UTC) #5
ekasper
https://codereview.chromium.org/92443002/diff/20001/net/cert/asn1_util.cc File net/cert/asn1_util.cc (right): https://codereview.chromium.org/92443002/diff/20001/net/cert/asn1_util.cc#newcode353 net/cert/asn1_util.cc:353: return false; On 2013/12/03 01:18:06, wtc wrote: > > ...
7 years ago (2013-12-03 13:50:51 UTC) #6
Ryan Sleevi
Emilia, apologies for the delays in getting to this. We should not be rolling our ...
7 years ago (2013-12-03 21:03:18 UTC) #7
wtc
Patch set 3 LGTM. I ran out of steam when I got to tlslite/messages.py, so ...
7 years ago (2013-12-03 21:04:25 UTC) #8
Ryan Sleevi
https://codereview.chromium.org/92443002/diff/40001/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/92443002/diff/40001/net/socket/ssl_client_socket_nss.cc#newcode2436 net/socket/ssl_client_socket_nss.cc:2436: if (nss_handshake_state_.server_cert) { On 2013/12/03 21:04:25, wtc wrote: > ...
7 years ago (2013-12-03 21:07:15 UTC) #9
ekasper
Ryan, Wan-Teh, It's late here so I'll only get to addressing your comments tomorrow but ...
7 years ago (2013-12-03 22:13:25 UTC) #10
Ryan Sleevi
On Tue, Dec 3, 2013 at 2:13 PM, <ekasper@google.com> wrote: > Ryan, Wan-Teh, > > ...
7 years ago (2013-12-03 22:18:30 UTC) #11
ekasper
Ryan, thanks a lot for offering help! I've attempted it myself, I would appreciate a ...
7 years ago (2013-12-04 19:25:14 UTC) #12
Ryan Sleevi
I just focused on the NSS ASN.1 code. It matches what's in NSS (Wan-Teh, they ...
7 years ago (2013-12-04 20:30:25 UTC) #13
ekasper
PTAL I'm still trying to figure out how to get the ASN.1 templates to link ...
7 years ago (2013-12-05 16:26:48 UTC) #14
ekasper
Aha, I think the culprit is missing defs for NSS_Get_CERT_SequenceOfCertExtensionTemplate NSS_Get_SEC_GeneralizedTimeTemplate_Util NSS_Get_SEC_IntegerTemplate_Util NSS_Get_SEC_OctetStringTemplate_Util in http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/nss/nss/exports_win.def?view=log ...
7 years ago (2013-12-05 18:12:53 UTC) #15
wtc
On 2013/12/05 18:12:53, ekasper wrote: > Aha, I think the culprit is missing defs for ...
7 years ago (2013-12-07 02:37:14 UTC) #16
wtc
Review comments on patch set 8: I only reviewed ct_objects_extractor.h and ct_objects_extractor_nss.cc. https://codereview.chromium.org/92443002/diff/140001/net/cert/ct_objects_extractor.h File net/cert/ct_objects_extractor.h ...
7 years ago (2013-12-08 04:52:44 UTC) #17
ekasper
https://codereview.chromium.org/92443002/diff/140001/net/cert/ct_objects_extractor.h File net/cert/ct_objects_extractor.h (right): https://codereview.chromium.org/92443002/diff/140001/net/cert/ct_objects_extractor.h#newcode51 net/cert/ct_objects_extractor.h:51: // and issuer, returns true, updating |*sct_list| to contain ...
7 years ago (2013-12-09 14:17:05 UTC) #18
wtc
Patch set 9 LGTM. 1. Let's wrap this CL up and save bigger changes for ...
7 years ago (2013-12-10 04:23:16 UTC) #19
wtc
https://codereview.chromium.org/92443002/diff/180001/net/cert/ct_objects_extractor_unittest.cc File net/cert/ct_objects_extractor_unittest.cc (right): https://codereview.chromium.org/92443002/diff/180001/net/cert/ct_objects_extractor_unittest.cc#newcode163 net/cert/ct_objects_extractor_unittest.cc:163: issuer_cert->os_cert_handle(), subject_cert->serial_number(), You cannot use subject_cert->serial_number() in this test ...
7 years ago (2013-12-10 14:32:42 UTC) #20
ekasper
wtc, I think I've either addressed or documented all your comments. Should I wait for ...
7 years ago (2013-12-10 14:45:19 UTC) #21
wtc
Patch set 11 LGTM. Don't wait for Ryan's review. You addressed his objection to rolling ...
7 years ago (2013-12-10 15:59:18 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ekasper@google.com/92443002/200001
7 years ago (2013-12-10 17:04:24 UTC) #23
commit-bot: I haz the power
Failed to apply patch for net/test/spawned_test_server/base_test_server.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years ago (2013-12-10 17:04:34 UTC) #24
ekasper
FYI this looks bad but was just a rebase race - the return type of ...
7 years ago (2013-12-10 17:36:46 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ekasper@google.com/92443002/220001
7 years ago (2013-12-10 17:37:47 UTC) #26
Ryan Sleevi
LGTM - Wan-Teh has naturally covered in far greater detail. I just have one nit ...
7 years ago (2013-12-10 21:06:08 UTC) #27
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) net_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=233948
7 years ago (2013-12-10 21:27:54 UTC) #28
Ryan Sleevi
A few more nits I missed from wtc's review. https://codereview.chromium.org/92443002/diff/220001/net/cert/ct_objects_extractor.h File net/cert/ct_objects_extractor.h (right): https://codereview.chromium.org/92443002/diff/220001/net/cert/ct_objects_extractor.h#newcode57 net/cert/ct_objects_extractor.h:57: ...
7 years ago (2013-12-11 07:33:04 UTC) #29
ekasper
PTAL I've addressed Ryan's comments. However, OCSP object extraction fails on Win (i.e., the compile ...
7 years ago (2013-12-11 15:40:50 UTC) #30
wtc
Emilia, I responded to your comments below. I'll let Ryan review your new patch sets. ...
7 years ago (2013-12-12 02:31:44 UTC) #31
wtc
Emilia: I struggled a whole day to check out a Chromium tree successfully on Windows. ...
7 years ago (2013-12-13 03:32:50 UTC) #32
ekasper
https://codereview.chromium.org/92443002/diff/160001/net/cert/ct_objects_extractor_nss.cc File net/cert/ct_objects_extractor_nss.cc (right): https://codereview.chromium.org/92443002/diff/160001/net/cert/ct_objects_extractor_nss.cc#newcode315 net/cert/ct_objects_extractor_nss.cc:315: SECItem next_update; On 2013/12/12 02:31:45, wtc wrote: > > ...
7 years ago (2013-12-13 13:09:51 UTC) #33
ekasper
Wow, thanks so much! That was it. I was about to get a Win box ...
7 years ago (2013-12-13 13:14:36 UTC) #34
wtc
Patch set 20 LGTM. https://codereview.chromium.org/92443002/diff/380001/net/socket/ssl_client_socket.h File net/socket/ssl_client_socket.h (right): https://codereview.chromium.org/92443002/diff/380001/net/socket/ssl_client_socket.h#newcode164 net/socket/ssl_client_socket.h:164: ConnectSignedCertTimestampsDisabled); Nit: add a blank ...
7 years ago (2013-12-13 16:15:49 UTC) #35
ekasper
https://codereview.chromium.org/92443002/diff/380001/net/socket/ssl_client_socket.h File net/socket/ssl_client_socket.h (right): https://codereview.chromium.org/92443002/diff/380001/net/socket/ssl_client_socket.h#newcode164 net/socket/ssl_client_socket.h:164: ConnectSignedCertTimestampsDisabled); On 2013/12/13 16:15:50, wtc wrote: > > Nit: ...
7 years ago (2013-12-13 17:26:10 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ekasper@google.com/92443002/400001
7 years ago (2013-12-13 17:27:35 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ekasper@google.com/92443002/400001
7 years ago (2013-12-13 19:22:19 UTC) #38
commit-bot: I haz the power
Change committed as 240721
7 years ago (2013-12-13 19:57:53 UTC) #39
szym
On 2013/12/13 19:57:53, I haz the power (commit-bot) wrote: > Change committed as 240721 Does ...
7 years ago (2013-12-13 20:21:27 UTC) #40
szym
A revert of this CL has been created in https://codereview.chromium.org/108113006/ by szym@chromium.org. The reason for ...
7 years ago (2013-12-13 20:22:31 UTC) #41
Yoyo Zhou
This change broke the ChromiumOS (amd64) compile: http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28amd64%29/builds/12952/steps/BuildPackages/logs/stdio The error is: chromeos-chrome-33.0.1738.0_alpha-r1: net/cert/ct_objects_extractor_nss.cc: In function ...
7 years ago (2013-12-13 20:23:06 UTC) #42
wtc
https://codereview.chromium.org/92443002/diff/400001/net/cert/ct_objects_extractor_nss.cc File net/cert/ct_objects_extractor_nss.cc (right): https://codereview.chromium.org/92443002/diff/400001/net/cert/ct_objects_extractor_nss.cc#newcode528 net/cert/ct_objects_extractor_nss.cc:528: ocsp_response.data())), ocsp_response.size() }; Emilia: you can add a static_cast<unsigned ...
7 years ago (2013-12-15 05:31:13 UTC) #43
ekasper
7 years ago (2013-12-16 12:35:41 UTC) #44
Message was sent while issue was closed.
The compile error should be fixed. Sorry about that!

Is there a way to reopen this issue for try & commit, or should I create a
clone?

https://codereview.chromium.org/92443002/diff/400001/net/cert/ct_objects_extr...
File net/cert/ct_objects_extractor_nss.cc (right):

https://codereview.chromium.org/92443002/diff/400001/net/cert/ct_objects_extr...
net/cert/ct_objects_extractor_nss.cc:528: ocsp_response.data())),
ocsp_response.size() };
On 2013/12/15 05:31:14, wtc wrote:
> 
> Emilia: you can add a static_cast<unsigned int> to ocsp_response.size(). If we
> want to be extra careful, we can add a check also:
> 
>   // A stapled OCSP response cannot overflow the 3-byte length. 
>   if (ocsp_response.size() > 0xffffff)  // we can use a smaller max size.
>     return false;

We know that we're safe given the source of those responses is NSS - but it
doesn't cost anything to be correct so I've done it.

> Note also that Chromium's base/safe_numerics.h has
base::checked_numeric_cast<>.

Ah, good to know. But this CHECKs so doesn't seem right for untrusted inputs.

Powered by Google App Engine
This is Rietveld 408576698