| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/ssl_client_socket_win.h" | 5 #include "net/base/ssl_client_socket_win.h" |
| 6 | 6 |
| 7 #include <schnlsp.h> | 7 #include <schnlsp.h> |
| 8 | 8 |
| 9 #include "base/lock.h" | 9 #include "base/lock.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) { | 352 void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) { |
| 353 SECURITY_STATUS status = SEC_E_OK; | 353 SECURITY_STATUS status = SEC_E_OK; |
| 354 if (server_cert_ == NULL) { | 354 if (server_cert_ == NULL) { |
| 355 status = QueryContextAttributes(&ctxt_, | 355 status = QueryContextAttributes(&ctxt_, |
| 356 SECPKG_ATTR_REMOTE_CERT_CONTEXT, | 356 SECPKG_ATTR_REMOTE_CERT_CONTEXT, |
| 357 &server_cert_); | 357 &server_cert_); |
| 358 } | 358 } |
| 359 if (status == SEC_E_OK) { | 359 if (status == SEC_E_OK) { |
| 360 DCHECK(server_cert_); | 360 DCHECK(server_cert_); |
| 361 PCCERT_CONTEXT dup_cert = CertDuplicateCertificateContext(server_cert_); | 361 PCCERT_CONTEXT dup_cert = CertDuplicateCertificateContext(server_cert_); |
| 362 ssl_info->cert = X509Certificate::CreateFromHandle(dup_cert); | 362 ssl_info->cert = X509Certificate::CreateFromHandle( |
| 363 dup_cert, X509Certificate::SOURCE_FROM_NETWORK); |
| 363 } | 364 } |
| 364 SecPkgContext_ConnectionInfo connection_info; | 365 SecPkgContext_ConnectionInfo connection_info; |
| 365 status = QueryContextAttributes(&ctxt_, | 366 status = QueryContextAttributes(&ctxt_, |
| 366 SECPKG_ATTR_CONNECTION_INFO, | 367 SECPKG_ATTR_CONNECTION_INFO, |
| 367 &connection_info); | 368 &connection_info); |
| 368 if (status == SEC_E_OK) { | 369 if (status == SEC_E_OK) { |
| 369 // TODO(wtc): compute the overall security strength, taking into account | 370 // TODO(wtc): compute the overall security strength, taking into account |
| 370 // dwExchStrength and dwHashStrength. dwExchStrength needs to be | 371 // dwExchStrength and dwHashStrength. dwExchStrength needs to be |
| 371 // normalized. | 372 // normalized. |
| 372 ssl_info->security_bits = connection_info.dwCipherStrength; | 373 ssl_info->security_bits = connection_info.dwCipherStrength; |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 // compatible with WinHTTP, which doesn't report this error (bug 3004). | 1191 // compatible with WinHTTP, which doesn't report this error (bug 3004). |
| 1191 server_cert_status_ &= ~CERT_STATUS_NO_REVOCATION_MECHANISM; | 1192 server_cert_status_ &= ~CERT_STATUS_NO_REVOCATION_MECHANISM; |
| 1192 | 1193 |
| 1193 if (IsCertStatusError(server_cert_status_)) | 1194 if (IsCertStatusError(server_cert_status_)) |
| 1194 return MapCertStatusToNetError(server_cert_status_); | 1195 return MapCertStatusToNetError(server_cert_status_); |
| 1195 return OK; | 1196 return OK; |
| 1196 } | 1197 } |
| 1197 | 1198 |
| 1198 } // namespace net | 1199 } // namespace net |
| 1199 | 1200 |
| OLD | NEW |