| 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 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 if (ssl_config_.IsAllowedBadCert(server_cert_, &cert_status)) { | 1163 if (ssl_config_.IsAllowedBadCert(server_cert_, &cert_status)) { |
| 1164 VLOG(1) << "Received an expected bad cert with status: " << cert_status; | 1164 VLOG(1) << "Received an expected bad cert with status: " << cert_status; |
| 1165 server_cert_verify_result_.Reset(); | 1165 server_cert_verify_result_.Reset(); |
| 1166 server_cert_verify_result_.cert_status = cert_status; | 1166 server_cert_verify_result_.cert_status = cert_status; |
| 1167 server_cert_verify_result_.verified_cert = server_cert_; | 1167 server_cert_verify_result_.verified_cert = server_cert_; |
| 1168 return OK; | 1168 return OK; |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 int flags = 0; | 1171 int flags = 0; |
| 1172 if (ssl_config_.rev_checking_enabled) | 1172 if (ssl_config_.rev_checking_enabled) |
| 1173 flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED; | 1173 flags |= CertVerifier::VERIFY_REV_CHECKING_ENABLED; |
| 1174 if (ssl_config_.verify_ev_cert) | 1174 if (ssl_config_.verify_ev_cert) |
| 1175 flags |= X509Certificate::VERIFY_EV_CERT; | 1175 flags |= CertVerifier::VERIFY_EV_CERT; |
| 1176 if (ssl_config_.cert_io_enabled) | 1176 if (ssl_config_.cert_io_enabled) |
| 1177 flags |= X509Certificate::VERIFY_CERT_IO_ENABLED; | 1177 flags |= CertVerifier::VERIFY_CERT_IO_ENABLED; |
| 1178 verifier_.reset(new SingleRequestCertVerifier(cert_verifier_)); | 1178 verifier_.reset(new SingleRequestCertVerifier(cert_verifier_)); |
| 1179 return verifier_->Verify( | 1179 return verifier_->Verify( |
| 1180 server_cert_, host_and_port_.host(), flags, | 1180 server_cert_, host_and_port_.host(), flags, |
| 1181 NULL /* no CRL set */, | 1181 NULL /* no CRL set */, |
| 1182 &server_cert_verify_result_, | 1182 &server_cert_verify_result_, |
| 1183 base::Bind(&SSLClientSocketMac::OnHandshakeIOComplete, | 1183 base::Bind(&SSLClientSocketMac::OnHandshakeIOComplete, |
| 1184 base::Unretained(this)), | 1184 base::Unretained(this)), |
| 1185 net_log_); | 1185 net_log_); |
| 1186 } | 1186 } |
| 1187 | 1187 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1447 if (rv < 0 && rv != ERR_IO_PENDING) { | 1447 if (rv < 0 && rv != ERR_IO_PENDING) { |
| 1448 us->write_io_buf_ = NULL; | 1448 us->write_io_buf_ = NULL; |
| 1449 return OSStatusFromNetError(rv); | 1449 return OSStatusFromNetError(rv); |
| 1450 } | 1450 } |
| 1451 | 1451 |
| 1452 // always lie to our caller | 1452 // always lie to our caller |
| 1453 return noErr; | 1453 return noErr; |
| 1454 } | 1454 } |
| 1455 | 1455 |
| 1456 } // namespace net | 1456 } // namespace net |
| OLD | NEW |