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

Unified Diff: chrome/browser/ssl/ssl_policy.cc

Issue 43115: Change the bad-certificate handler for SSL (using NSS) to return an... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/client_socket.h » ('j') | net/base/ssl_config_service.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_policy.cc
===================================================================
--- chrome/browser/ssl/ssl_policy.cc (revision 12708)
+++ chrome/browser/ssl/ssl_policy.cc (working copy)
@@ -318,9 +318,13 @@
void SSLPolicy::OnDenyCertificate(SSLManager::CertError* error) {
// Default behavior for rejecting a certificate.
- error->CancelRequest();
+ //
+ // While DenyCertForHost() executes synchronously on this thread,
+ // CancelRequest() gets posted to a different thread. Calling
+ // DenyCertForHost() first ensures deterministic ordering.
error->manager()->DenyCertForHost(error->ssl_info().cert,
error->request_url().host());
+ error->CancelRequest();
}
void SSLPolicy::OnAllowCertificate(SSLManager::CertError* error) {
@@ -330,9 +334,13 @@
// new NavigationEntry will not be set until DidNavigate. This is ok,
// because the new NavigationEntry will have its max security style set
// within DidNavigate.
- error->ContinueRequest();
+ //
+ // While AllowCertForHost() executes synchronously on this thread,
+ // ContinueRequest() gets posted to a different thread. Calling
+ // AllowCertForHost() first ensures deterministic ordering.
error->manager()->AllowCertForHost(error->ssl_info().cert,
error->request_url().host());
+ error->ContinueRequest();
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | net/base/client_socket.h » ('j') | net/base/ssl_config_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698