| 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 // 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 <errno.h> | 10 #include <errno.h> |
| (...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2070 session_pending_ = true; | 2070 session_pending_ = true; |
| 2071 MaybeCacheSession(); | 2071 MaybeCacheSession(); |
| 2072 | 2072 |
| 2073 // OpenSSL passes a reference to |session|, but the session cache does not | 2073 // OpenSSL passes a reference to |session|, but the session cache does not |
| 2074 // take this reference, so release it. | 2074 // take this reference, so release it. |
| 2075 SSL_SESSION_free(session); | 2075 SSL_SESSION_free(session); |
| 2076 return 1; | 2076 return 1; |
| 2077 } | 2077 } |
| 2078 | 2078 |
| 2079 void SSLClientSocketOpenSSL::AddSCTInfoToSSLInfo(SSLInfo* ssl_info) const { | 2079 void SSLClientSocketOpenSSL::AddSCTInfoToSSLInfo(SSLInfo* ssl_info) const { |
| 2080 for (ct::SCTList::const_iterator iter = | 2080 ssl_info->UpdateSignedCertificateTimestamps(ct_verify_result_); |
| 2081 ct_verify_result_.verified_scts.begin(); | |
| 2082 iter != ct_verify_result_.verified_scts.end(); ++iter) { | |
| 2083 ssl_info->signed_certificate_timestamps.push_back( | |
| 2084 SignedCertificateTimestampAndStatus(*iter, ct::SCT_STATUS_OK)); | |
| 2085 } | |
| 2086 for (ct::SCTList::const_iterator iter = | |
| 2087 ct_verify_result_.invalid_scts.begin(); | |
| 2088 iter != ct_verify_result_.invalid_scts.end(); ++iter) { | |
| 2089 ssl_info->signed_certificate_timestamps.push_back( | |
| 2090 SignedCertificateTimestampAndStatus(*iter, ct::SCT_STATUS_INVALID)); | |
| 2091 } | |
| 2092 for (ct::SCTList::const_iterator iter = | |
| 2093 ct_verify_result_.unknown_logs_scts.begin(); | |
| 2094 iter != ct_verify_result_.unknown_logs_scts.end(); ++iter) { | |
| 2095 ssl_info->signed_certificate_timestamps.push_back( | |
| 2096 SignedCertificateTimestampAndStatus(*iter, | |
| 2097 ct::SCT_STATUS_LOG_UNKNOWN)); | |
| 2098 } | |
| 2099 } | 2081 } |
| 2100 | 2082 |
| 2101 std::string SSLClientSocketOpenSSL::GetSessionCacheKey() const { | 2083 std::string SSLClientSocketOpenSSL::GetSessionCacheKey() const { |
| 2102 std::string result = host_and_port_.ToString(); | 2084 std::string result = host_and_port_.ToString(); |
| 2103 result.append("/"); | 2085 result.append("/"); |
| 2104 result.append(ssl_session_cache_shard_); | 2086 result.append(ssl_session_cache_shard_); |
| 2105 | 2087 |
| 2106 // Shard the session cache based on maximum protocol version. This causes | 2088 // Shard the session cache based on maximum protocol version. This causes |
| 2107 // fallback connections to use a separate session cache. | 2089 // fallback connections to use a separate session cache. |
| 2108 result.append("/"); | 2090 result.append("/"); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 tb_was_negotiated_ = true; | 2290 tb_was_negotiated_ = true; |
| 2309 return 1; | 2291 return 1; |
| 2310 } | 2292 } |
| 2311 } | 2293 } |
| 2312 | 2294 |
| 2313 *out_alert_value = SSL_AD_ILLEGAL_PARAMETER; | 2295 *out_alert_value = SSL_AD_ILLEGAL_PARAMETER; |
| 2314 return 0; | 2296 return 0; |
| 2315 } | 2297 } |
| 2316 | 2298 |
| 2317 } // namespace net | 2299 } // namespace net |
| OLD | NEW |