diff options
author | snej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 17:17:57 +0000 |
---|---|---|
committer | snej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 17:17:57 +0000 |
commit | 207c678c4692c9dfec3e34c0d206f2ee1b2fbb6a (patch) | |
tree | a2017eddab0bbb8713ddfd9c1473dd81e557ec4f /net/socket/ssl_client_socket_win.cc | |
parent | 76964955a0fc995d7a0c95feaeaa17891eab2205 (diff) | |
download | chromium_src-207c678c4692c9dfec3e34c0d206f2ee1b2fbb6a.zip chromium_src-207c678c4692c9dfec3e34c0d206f2ee1b2fbb6a.tar.gz chromium_src-207c678c4692c9dfec3e34c0d206f2ee1b2fbb6a.tar.bz2 |
Revert my last commit 'cause it breaks net unit tests on OS X 10.6 :(
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket_win.cc')
-rw-r--r-- | net/socket/ssl_client_socket_win.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc index bf4a547..7e76f9e 100644 --- a/net/socket/ssl_client_socket_win.cc +++ b/net/socket/ssl_client_socket_win.cc @@ -68,6 +68,13 @@ 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 @@ -411,8 +418,7 @@ void SSLClientSocketWin::GetSSLCertRequestInfo( continue; } scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle( - cert_context2, X509Certificate::SOURCE_LONE_CERT_IMPORT, - net::X509Certificate::OSCertHandles()); + cert_context2, X509Certificate::SOURCE_LONE_CERT_IMPORT); cert_request_info->client_certs.push_back(cert); } @@ -1297,16 +1303,14 @@ int SSLClientSocketWin::DidCompleteHandshake() { return MapSecurityError(status); } if (renegotiating_ && - X509Certificate::IsSameOSCert(server_cert_->os_cert_handle(), - server_cert_handle)) { + SameCert(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, - net::X509Certificate::OSCertHandles()); + server_cert_handle, X509Certificate::SOURCE_FROM_NETWORK); next_state_ = STATE_VERIFY_CERT; } |