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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 206453002: Introduce USE_OPENSSL_CERTS for certificate handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fixes and nits Created 6 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 | « net/net.gyp ('k') | net/ssl/server_bound_cert_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index f97c4697cfe6fb30e8801a9193afc51d5e6fca30..75a1b77e5163a65dd99093d290ff8a819ede6bbf 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -389,7 +389,7 @@ SSLClientSocketOpenSSL::PeerCertificateChain::operator=(
return *this;
}
-#if defined(USE_OPENSSL)
+#if defined(USE_OPENSSL_CERTS)
// When OSCertHandle is typedef'ed to X509, this implementation does a short cut
// to avoid converting back and forth between der and X509 struct.
void SSLClientSocketOpenSSL::PeerCertificateChain::Reset(
@@ -417,7 +417,7 @@ void SSLClientSocketOpenSSL::PeerCertificateChain::Reset(
CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
}
}
-#else // !defined(USE_OPENSSL)
+#else // !defined(USE_OPENSSL_CERTS)
void SSLClientSocketOpenSSL::PeerCertificateChain::Reset(
STACK_OF(X509)* chain) {
openssl_chain_.reset(NULL);
@@ -455,7 +455,7 @@ void SSLClientSocketOpenSSL::PeerCertificateChain::Reset(
os_chain_ = NULL;
}
}
-#endif // USE_OPENSSL
+#endif // defined(USE_OPENSSL_CERTS)
// static
SSLSessionCacheOpenSSL::Config
@@ -471,7 +471,9 @@ void SSLClientSocket::ClearSessionCache() {
SSLClientSocketOpenSSL::SSLContext* context =
SSLClientSocketOpenSSL::SSLContext::GetInstance();
context->session_cache()->Flush();
+#if defined(USE_OPENSSL_CERTS)
OpenSSLClientKeyStore::GetInstance()->Flush();
+#endif
}
SSLClientSocketOpenSSL::SSLClientSocketOpenSSL(
@@ -1414,7 +1416,7 @@ int SSLClientSocketOpenSSL::ClientCertRequestCallback(SSL* ssl,
DCHECK(ssl == ssl_);
DCHECK(*x509 == NULL);
DCHECK(*pkey == NULL);
-
+#if defined(USE_OPENSSL_CERTS)
if (!ssl_config_.send_client_cert) {
// First pass: we know that a client certificate is needed, but we do not
// have one at hand.
@@ -1451,6 +1453,10 @@ int SSLClientSocketOpenSSL::ClientCertRequestCallback(SSL* ssl,
}
LOG(WARNING) << "Client cert found without private key";
}
+#else // !defined(USE_OPENSSL_CERTS)
+ // OS handling of client certificates is not yet implemented.
+ NOTIMPLEMENTED();
+#endif // defined(USE_OPENSSL_CERTS)
// Send no client certificate.
return 0;
« no previous file with comments | « net/net.gyp ('k') | net/ssl/server_bound_cert_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698