OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // OpenSSL binding for SSLClientSocket. The class layout and general principle | 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle |
6 // of operation is derived from SSLClientSocketNSS. | 6 // of operation is derived from SSLClientSocketNSS. |
7 | 7 |
8 #include "net/socket/ssl_client_socket_openssl.h" | 8 #include "net/socket/ssl_client_socket_openssl.h" |
9 | 9 |
10 #include <openssl/ssl.h> | 10 #include <openssl/ssl.h> |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 } | 546 } |
547 | 547 |
548 // Send no client certificate. | 548 // Send no client certificate. |
549 return 0; | 549 return 0; |
550 } | 550 } |
551 | 551 |
552 // SSLClientSocket methods | 552 // SSLClientSocket methods |
553 | 553 |
554 void SSLClientSocketOpenSSL::GetSSLInfo(SSLInfo* ssl_info) { | 554 void SSLClientSocketOpenSSL::GetSSLInfo(SSLInfo* ssl_info) { |
555 ssl_info->Reset(); | 555 ssl_info->Reset(); |
556 if (!server_cert_) | 556 if (!server_cert_verify_result_->verified_cert) { |
| 557 NOTREACHED(); |
557 return; | 558 return; |
| 559 } |
558 | 560 |
559 ssl_info->cert = server_cert_; | 561 ssl_info->cert = server_cert_verify_result_.verified_cert; |
560 ssl_info->cert_status = server_cert_verify_result_.cert_status; | 562 ssl_info->cert_status = server_cert_verify_result_.cert_status; |
561 ssl_info->is_issued_by_known_root = | 563 ssl_info->is_issued_by_known_root = |
562 server_cert_verify_result_.is_issued_by_known_root; | 564 server_cert_verify_result_.is_issued_by_known_root; |
563 ssl_info->public_key_hashes = | 565 ssl_info->public_key_hashes = |
564 server_cert_verify_result_.public_key_hashes; | 566 server_cert_verify_result_.public_key_hashes; |
565 | 567 |
566 const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl_); | 568 const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl_); |
567 CHECK(cipher); | 569 CHECK(cipher); |
568 ssl_info->security_bits = SSL_CIPHER_get_bits(cipher, NULL); | 570 ssl_info->security_bits = SSL_CIPHER_get_bits(cipher, NULL); |
569 const COMP_METHOD* compression = SSL_get_current_compression(ssl_); | 571 const COMP_METHOD* compression = SSL_get_current_compression(ssl_); |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 int rv = SSL_write(ssl_, user_write_buf_->data(), user_write_buf_len_); | 1190 int rv = SSL_write(ssl_, user_write_buf_->data(), user_write_buf_len_); |
1189 | 1191 |
1190 if (rv >= 0) | 1192 if (rv >= 0) |
1191 return rv; | 1193 return rv; |
1192 | 1194 |
1193 int err = SSL_get_error(ssl_, rv); | 1195 int err = SSL_get_error(ssl_, rv); |
1194 return MapOpenSSLError(err, err_tracer); | 1196 return MapOpenSSLError(err, err_tracer); |
1195 } | 1197 } |
1196 | 1198 |
1197 } // namespace net | 1199 } // namespace net |
OLD | NEW |