Skip to content

Commit

Permalink
Split net::ClientCertStoreImpl into actual platform-specific classes.
Browse files Browse the repository at this point in the history
BUG=none

Review URL: https://codereview.chromium.org/108233005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240010 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mattm@chromium.org committed Dec 11, 2013
1 parent 454da65 commit 5482ef9
Show file tree
Hide file tree
Showing 14 changed files with 486 additions and 296 deletions.
26 changes: 18 additions & 8 deletions chrome/browser/profiles/profile_io_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
#include "net/proxy/proxy_script_fetcher_impl.h"
#include "net/proxy/proxy_service.h"
#include "net/ssl/client_cert_store.h"
#include "net/ssl/client_cert_store_impl.h"
#include "net/ssl/server_bound_cert_service.h"
#include "net/url_request/data_protocol_handler.h"
#include "net/url_request/file_protocol_handler.h"
Expand Down Expand Up @@ -104,6 +103,15 @@

#if defined(USE_NSS)
#include "chrome/browser/ui/crypto_module_password_dialog.h"
#include "net/ssl/client_cert_store_nss.h"
#endif

#if defined(OS_WIN)
#include "net/ssl/client_cert_store_win.h"
#endif

#if defined(OS_MACOSX)
#include "net/ssl/client_cert_store_mac.h"
#endif

using content::BrowserContext;
Expand Down Expand Up @@ -826,19 +834,21 @@ net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() {

scoped_ptr<net::ClientCertStore>
ProfileIOData::ResourceContext::CreateClientCertStore() {
#if !defined(USE_OPENSSL)
scoped_ptr<net::ClientCertStoreImpl> store(new net::ClientCertStoreImpl());
#if defined(USE_NSS)
store->set_password_delegate_factory(
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
base::Bind(&chrome::NewCryptoModuleBlockingDialogDelegate,
chrome::kCryptoModulePasswordClientAuth));
#endif
return store.PassAs<net::ClientCertStore>();
#else // defined(USE_OPENSSL)
chrome::kCryptoModulePasswordClientAuth)));
#elif defined(OS_WIN)
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
#elif defined(OS_MACOSX)
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#elif defined(USE_OPENSSL)
// OpenSSL does not use the ClientCertStore infrastructure. On Android client
// cert matching is done by the OS as part of the call to show the cert
// selection dialog.
return scoped_ptr<net::ClientCertStore>();
#else
#error Unknown platform.
#endif
}

Expand Down
31 changes: 17 additions & 14 deletions net/net.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,10 +1021,12 @@
'spdy/spdy_write_queue.h',
'spdy/write_blocked_list.h',
'ssl/client_cert_store.h',
'ssl/client_cert_store_impl.h',
'ssl/client_cert_store_impl_mac.cc',
'ssl/client_cert_store_impl_nss.cc',
'ssl/client_cert_store_impl_win.cc',
'ssl/client_cert_store_mac.cc',
'ssl/client_cert_store_mac.h',
'ssl/client_cert_store_nss.cc',
'ssl/client_cert_store_nss.h',
'ssl/client_cert_store_win.cc',
'ssl/client_cert_store_win.h',
'ssl/default_server_bound_cert_store.cc',
'ssl/default_server_bound_cert_store.h',
'ssl/openssl_client_key_store.cc',
Expand Down Expand Up @@ -1310,7 +1312,6 @@
'socket/ssl_client_socket_nss.h',
'socket/ssl_server_socket_nss.cc',
'socket/ssl_server_socket_nss.h',
'ssl/client_cert_store_impl_nss.cc',
'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
'third_party/mozilla_security_manager/nsKeygenHandler.h',
'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
Expand Down Expand Up @@ -1419,7 +1420,8 @@
'sources!': [
'cert/cert_verify_proc_nss.cc',
'cert/cert_verify_proc_nss.h',
'ssl/client_cert_store_impl_nss.cc',
'ssl/client_cert_store_nss.cc',
'ssl/client_cert_store_nss.h',
],
}],
[ 'enable_websockets != 1', {
Expand Down Expand Up @@ -1451,7 +1453,6 @@
'http/http_auth_handler_ntlm_portable.cc',
'socket/tcp_socket_libevent.cc',
'socket/tcp_socket_libevent.h',
'ssl/client_cert_store_impl_nss.cc',
'udp/udp_socket_libevent.cc',
'udp/udp_socket_libevent.h',
],
Expand All @@ -1474,9 +1475,6 @@
},
],
[ 'OS == "mac"', {
'sources!': [
'ssl/client_cert_store_impl_nss.cc',
],
'dependencies': [
'../third_party/nss/nss.gyp:nspr',
'../third_party/nss/nss.gyp:nss',
Expand Down Expand Up @@ -1928,7 +1926,10 @@
'spdy/spdy_websocket_test_util.h',
'spdy/spdy_write_queue_unittest.cc',
'spdy/write_blocked_list_test.cc',
'ssl/client_cert_store_impl_unittest.cc',
'ssl/client_cert_store_mac_unittest.cc',
'ssl/client_cert_store_nss_unittest.cc',
'ssl/client_cert_store_unittest-inl.h',
'ssl/client_cert_store_win_unittest.cc',
'ssl/default_server_bound_cert_store_unittest.cc',
'ssl/openssl_client_key_store_unittest.cc',
'ssl/server_bound_cert_service_unittest.cc',
Expand Down Expand Up @@ -2041,13 +2042,17 @@
# No res_ninit() et al on Android, so this doesn't make a lot of
# sense.
'dns/dns_config_service_posix_unittest.cc',
'ssl/client_cert_store_impl_unittest.cc',
],
'dependencies': [
'net_javatests',
'net_test_jni_headers',
],
}],
[ 'use_nss != 1', {
'sources!': [
'ssl/client_cert_store_nss_unittest.cc',
],
}],
[ 'use_openssl == 1', {
# Avoid compiling/linking with the system library.
'dependencies': [
Expand Down Expand Up @@ -2111,7 +2116,6 @@
'cert/nss_cert_database_unittest.cc',
'cert/x509_util_nss_unittest.cc',
'quic/test_tools/crypto_test_utils_nss.cc',
'ssl/client_cert_store_impl_unittest.cc',
],
}, { # else !use_openssl: remove the unneeded files
'sources!': [
Expand Down Expand Up @@ -2223,7 +2227,6 @@
# Need TestServer.
'proxy/proxy_script_fetcher_impl_unittest.cc',
'socket/ssl_client_socket_unittest.cc',
'ssl/client_cert_store_impl_unittest.cc',
'url_request/url_fetcher_impl_unittest.cc',
'url_request/url_request_context_builder_unittest.cc',
# Needs GetAppOutput().
Expand Down
79 changes: 0 additions & 79 deletions net/ssl/client_cert_store_impl.h

This file was deleted.

Loading

0 comments on commit 5482ef9

Please sign in to comment.