summaryrefslogtreecommitdiffstats
path: root/net/socket/ssl_client_socket_win.cc
diff options
context:
space:
mode:
authorsnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-05 23:44:45 +0000
committersnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-05 23:44:45 +0000
commit4bee851c891ded2c3654729e0ea9a7ebd56e54bb (patch)
treebbb5fbcdcbfaa5c194af66dedb7e9fd135476f70 /net/socket/ssl_client_socket_win.cc
parentd68a4fc6f448c6ebf407e2817320e7736c4735ee (diff)
downloadchromium_src-4bee851c891ded2c3654729e0ea9a7ebd56e54bb.zip
chromium_src-4bee851c891ded2c3654729e0ea9a7ebd56e54bb.tar.gz
chromium_src-4bee851c891ded2c3654729e0ea9a7ebd56e54bb.tar.bz2
Thread-safety for X509Certificate's intermediate-certs list.
BUG=32553,30001 TEST=none Review URL: http://codereview.chromium.org/661223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket_win.cc')
-rw-r--r--net/socket/ssl_client_socket_win.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc
index 7e76f9e..bf4a547 100644
--- a/net/socket/ssl_client_socket_win.cc
+++ b/net/socket/ssl_client_socket_win.cc
@@ -68,13 +68,6 @@ static int MapSecurityError(SECURITY_STATUS err) {
}
}
-// Returns true if the two CERT_CONTEXTs contain the same certificate.
-bool SameCert(PCCERT_CONTEXT a, PCCERT_CONTEXT b) {
- return a == b ||
- (a->cbCertEncoded == b->cbCertEncoded &&
- memcmp(a->pbCertEncoded, b->pbCertEncoded, b->cbCertEncoded) == 0);
-}
-
//-----------------------------------------------------------------------------
// A bitmask consisting of these bit flags encodes which versions of the SSL
@@ -418,7 +411,8 @@ void SSLClientSocketWin::GetSSLCertRequestInfo(
continue;
}
scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle(
- cert_context2, X509Certificate::SOURCE_LONE_CERT_IMPORT);
+ cert_context2, X509Certificate::SOURCE_LONE_CERT_IMPORT,
+ net::X509Certificate::OSCertHandles());
cert_request_info->client_certs.push_back(cert);
}
@@ -1303,14 +1297,16 @@ int SSLClientSocketWin::DidCompleteHandshake() {
return MapSecurityError(status);
}
if (renegotiating_ &&
- SameCert(server_cert_->os_cert_handle(), server_cert_handle)) {
+ X509Certificate::IsSameOSCert(server_cert_->os_cert_handle(),
+ server_cert_handle)) {
// We already verified the server certificate. Either it is good or the
// user has accepted the certificate error.
CertFreeCertificateContext(server_cert_handle);
DidCompleteRenegotiation();
} else {
server_cert_ = X509Certificate::CreateFromHandle(
- server_cert_handle, X509Certificate::SOURCE_FROM_NETWORK);
+ server_cert_handle, X509Certificate::SOURCE_FROM_NETWORK,
+ net::X509Certificate::OSCertHandles());
next_state_ = STATE_VERIFY_CERT;
}