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

Issue 10916094: Move the NSS functions out of CertDatabase into a new NSSCertDatabase class. (Closed)

Created:
8 years, 3 months ago by Joao da Silva
Modified:
8 years, 3 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, nkostylev+watch_chromium.org, darin-cc_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Move the NSS functions out of CertDatabase into a new NSSCertDatabase class. BUG=chromium-os:33872 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=155720

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Total comments: 28

Patch Set 4 : rebased #

Patch Set 5 : Addressed comments #

Total comments: 8

Patch Set 6 : rebased #

Patch Set 7 : rebased #

Patch Set 8 : Added GetInstance() getters #

Patch Set 9 : Fix non-NSS builds #

Total comments: 6

Patch Set 10 : rebased #

Patch Set 11 : Addressed comments #

Patch Set 12 : Rebased #

Patch Set 13 : Fixed uninitialized var #

Patch Set 14 : Rebased #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+502 lines, -1847 lines) Patch
M chrome/browser/certificate_manager_model.h View 1 2 3 4 5 6 7 5 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/certificate_manager_model.cc View 1 2 3 4 5 6 7 8 chunks +17 lines, -16 lines 0 comments Download
M chrome/browser/chromeos/cros/cert_library.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chromeos/cros/cert_library.cc View 1 2 3 4 5 6 7 5 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/cros/certificate_pattern.cc View 1 2 3 4 5 6 7 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/cros/network_library_unittest.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/cros/onc_network_parser.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/onc_network_parser.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +14 lines, -17 lines 0 comments Download
M chrome/browser/chromeos/cros/onc_network_parser_unittest.cc View 1 2 3 4 5 6 7 4 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/enrollment_dialog_view.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/options/vpn_config_view.cc View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ssl/ssl_add_cert_handler.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -9 lines 0 comments Download
M chrome/browser/ui/webui/options/certificate_manager_handler.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/options/certificate_manager_handler.cc View 1 2 3 4 5 6 7 10 chunks +23 lines, -22 lines 0 comments Download
M chrome/common/net/x509_certificate_model.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/common/net/x509_certificate_model_unittest.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -9 lines 0 comments Download
M net/base/cert_database.h View 1 2 3 4 5 6 7 8 4 chunks +30 lines, -150 lines 3 comments Download
M net/base/cert_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +51 lines, -29 lines 1 comment Download
M net/base/cert_database_mac.cc View 1 2 2 chunks +1 line, -4 lines 0 comments Download
M net/base/cert_database_nss.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -284 lines 0 comments Download
D net/base/cert_database_nss_unittest.cc View 1 2 3 4 1 chunk +0 lines, -935 lines 0 comments Download
M net/base/cert_database_openssl.cc View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M net/base/cert_database_win.cc View 1 2 2 chunks +1 line, -4 lines 0 comments Download
M net/base/multi_threaded_cert_verifier.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -3 lines 0 comments Download
A + net/base/nss_cert_database.h View 1 2 3 4 5 6 7 4 chunks +26 lines, -38 lines 0 comments Download
A + net/base/nss_cert_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 12 chunks +66 lines, -67 lines 0 comments Download
A + net/base/nss_cert_database_unittest.cc View 1 2 3 4 5 6 7 53 chunks +163 lines, -163 lines 0 comments Download
M net/base/ssl_client_auth_cache.h View 1 chunk +1 line, -1 line 0 comments Download
M net/base/ssl_client_auth_cache.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M net/base/ssl_client_auth_cache_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +10 lines, -4 lines 0 comments Download
M net/socket/client_socket_factory.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
M net/socket/client_socket_pool_manager_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M net/socket/client_socket_pool_manager_impl.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M net/spdy/spdy_session_pool.h View 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_session_pool.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M net/third_party/mozilla_security_manager/nsNSSCertificateDB.h View 1 2 3 4 2 chunks +8 lines, -7 lines 0 comments Download
M net/third_party/mozilla_security_manager/nsNSSCertificateDB.cpp View 10 chunks +28 lines, -27 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Joao da Silva
@rsleevi: please have a look. Early comments on cert_database.* and cert_database_nss.* welcome! Notice that the ...
8 years, 3 months ago (2012-09-04 17:00:37 UTC) #1
wtc
Review comments on patch set 3: I only reviewed two header files: cert_database.h and the ...
8 years, 3 months ago (2012-09-04 23:32:49 UTC) #2
Ryan Sleevi
http://codereview.chromium.org/10916094/diff/5004/chrome/browser/chromeos/cros/certificate_pattern.cc File chrome/browser/chromeos/cros/certificate_pattern.cc (right): http://codereview.chromium.org/10916094/diff/5004/chrome/browser/chromeos/cros/certificate_pattern.cc#newcode97 chrome/browser/chromeos/cros/certificate_pattern.cc:97: : cert_db_(cert_db) {} nit: This change seems unnecessary. Did ...
8 years, 3 months ago (2012-09-05 01:19:17 UTC) #3
Joao da Silva
Thanks for the comments! Please have another look. http://codereview.chromium.org/10916094/diff/5004/chrome/browser/chromeos/cros/certificate_pattern.cc File chrome/browser/chromeos/cros/certificate_pattern.cc (right): http://codereview.chromium.org/10916094/diff/5004/chrome/browser/chromeos/cros/certificate_pattern.cc#newcode97 chrome/browser/chromeos/cros/certificate_pattern.cc:97: : ...
8 years, 3 months ago (2012-09-05 19:37:26 UTC) #4
Ryan Sleevi
http://codereview.chromium.org/10916094/diff/5004/net/base/cert_database_nss.h File net/base/cert_database_nss.h (right): http://codereview.chromium.org/10916094/diff/5004/net/base/cert_database_nss.h#newcode160 net/base/cert_database_nss.h:160: static void AddObserver(CertDatabase::Observer* observer); On 2012/09/05 19:37:27, Joao da ...
8 years, 3 months ago (2012-09-05 21:44:17 UTC) #5
Joao da Silva
Please have another look. Thanks! http://codereview.chromium.org/10916094/diff/5004/net/base/cert_database_nss.h File net/base/cert_database_nss.h (right): http://codereview.chromium.org/10916094/diff/5004/net/base/cert_database_nss.h#newcode160 net/base/cert_database_nss.h:160: static void AddObserver(CertDatabase::Observer* observer); ...
8 years, 3 months ago (2012-09-06 15:11:41 UTC) #6
Ryan Sleevi
Mechanical changes LGTM, but there's two points needing resolution before committing and one nit. Because ...
8 years, 3 months ago (2012-09-06 17:49:16 UTC) #7
Joao da Silva
Thanks for the review! @wtc: are these changes OK for you too? @jhawkins: please do ...
8 years, 3 months ago (2012-09-07 08:58:51 UTC) #8
satorux1
chrome/browser/chromeos lgtm
8 years, 3 months ago (2012-09-07 17:03:16 UTC) #9
James Hawkins
chrome/ LGTM
8 years, 3 months ago (2012-09-09 18:57:24 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/joaodasilva@chromium.org/10916094/31
8 years, 3 months ago (2012-09-09 20:05:52 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/joaodasilva@chromium.org/10916094/7064
8 years, 3 months ago (2012-09-10 11:51:55 UTC) #12
commit-bot: I haz the power
Change committed as 155720
8 years, 3 months ago (2012-09-10 14:11:09 UTC) #13
wtc
Review comments on patch set 14: joaodasilva,rsleevi: Sorry about the late review. The CL looks ...
8 years, 3 months ago (2012-09-10 22:11:00 UTC) #14
Ryan Sleevi
8 years, 3 months ago (2012-09-10 22:23:19 UTC) #15
http://codereview.chromium.org/10916094/diff/7064/net/base/cert_database.h
File net/base/cert_database.h (right):

http://codereview.chromium.org/10916094/diff/7064/net/base/cert_database.h#ne...
net/base/cert_database.h:39: virtual void OnCertAdded(const X509Certificate*
cert) {}
On 2012/09/10 22:11:01, wtc wrote:
> 
> IMPORTANT:
> 
> A problem with broadening OnUserCertAdded to OnCertAdded is
> that an observer that is only interested in user certs (such
> as net::SSLClientAuthCache) could potentially be notified
> when an unrelated server cert or CA cert is added. I don't
> think the current code does this, but the definition of the
> Observer::OnCertAdded() method allows this.

I believe this is a good thing and the correct behaviour.

Because we determine what client cert(s) are acceptable based on the available
CAs, adding or removing a CA may affect what certificates are acceptable or not.

For example, imagine a client cert chain:
EE(A) -> B -> C

Now imagine the server, whose CertificateRequest message only lists C (for size
optimization)

Now imagine that the client only has A installed

Without B, we'd only choose the NULL cert, because no certs match C. After the
user is prompted to and installs B, they can now use A.

> 
> My preference is to avoid unnecessary notifications. I hope
> it is clear why unnecessary notifications are undesirable.
> 
> I analyzed this CL and verified that the current code calls
> NotifyObserversOfCertAdded() only when user certs are added,
> and all the observers that implement Observer::OnCertAdded
> are only interested in user certs. So it is not too late to
> change "CertAdded" back to "UserCertAdded" (and "CertRemoved"
> back to "UserCertRemoved").

I agree, we should avoid unnecessary notifications, but I think we're already at
that point.

The current "OnUserCertAdded" code really doesn't and shouldn't be watching for
individual certs being added - they should be watching to see if a (previously
selected) client cert has now changed its options.

That is, there's no need to remove the entire SSL session cache when a cert is
added/removed, we only need to remove the cached entries for which there was a
CertificateRequest that we replied to (either NULL or with a cert) that we now
have a new option to respond to.

That said, I think your proposal to restore the original names is fine until we
get to that point.

Powered by Google App Engine
This is Rietveld 408576698