| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_mac.h" | 5 #include "net/base/ssl_client_socket_mac.h" |
| 6 | 6 |
| 7 #include "base/singleton.h" | 7 #include "base/singleton.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/ssl_info.h" | 10 #include "net/base/ssl_info.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 // set cert | 373 // set cert |
| 374 CFArrayRef certs; | 374 CFArrayRef certs; |
| 375 status = SSLCopyPeerCertificates(ssl_context_, &certs); | 375 status = SSLCopyPeerCertificates(ssl_context_, &certs); |
| 376 if (!status) { | 376 if (!status) { |
| 377 DCHECK(CFArrayGetCount(certs) > 0); | 377 DCHECK(CFArrayGetCount(certs) > 0); |
| 378 | 378 |
| 379 SecCertificateRef client_cert = | 379 SecCertificateRef client_cert = |
| 380 static_cast<SecCertificateRef>( | 380 static_cast<SecCertificateRef>( |
| 381 const_cast<void*>(CFArrayGetValueAtIndex(certs, 0))); | 381 const_cast<void*>(CFArrayGetValueAtIndex(certs, 0))); |
| 382 CFRetain(client_cert); | 382 CFRetain(client_cert); |
| 383 ssl_info->cert = X509Certificate::CreateFromHandle(client_cert); | 383 ssl_info->cert = X509Certificate::CreateFromHandle( |
| 384 client_cert, X509Certificate::SOURCE_FROM_NETWORK); |
| 384 CFRelease(certs); | 385 CFRelease(certs); |
| 385 } | 386 } |
| 386 | 387 |
| 387 // update status | 388 // update status |
| 388 ssl_info->cert_status = server_cert_status_; | 389 ssl_info->cert_status = server_cert_status_; |
| 389 | 390 |
| 390 // security info | 391 // security info |
| 391 SSLCipherSuite suite; | 392 SSLCipherSuite suite; |
| 392 status = SSLGetNegotiatedCipher(ssl_context_, &suite); | 393 status = SSLGetNegotiatedCipher(ssl_context_, &suite); |
| 393 if (!status) | 394 if (!status) |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 if (rv < 0 && rv != ERR_IO_PENDING) { | 772 if (rv < 0 && rv != ERR_IO_PENDING) { |
| 772 return OSStatusFromNetError(rv); | 773 return OSStatusFromNetError(rv); |
| 773 } | 774 } |
| 774 | 775 |
| 775 // always lie to our caller | 776 // always lie to our caller |
| 776 return noErr; | 777 return noErr; |
| 777 } | 778 } |
| 778 | 779 |
| 779 } // namespace net | 780 } // namespace net |
| 780 | 781 |
| OLD | NEW |