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

Side by Side Diff: net/socket/ssl_client_socket_win.cc

Issue 6874039: Return the constructed certificate chain in X509Certificate::Verify() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ensure the EE cert is marked as a TLS server cert, not a CA cert Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/socket/ssl_client_socket_win.h" 5 #include "net/socket/ssl_client_socket_win.h"
6 6
7 #include <schnlsp.h> 7 #include <schnlsp.h>
8 #include <map> 8 #include <map>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 memset(&send_buffer_, 0, sizeof(send_buffer_)); 386 memset(&send_buffer_, 0, sizeof(send_buffer_));
387 memset(&ctxt_, 0, sizeof(ctxt_)); 387 memset(&ctxt_, 0, sizeof(ctxt_));
388 } 388 }
389 389
390 SSLClientSocketWin::~SSLClientSocketWin() { 390 SSLClientSocketWin::~SSLClientSocketWin() {
391 Disconnect(); 391 Disconnect();
392 } 392 }
393 393
394 void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) { 394 void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) {
395 ssl_info->Reset(); 395 ssl_info->Reset();
396 if (!server_cert_verify_result_.verified_cert) {
397 NOTREACHED();
398 return;
399 }
396 400
397 if (!server_cert_) 401 ssl_info->cert = server_cert_verify_result_.verified_cert;
398 return;
399
400 ssl_info->cert = server_cert_;
401 ssl_info->cert_status = server_cert_verify_result_.cert_status; 402 ssl_info->cert_status = server_cert_verify_result_.cert_status;
402 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; 403 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes;
403 ssl_info->is_issued_by_known_root = 404 ssl_info->is_issued_by_known_root =
404 server_cert_verify_result_.is_issued_by_known_root; 405 server_cert_verify_result_.is_issued_by_known_root;
405 SecPkgContext_ConnectionInfo connection_info; 406 SecPkgContext_ConnectionInfo connection_info;
406 SECURITY_STATUS status = QueryContextAttributes( 407 SECURITY_STATUS status = QueryContextAttributes(
407 &ctxt_, SECPKG_ATTR_CONNECTION_INFO, &connection_info); 408 &ctxt_, SECPKG_ATTR_CONNECTION_INFO, &connection_info);
408 if (status == SEC_E_OK) { 409 if (status == SEC_E_OK) {
409 // TODO(wtc): compute the overall security strength, taking into account 410 // TODO(wtc): compute the overall security strength, taking into account
410 // dwExchStrength and dwHashStrength. dwExchStrength needs to be 411 // dwExchStrength and dwHashStrength. dwExchStrength needs to be
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); 1520 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA);
1520 } 1521 }
1521 1522
1522 void SSLClientSocketWin::FreeSendBuffer() { 1523 void SSLClientSocketWin::FreeSendBuffer() {
1523 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); 1524 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer);
1524 DCHECK(status == SEC_E_OK); 1525 DCHECK(status == SEC_E_OK);
1525 memset(&send_buffer_, 0, sizeof(send_buffer_)); 1526 memset(&send_buffer_, 0, sizeof(send_buffer_));
1526 } 1527 }
1527 1528
1528 } // namespace net 1529 } // namespace net
OLDNEW
« net/socket/ssl_client_socket_mac.cc ('K') | « net/socket/ssl_client_socket_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698