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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 } | 785 } |
786 | 786 |
787 SSLClientSocket::NextProtoStatus | 787 SSLClientSocket::NextProtoStatus |
788 SSLClientSocketMac::GetNextProto(std::string* proto, | 788 SSLClientSocketMac::GetNextProto(std::string* proto, |
789 std::string* server_protos) { | 789 std::string* server_protos) { |
790 proto->clear(); | 790 proto->clear(); |
791 server_protos->clear(); | 791 server_protos->clear(); |
792 return kNextProtoUnsupported; | 792 return kNextProtoUnsupported; |
793 } | 793 } |
794 | 794 |
795 OriginBoundCertService* SSLClientSocketMac::GetOriginBoundCertService() const { | 795 ServerBoundCertService* SSLClientSocketMac::GetServerBoundCertService() const { |
796 return NULL; | 796 return NULL; |
797 } | 797 } |
798 | 798 |
799 int SSLClientSocketMac::InitializeSSLContext() { | 799 int SSLClientSocketMac::InitializeSSLContext() { |
800 VLOG(1) << "----- InitializeSSLContext"; | 800 VLOG(1) << "----- InitializeSSLContext"; |
801 OSStatus status = noErr; | 801 OSStatus status = noErr; |
802 | 802 |
803 status = SSLNewContext(false, &ssl_context_); | 803 status = SSLNewContext(false, &ssl_context_); |
804 if (status) | 804 if (status) |
805 return NetErrorFromOSStatus(status); | 805 return NetErrorFromOSStatus(status); |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 if (rv < 0 && rv != ERR_IO_PENDING) { | 1428 if (rv < 0 && rv != ERR_IO_PENDING) { |
1429 us->write_io_buf_ = NULL; | 1429 us->write_io_buf_ = NULL; |
1430 return OSStatusFromNetError(rv); | 1430 return OSStatusFromNetError(rv); |
1431 } | 1431 } |
1432 | 1432 |
1433 // always lie to our caller | 1433 // always lie to our caller |
1434 return noErr; | 1434 return noErr; |
1435 } | 1435 } |
1436 | 1436 |
1437 } // namespace net | 1437 } // namespace net |
OLD | NEW |