OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_mac.h" | 5 #include "net/socket/ssl_client_socket_mac.h" |
6 | 6 |
7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
8 #include <netdb.h> | 8 #include <netdb.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 void SSLClientSocketMac::GetSSLInfo(SSLInfo* ssl_info) { | 717 void SSLClientSocketMac::GetSSLInfo(SSLInfo* ssl_info) { |
718 ssl_info->Reset(); | 718 ssl_info->Reset(); |
719 if (!server_cert_) | 719 if (!server_cert_) |
720 return; | 720 return; |
721 | 721 |
722 ssl_info->cert = server_cert_verify_result_.verified_cert; | 722 ssl_info->cert = server_cert_verify_result_.verified_cert; |
723 ssl_info->cert_status = server_cert_verify_result_.cert_status; | 723 ssl_info->cert_status = server_cert_verify_result_.cert_status; |
724 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; | 724 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; |
725 ssl_info->is_issued_by_known_root = | 725 ssl_info->is_issued_by_known_root = |
726 server_cert_verify_result_.is_issued_by_known_root; | 726 server_cert_verify_result_.is_issued_by_known_root; |
727 ssl_info->client_cert_sent = WasOriginBoundCertSent() || | 727 ssl_info->client_cert_sent = WasDomainBoundCertSent() || |
728 (ssl_config_.send_client_cert && ssl_config_.client_cert); | 728 (ssl_config_.send_client_cert && ssl_config_.client_cert); |
729 | 729 |
730 // security info | 730 // security info |
731 SSLCipherSuite suite; | 731 SSLCipherSuite suite; |
732 OSStatus status = SSLGetNegotiatedCipher(ssl_context_, &suite); | 732 OSStatus status = SSLGetNegotiatedCipher(ssl_context_, &suite); |
733 if (!status) { | 733 if (!status) { |
734 ssl_info->security_bits = KeySizeOfCipherSuite(suite); | 734 ssl_info->security_bits = KeySizeOfCipherSuite(suite); |
735 ssl_info->connection_status |= | 735 ssl_info->connection_status |= |
736 (suite & SSL_CONNECTION_CIPHERSUITE_MASK) << | 736 (suite & SSL_CONNECTION_CIPHERSUITE_MASK) << |
737 SSL_CONNECTION_CIPHERSUITE_SHIFT; | 737 SSL_CONNECTION_CIPHERSUITE_SHIFT; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 } | 786 } |
787 | 787 |
788 SSLClientSocket::NextProtoStatus | 788 SSLClientSocket::NextProtoStatus |
789 SSLClientSocketMac::GetNextProto(std::string* proto, | 789 SSLClientSocketMac::GetNextProto(std::string* proto, |
790 std::string* server_protos) { | 790 std::string* server_protos) { |
791 proto->clear(); | 791 proto->clear(); |
792 server_protos->clear(); | 792 server_protos->clear(); |
793 return kNextProtoUnsupported; | 793 return kNextProtoUnsupported; |
794 } | 794 } |
795 | 795 |
796 OriginBoundCertService* SSLClientSocketMac::GetOriginBoundCertService() const { | 796 ServerBoundCertService* SSLClientSocketMac::GetServerBoundCertService() const { |
797 return NULL; | 797 return NULL; |
798 } | 798 } |
799 | 799 |
800 int SSLClientSocketMac::InitializeSSLContext() { | 800 int SSLClientSocketMac::InitializeSSLContext() { |
801 VLOG(1) << "----- InitializeSSLContext"; | 801 VLOG(1) << "----- InitializeSSLContext"; |
802 OSStatus status = noErr; | 802 OSStatus status = noErr; |
803 | 803 |
804 status = SSLNewContext(false, &ssl_context_); | 804 status = SSLNewContext(false, &ssl_context_); |
805 if (status) | 805 if (status) |
806 return NetErrorFromOSStatus(status); | 806 return NetErrorFromOSStatus(status); |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 if (rv < 0 && rv != ERR_IO_PENDING) { | 1431 if (rv < 0 && rv != ERR_IO_PENDING) { |
1432 us->write_io_buf_ = NULL; | 1432 us->write_io_buf_ = NULL; |
1433 return OSStatusFromNetError(rv); | 1433 return OSStatusFromNetError(rv); |
1434 } | 1434 } |
1435 | 1435 |
1436 // always lie to our caller | 1436 // always lie to our caller |
1437 return noErr; | 1437 return noErr; |
1438 } | 1438 } |
1439 | 1439 |
1440 } // namespace net | 1440 } // namespace net |
OLD | NEW |