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

Issue 18836: Work around our not caching the intermediate CA... (Closed)

Created:
11 years, 11 months ago by wtc
Modified:
9 years, 7 months ago
Reviewers:
eroman
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Work around our not caching the intermediate CA certificates by passing the source of each OSCertHandle to CreateFromHandle and the X509Certificate constructor. If the OSCertHandle comes from the network layer, we know it has a complete certificate chain and therefore prefer it to an OSCertHandle that comes from the HTTP cache, which doesn't have the intermediate CA certificates. A certificate from the network layer can kick out a certificate from the HTTP cache in our certificate cache. This workaround seems good enough to fix all the known symptoms of not caching the intermediate CA certificates. Move the common code in x509_certificate_<os>.cc to x509_certificate.cc. R=eroman BUG=3154, 7065 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=8864

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 5

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 6

Patch Set 7 : '' #

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+301 lines, -256 lines) Patch
M net/base/ssl_client_socket_mac.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M net/base/ssl_client_socket_win.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M net/base/x509_certificate.h View 1 2 3 4 5 6 chunks +37 lines, -4 lines 0 comments Download
M net/base/x509_certificate.cc View 1 2 3 4 5 2 chunks +62 lines, -0 lines 0 comments Download
M net/base/x509_certificate_mac.cc View 1 2 3 6 chunks +42 lines, -79 lines 0 comments Download
M net/base/x509_certificate_nss.cc View 1 2 3 4 5 6 6 chunks +38 lines, -70 lines 0 comments Download
M net/base/x509_certificate_unittest.cc View 4 5 6 14 chunks +77 lines, -26 lines 0 comments Download
M net/base/x509_certificate_win.cc View 1 2 3 4 5 7 chunks +39 lines, -75 lines 0 comments Download
M net/http/http_cache.cc View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
wtc
I will add a unit test, but please start reviewing the CL now and ask ...
11 years, 11 months ago (2009-01-27 02:16:14 UTC) #1
eroman
lgtm once unit tested. http://codereview.chromium.org/18836/diff/204/206 File net/base/x509_certificate.cc (right): http://codereview.chromium.org/18836/diff/204/206#newcode133 Line 133: X509Certificate* cert = cache->Find(CalculateFingerprint(cert_handle)); ...
11 years, 11 months ago (2009-01-27 04:35:37 UTC) #2
wtc
Thanks for the review. I addressed all of your review comments in Patch Set 3. ...
11 years, 11 months ago (2009-01-28 02:51:47 UTC) #3
eroman
looks good
11 years, 11 months ago (2009-01-28 03:20:44 UTC) #4
wtc
I added a unit test in x509_certificate_unittest.cc. Please review the new Patch Set. The unit ...
11 years, 11 months ago (2009-01-28 22:17:26 UTC) #5
wtc
Do you think the Source enum constants would look nicer if they all begin with ...
11 years, 10 months ago (2009-01-28 22:37:31 UTC) #6
eroman
> Do you think the Source enum constants would look nicer > if they all ...
11 years, 10 months ago (2009-01-28 22:42:34 UTC) #7
wtc
OK, please review the new Patch Set which has the renamed Source enum constants.
11 years, 10 months ago (2009-01-28 23:07:40 UTC) #8
eroman
unit test looks good. http://codereview.chromium.org/18836/diff/419/631 File net/base/x509_certificate.h (right): http://codereview.chromium.org/18836/diff/419/631#newcode191 Line 191: friend class base::RefCountedThreadSafe<X509Certificate>; why ...
11 years, 10 months ago (2009-01-28 23:20:05 UTC) #9
wtc
11 years, 10 months ago (2009-01-28 23:39:17 UTC) #10
http://codereview.chromium.org/18836/diff/419/631
File net/base/x509_certificate.h (right):

http://codereview.chromium.org/18836/diff/419/631#newcode191
Line 191: friend class base::RefCountedThreadSafe<X509Certificate>;
The line
  friend class base::RefCountedThreadSafe<X509Certificate>;
is pre-existing.  I merely moved it up to follow the order
of declaration in the Style Guide.  It used to be right
above the destructor at line 205, so I guess we need it so
that the RefCountedThreadSafe template can invoke the
private destructor.

http://codereview.chromium.org/18836/diff/419/631#newcode230
Line 230: // Returns NULL on failure.
Yes, OSCertHandle is a pointer type on all platforms.

Want me to add a comment to explicitly state this assumption?

http://codereview.chromium.org/18836/diff/419/630
File net/base/x509_certificate_nss.cc (right):

http://codereview.chromium.org/18836/diff/419/630#newcode208
Line 208: der_cert.data = reinterpret_cast<unsigned char *>(const_cast<char
*>(data));
On 2009/01/28 23:20:05, eroman wrote:
> style nit: I think the * should be flush against "char".

Fixed in the new Patch Set.

Powered by Google App Engine
This is Rietveld 408576698