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 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 // static | 2098 // static |
2099 // NSS calls this if an incoming certificate needs to be verified. | 2099 // NSS calls this if an incoming certificate needs to be verified. |
2100 // Do nothing but return SECSuccess. | 2100 // Do nothing but return SECSuccess. |
2101 // This is called only in full handshake mode. | 2101 // This is called only in full handshake mode. |
2102 // Peer certificate is retrieved in HandshakeCallback() later, which is called | 2102 // Peer certificate is retrieved in HandshakeCallback() later, which is called |
2103 // in full handshake mode or in resumption handshake mode. | 2103 // in full handshake mode or in resumption handshake mode. |
2104 SECStatus SSLClientSocketNSS::OwnAuthCertHandler(void* arg, | 2104 SECStatus SSLClientSocketNSS::OwnAuthCertHandler(void* arg, |
2105 PRFileDesc* socket, | 2105 PRFileDesc* socket, |
2106 PRBool checksig, | 2106 PRBool checksig, |
2107 PRBool is_server) { | 2107 PRBool is_server) { |
2108 #ifdef SSL_ENABLE_FALSE_START | |
2109 PRBool npn; | |
2110 SECStatus rv = | |
2111 SSL_HandshakeNegotiatedExtension(socket, ssl_next_proto_nego_xtn, &npn); | |
2112 if (rv != SECSuccess || !npn) { | |
2113 // If the server doesn't support NPN, then we don't do False Start with it. | |
2114 SSL_OptionSet(socket, SSL_ENABLE_FALSE_START, PR_FALSE); | |
2115 } | |
2116 #endif | |
2117 | |
2118 // Tell NSS to not verify the certificate. | 2108 // Tell NSS to not verify the certificate. |
2119 return SECSuccess; | 2109 return SECSuccess; |
2120 } | 2110 } |
2121 | 2111 |
2122 // static | 2112 // static |
2123 bool SSLClientSocketNSS::DomainBoundCertNegotiated(PRFileDesc* socket) { | 2113 bool SSLClientSocketNSS::DomainBoundCertNegotiated(PRFileDesc* socket) { |
2124 PRBool xtn_negotiated = PR_FALSE; | 2114 PRBool xtn_negotiated = PR_FALSE; |
2125 SECStatus rv = SSL_HandshakeNegotiatedExtension( | 2115 SECStatus rv = SSL_HandshakeNegotiatedExtension( |
2126 socket, ssl_ob_cert_xtn, &xtn_negotiated); | 2116 socket, ssl_ob_cert_xtn, &xtn_negotiated); |
2127 DCHECK_EQ(SECSuccess, rv); | 2117 DCHECK_EQ(SECSuccess, rv); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2656 EnsureThreadIdAssigned(); | 2646 EnsureThreadIdAssigned(); |
2657 base::AutoLock auto_lock(lock_); | 2647 base::AutoLock auto_lock(lock_); |
2658 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 2648 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
2659 } | 2649 } |
2660 | 2650 |
2661 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 2651 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
2662 return server_bound_cert_service_; | 2652 return server_bound_cert_service_; |
2663 } | 2653 } |
2664 | 2654 |
2665 } // namespace net | 2655 } // namespace net |
OLD | NEW |