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 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 int SSLClientSocketMac::DidCompleteHandshake() { | 1290 int SSLClientSocketMac::DidCompleteHandshake() { |
1291 DCHECK(!server_cert_ || renegotiating_); | 1291 DCHECK(!server_cert_ || renegotiating_); |
1292 VLOG(1) << "Handshake completed, next verify cert"; | 1292 VLOG(1) << "Handshake completed, next verify cert"; |
1293 | 1293 |
1294 scoped_refptr<X509Certificate> new_server_cert( | 1294 scoped_refptr<X509Certificate> new_server_cert( |
1295 GetServerCert(ssl_context_)); | 1295 GetServerCert(ssl_context_)); |
1296 if (!new_server_cert) | 1296 if (!new_server_cert) |
1297 return ERR_UNEXPECTED; | 1297 return ERR_UNEXPECTED; |
1298 net_log_.AddEvent( | 1298 net_log_.AddEvent( |
1299 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED, | 1299 NetLog::TYPE_SSL_CERTIFICATES_RECEIVED, |
1300 make_scoped_refptr(new X509CertificateNetLogParam(new_server_cert))); | 1300 base::Bind(&NetLogX509CertificateCallback, |
| 1301 base::Unretained(new_server_cert.get()))); |
1301 | 1302 |
1302 if (renegotiating_ && | 1303 if (renegotiating_ && |
1303 X509Certificate::IsSameOSCert(server_cert_->os_cert_handle(), | 1304 X509Certificate::IsSameOSCert(server_cert_->os_cert_handle(), |
1304 new_server_cert->os_cert_handle())) { | 1305 new_server_cert->os_cert_handle())) { |
1305 // We already verified the server certificate. Either it is good or the | 1306 // We already verified the server certificate. Either it is good or the |
1306 // user has accepted the certificate error. | 1307 // user has accepted the certificate error. |
1307 DidCompleteRenegotiation(); | 1308 DidCompleteRenegotiation(); |
1308 } else { | 1309 } else { |
1309 server_cert_ = new_server_cert; | 1310 server_cert_ = new_server_cert; |
1310 next_handshake_state_ = STATE_VERIFY_CERT; | 1311 next_handshake_state_ = STATE_VERIFY_CERT; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 if (rv < 0 && rv != ERR_IO_PENDING) { | 1440 if (rv < 0 && rv != ERR_IO_PENDING) { |
1440 us->write_io_buf_ = NULL; | 1441 us->write_io_buf_ = NULL; |
1441 return OSStatusFromNetError(rv); | 1442 return OSStatusFromNetError(rv); |
1442 } | 1443 } |
1443 | 1444 |
1444 // always lie to our caller | 1445 // always lie to our caller |
1445 return noErr; | 1446 return noErr; |
1446 } | 1447 } |
1447 | 1448 |
1448 } // namespace net | 1449 } // namespace net |
OLD | NEW |