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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
8 | 8 |
9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
(...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2827 << " for cipherSuite " << cipher_suite; | 2827 << " for cipherSuite " << cipher_suite; |
2828 } | 2828 } |
2829 | 2829 |
2830 ssl_info->handshake_type = core_->state().resumed_handshake ? | 2830 ssl_info->handshake_type = core_->state().resumed_handshake ? |
2831 SSLInfo::HANDSHAKE_RESUME : SSLInfo::HANDSHAKE_FULL; | 2831 SSLInfo::HANDSHAKE_RESUME : SSLInfo::HANDSHAKE_FULL; |
2832 | 2832 |
2833 LeaveFunction(""); | 2833 LeaveFunction(""); |
2834 return true; | 2834 return true; |
2835 } | 2835 } |
2836 | 2836 |
2837 std::string SSLClientSocketNSS::GetSessionCacheKey() const { | |
2838 NOTIMPLEMENTED(); | |
2839 return std::string(); | |
2840 } | |
2841 | |
2837 bool SSLClientSocketNSS::InSessionCache() const { | 2842 bool SSLClientSocketNSS::InSessionCache() const { |
2838 // For now, always return true so that SSLConnectJobs are never held back. | 2843 // For now, always return true so that SSLConnectJobs are never held back. |
2839 return true; | 2844 return true; |
2840 } | 2845 } |
2841 | 2846 |
2842 void SSLClientSocketNSS::SetHandshakeCompletionCallback( | 2847 void SSLClientSocketNSS::SetHandshakeCompletionCallback( |
2843 const base::Closure& callback) { | 2848 const base::Closure& callback) { |
2844 NOTIMPLEMENTED(); | 2849 NOTIMPLEMENTED(); |
2845 } | 2850 } |
2846 | 2851 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3245 // Set the peer ID for session reuse. This is necessary when we create an | 3250 // Set the peer ID for session reuse. This is necessary when we create an |
3246 // SSL tunnel through a proxy -- GetPeerName returns the proxy's address | 3251 // SSL tunnel through a proxy -- GetPeerName returns the proxy's address |
3247 // rather than the destination server's address in that case. | 3252 // rather than the destination server's address in that case. |
3248 std::string peer_id = host_and_port_.ToString(); | 3253 std::string peer_id = host_and_port_.ToString(); |
3249 // If the ssl_session_cache_shard_ is non-empty, we append it to the peer id. | 3254 // If the ssl_session_cache_shard_ is non-empty, we append it to the peer id. |
3250 // This will cause session cache misses between sockets with different values | 3255 // This will cause session cache misses between sockets with different values |
3251 // of ssl_session_cache_shard_ and this is used to partition the session cache | 3256 // of ssl_session_cache_shard_ and this is used to partition the session cache |
3252 // for incognito mode. | 3257 // for incognito mode. |
3253 if (!ssl_session_cache_shard_.empty()) { | 3258 if (!ssl_session_cache_shard_.empty()) { |
3254 peer_id += "/" + ssl_session_cache_shard_; | 3259 peer_id += "/" + ssl_session_cache_shard_; |
3255 } | 3260 } |
wtc
2014/08/14 23:26:26
This is where the cache key for SSLClientSocketNSS
| |
3256 SECStatus rv = SSL_SetSockPeerID(nss_fd_, const_cast<char*>(peer_id.c_str())); | 3261 SECStatus rv = SSL_SetSockPeerID(nss_fd_, const_cast<char*>(peer_id.c_str())); |
3257 if (rv != SECSuccess) | 3262 if (rv != SECSuccess) |
3258 LogFailedNSSFunction(net_log_, "SSL_SetSockPeerID", peer_id.c_str()); | 3263 LogFailedNSSFunction(net_log_, "SSL_SetSockPeerID", peer_id.c_str()); |
3259 | 3264 |
3260 return OK; | 3265 return OK; |
3261 } | 3266 } |
3262 | 3267 |
3263 void SSLClientSocketNSS::DoConnectCallback(int rv) { | 3268 void SSLClientSocketNSS::DoConnectCallback(int rv) { |
3264 EnterFunction(rv); | 3269 EnterFunction(rv); |
3265 DCHECK_NE(ERR_IO_PENDING, rv); | 3270 DCHECK_NE(ERR_IO_PENDING, rv); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3542 scoped_refptr<X509Certificate> | 3547 scoped_refptr<X509Certificate> |
3543 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const { | 3548 SSLClientSocketNSS::GetUnverifiedServerCertificateChain() const { |
3544 return core_->state().server_cert.get(); | 3549 return core_->state().server_cert.get(); |
3545 } | 3550 } |
3546 | 3551 |
3547 ChannelIDService* SSLClientSocketNSS::GetChannelIDService() const { | 3552 ChannelIDService* SSLClientSocketNSS::GetChannelIDService() const { |
3548 return channel_id_service_; | 3553 return channel_id_service_; |
3549 } | 3554 } |
3550 | 3555 |
3551 } // namespace net | 3556 } // namespace net |
OLD | NEW |