summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 14:25:09 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 14:25:09 +0000
commit8c434cbca7f80a688d546288c5497e184062be66 (patch)
treea21a10b9ad17e5169530346dd229ea38e2632cf6
parentb647ed2eaab8f34ba9ae19c6472fa5021b0913d4 (diff)
downloadchromium_src-8c434cbca7f80a688d546288c5497e184062be66.zip
chromium_src-8c434cbca7f80a688d546288c5497e184062be66.tar.gz
chromium_src-8c434cbca7f80a688d546288c5497e184062be66.tar.bz2
net: always enable NSS's HTTP fetches
By tying them to revocation checking and disabling revocation checking by default, I broke AIA chasing on Linux. This change also renames the public functions in nss_ocsp.cc to better reflect that HTTP fetching is used for more than just OCSP. BUG=117832 TEST=none (yet) Review URL: https://chromiumcodereview.appspot.com/9693004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126637 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/io_thread.cc8
-rw-r--r--content/common/net/url_fetcher_impl_unittest.cc4
-rw-r--r--net/base/net_test_suite.cc2
-rw-r--r--net/ocsp/nss_ocsp.cc8
-rw-r--r--net/ocsp/nss_ocsp.h30
-rw-r--r--net/socket/ssl_client_socket_nss.cc10
6 files changed, 31 insertions, 31 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 498a4e4..8d561bc 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -88,14 +88,14 @@ class SystemURLRequestContext : public URLRequestContextWithUserAgent {
public:
SystemURLRequestContext() {
#if defined(USE_NSS)
- net::SetURLRequestContextForOCSP(this);
+ net::SetURLRequestContextForNSSHttpIO(this);
#endif // defined(USE_NSS)
}
private:
virtual ~SystemURLRequestContext() {
#if defined(USE_NSS)
- net::SetURLRequestContextForOCSP(NULL);
+ net::SetURLRequestContextForNSSHttpIO(NULL);
#endif // defined(USE_NSS)
}
};
@@ -371,7 +371,7 @@ void IOThread::Init() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
#if defined(USE_NSS)
- net::SetMessageLoopForOCSP();
+ net::SetMessageLoopForNSSHttpIO();
#endif // defined(USE_NSS)
DCHECK(!globals_);
@@ -470,7 +470,7 @@ void IOThread::CleanUp() {
sdch_manager_ = NULL;
#if defined(USE_NSS)
- net::ShutdownOCSP();
+ net::ShutdownNSSHttpIO();
#endif // defined(USE_NSS)
system_url_request_context_getter_ = NULL;
diff --git a/content/common/net/url_fetcher_impl_unittest.cc b/content/common/net/url_fetcher_impl_unittest.cc
index 354d9c0..2ec7564 100644
--- a/content/common/net/url_fetcher_impl_unittest.cc
+++ b/content/common/net/url_fetcher_impl_unittest.cc
@@ -65,13 +65,13 @@ class URLFetcherTest : public testing::Test,
#if defined(USE_NSS)
crypto::EnsureNSSInit();
- net::EnsureOCSPInit();
+ net::EnsureNSSHttpIOInit();
#endif
}
virtual void TearDown() OVERRIDE {
#if defined(USE_NSS)
- net::ShutdownOCSP();
+ net::ShutdownNSSHttpIO();
#endif
}
diff --git a/net/base/net_test_suite.cc b/net/base/net_test_suite.cc
index 2d2b411..ecd1316 100644
--- a/net/base/net_test_suite.cc
+++ b/net/base/net_test_suite.cc
@@ -39,7 +39,7 @@ void NetTestSuite::Initialize() {
void NetTestSuite::Shutdown() {
#if defined(USE_NSS)
- net::ShutdownOCSP();
+ net::ShutdownNSSHttpIO();
#endif
// We want to destroy this here before the TestSuite continues to tear down
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc
index 1eb0b21..07cd019 100644
--- a/net/ocsp/nss_ocsp.cc
+++ b/net/ocsp/nss_ocsp.cc
@@ -915,7 +915,7 @@ char* GetAlternateOCSPAIAInfo(CERTCertificate *cert) {
namespace net {
-void SetMessageLoopForOCSP() {
+void SetMessageLoopForNSSHttpIO() {
// Must have a MessageLoopForIO.
DCHECK(MessageLoopForIO::current());
@@ -925,17 +925,17 @@ void SetMessageLoopForOCSP() {
DCHECK(!used);
}
-void EnsureOCSPInit() {
+void EnsureNSSHttpIOInit() {
g_ocsp_io_loop.Get().StartUsing();
g_ocsp_nss_initialization.Get();
}
-void ShutdownOCSP() {
+void ShutdownNSSHttpIO() {
g_ocsp_io_loop.Get().Shutdown();
}
// This function would be called before NSS initialization.
-void SetURLRequestContextForOCSP(URLRequestContext* request_context) {
+void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) {
pthread_mutex_lock(&g_request_context_lock);
if (request_context) {
DCHECK(!g_request_context);
diff --git a/net/ocsp/nss_ocsp.h b/net/ocsp/nss_ocsp.h
index bf67751..d56dd26 100644
--- a/net/ocsp/nss_ocsp.h
+++ b/net/ocsp/nss_ocsp.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,22 +12,24 @@ namespace net {
class URLRequestContext;
-// Sets the MessageLoop for OCSP to the current message loop.
-// This should be called before EnsureOCSPInit() if you want to
-// control the message loop for OCSP.
-NET_EXPORT void SetMessageLoopForOCSP();
+// Sets the MessageLoop for NSS's HTTP client functions (i.e. OCSP, CA
+// certificate and CRL fetches) to the current message loop. This should be
+// called before EnsureNSSHttpIOInit() if you want to control the message loop.
+NET_EXPORT void SetMessageLoopForNSSHttpIO();
-// Initializes OCSP handlers for NSS. This must be called before any
-// certificate verification functions. This function is thread-safe, and OCSP
-// handlers will only ever be initialized once. ShutdownOCSP() must be called
-// on shutdown.
-NET_EXPORT void EnsureOCSPInit();
+// Initializes HTTP client functions for NSS. This must be called before any
+// certificate verification functions. This function is thread-safe, and HTTP
+// handlers will only ever be initialized once. ShutdownNSSHttpIO() must be
+// called on shutdown.
+NET_EXPORT void EnsureNSSHttpIOInit();
-// This should be called once on shutdown to stop issuing URLRequests for OCSP.
-NET_EXPORT void ShutdownOCSP();
+// This should be called once on shutdown to stop issuing URLRequests for NSS
+// related HTTP fetches.
+NET_EXPORT void ShutdownNSSHttpIO();
-// Set URLRequestContext for OCSP handlers.
-NET_EXPORT void SetURLRequestContextForOCSP(URLRequestContext* request_context);
+// Sets the URLRequestContext for HTTP requests issued by NSS.
+NET_EXPORT void SetURLRequestContextForNSSHttpIO(
+ URLRequestContext* request_context);
} // namespace net
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 7f9bb4c..bc2bc92 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -820,12 +820,10 @@ int SSLClientSocketNSS::Init() {
if (!NSS_IsInitialized())
return ERR_UNEXPECTED;
#if !defined(OS_MACOSX) && !defined(OS_WIN)
- if (ssl_config_.rev_checking_enabled) {
- // We must call EnsureOCSPInit() here, on the IO thread, to get the IO loop
- // by MessageLoopForIO::current().
- // X509Certificate::Verify() runs on a worker thread of CertVerifier.
- EnsureOCSPInit();
- }
+ // We must call EnsureNSSHttpIOInit() here, on the IO thread, to get the IO
+ // loop by MessageLoopForIO::current().
+ // X509Certificate::Verify() runs on a worker thread of CertVerifier.
+ EnsureNSSHttpIOInit();
#endif
LeaveFunction("");