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

Issue 3112013: Move chain building/verification out of X509Certificate (Closed)

Created:
10 years, 4 months ago by Ryan Sleevi
Modified:
9 years, 7 months ago
Reviewers:
bulach, wtc, davidben
CC:
chromium-reviews, pam+watch_chromium.org, John Grabowski, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Move chain building/verification out of X509Certificate This is the second part of a multi-part refactor. This moves X509Certificate::Verify() into a new namespace and static method, x509_chain::VerifySSLServer(). This has a light dependency upon http://codereview.chromium.org/2944008/show , to reduce conflicts related to moving the code.

Patch Set 1 #

Patch Set 2 : Rebase to trunk #

Patch Set 3 : Rebase to trunk - Without OpenSSL fixes #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+1692 lines, -1506 lines) Patch
M net/base/cert_verifier.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/cert_verifier.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M net/base/x509_certificate.h View 1 2 5 chunks +4 lines, -30 lines 0 comments Download
M net/base/x509_certificate_mac.cc View 1 2 3 chunks +25 lines, -378 lines 0 comments Download
M net/base/x509_certificate_nss.cc View 1 2 3 chunks +1 line, -544 lines 0 comments Download
M net/base/x509_certificate_unittest.cc View 1 2 6 chunks +13 lines, -10 lines 0 comments Download
M net/base/x509_certificate_win.cc View 1 2 4 chunks +1 line, -535 lines 0 comments Download
A net/base/x509_chain.h View 1 chunk +45 lines, -0 lines 1 comment Download
A net/base/x509_chain_mac.cc View 1 chunk +418 lines, -0 lines 0 comments Download
A net/base/x509_chain_nss.cc View 1 2 1 chunk +568 lines, -0 lines 4 comments Download
A net/base/x509_chain_win.cc View 1 1 chunk +599 lines, -0 lines 7 comments Download
M net/net.gyp View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M net/socket/ssl_client_socket_mac.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/socket/ssl_client_socket_win.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Ryan Sleevi
Overall, the remaining changes that fit into this proposed namespace/refactor: 1) General - CertVerifyResult optionally ...
10 years, 4 months ago (2010-08-16 08:50:50 UTC) #1
bulach
10 years, 2 months ago (2010-10-21 10:21:32 UTC) #2
sorry, forgot to press 'm' here.. :(

some general nits:

http://codereview.chromium.org/3112013/diff/18001/19008
File net/base/x509_chain.h (right):

http://codereview.chromium.org/3112013/diff/18001/19008#newcode25
net/base/x509_chain.h:25: // given |hostname|. against the given hostname. 
Returns OK if successful
s/against the given hostname.//

http://codereview.chromium.org/3112013/diff/18001/19010
File net/base/x509_chain_nss.cc (right):

http://codereview.chromium.org/3112013/diff/18001/19010#newcode53
net/base/x509_chain_nss.cc:53: for (CERTValOutParam *p = cvout_; p->type !=
cert_po_end; p++) {
nits:
s/CERTValOutParam */CERTValOutParam* /
s/p++/++p/

http://codereview.chromium.org/3112013/diff/18001/19010#newcode157
net/base/x509_chain_nss.cc:157: node = CERT_LIST_NEXT(node), i++) {
nit: ++i

http://codereview.chromium.org/3112013/diff/18001/19010#newcode285
net/base/x509_chain_nss.cc:285: cvin.reserve(5);
nit: not sure why 5 as there are three push_back below.. if relevant, it may be
clearer to have a 
const int kExplainWhyHere = 5; of some kind.

http://codereview.chromium.org/3112013/diff/18001/19010#newcode469
net/base/x509_chain_nss.cc:469: cvout_index++;
nit: ++cvout_index;

http://codereview.chromium.org/3112013/diff/18001/19011
File net/base/x509_chain_win.cc (right):

http://codereview.chromium.org/3112013/diff/18001/19011#newcode226
net/base/x509_chain_win.cc:226: DWORD num_wchars = rdn_attr->Value.cbData / 2;
nit: const DWORD kNumWChars

http://codereview.chromium.org/3112013/diff/18001/19011#newcode237
net/base/x509_chain_win.cc:237: DWORD num_ints = rdn_attr->Value.cbData / 4;
nit: const DWORD kNumInts

http://codereview.chromium.org/3112013/diff/18001/19011#newcode263
net/base/x509_chain_win.cc:263: int num_elements = first_chain->cElement;
nit: const kNumElements

http://codereview.chromium.org/3112013/diff/18001/19011#newcode306
net/base/x509_chain_win.cc:306: CERT_CHAIN_PARA chain_para;
can remove the memset with:

CERT_CHAIN_PARA chain_para = {0};

http://codereview.chromium.org/3112013/diff/18001/19011#newcode366
net/base/x509_chain_win.cc:366: for (int i = 0; i < num_policies; i++) {
nit: ++i

http://codereview.chromium.org/3112013/diff/18001/19011#newcode442
net/base/x509_chain_win.cc:442: memset(&chain_para, 0, sizeof(chain_para));
ditto, = {0};

http://codereview.chromium.org/3112013/diff/18001/19011#newcode469
net/base/x509_chain_win.cc:469: certificate->CreateOSCertListHandle();
there's a bunch of places that CreateOSCertListHandle and then free..
perhaps we could have a helper ScopedOSCertListHandle there?
or provide a functor for FreeOSCertListHandle and a typedef for
scoped_ptr_malloc with it?

Powered by Google App Engine
This is Rietveld 408576698