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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 i != ssl_config_.next_protos.end(); i++) { | 996 i != ssl_config_.next_protos.end(); i++) { |
997 if (i->size() > 255) | 997 if (i->size() > 255) |
998 continue; | 998 continue; |
999 *dst++ = i->size(); | 999 *dst++ = i->size(); |
1000 memcpy(dst, i->data(), i->size()); | 1000 memcpy(dst, i->data(), i->size()); |
1001 dst += i->size(); | 1001 dst += i->size(); |
1002 } | 1002 } |
1003 DCHECK_EQ(dst, wire_protos.get() + wire_length); | 1003 DCHECK_EQ(dst, wire_protos.get() + wire_length); |
1004 rv = SSL_SetNextProtoNego(nss_fd_, wire_protos.get(), wire_length); | 1004 rv = SSL_SetNextProtoNego(nss_fd_, wire_protos.get(), wire_length); |
1005 if (rv != SECSuccess) | 1005 if (rv != SECSuccess) |
1006 LogFailedNSSFunction(*weak_net_log_, "SSL_SetNextProtoCallback", ""); | 1006 LogFailedNSSFunction(*weak_net_log_, "SSL_SetNextProtoNego", ""); |
| 1007 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_ALPN, PR_TRUE); |
| 1008 if (rv != SECSuccess) |
| 1009 LogFailedNSSFunction(*weak_net_log_, "SSL_OptionSet", "SSL_ENABLE_ALPN"); |
| 1010 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_NPN, PR_TRUE); |
| 1011 if (rv != SECSuccess) |
| 1012 LogFailedNSSFunction(*weak_net_log_, "SSL_OptionSet", "SSL_ENABLE_NPN"); |
1007 } | 1013 } |
1008 | 1014 |
1009 rv = SSL_AuthCertificateHook( | 1015 rv = SSL_AuthCertificateHook( |
1010 nss_fd_, SSLClientSocketNSS::Core::OwnAuthCertHandler, this); | 1016 nss_fd_, SSLClientSocketNSS::Core::OwnAuthCertHandler, this); |
1011 if (rv != SECSuccess) { | 1017 if (rv != SECSuccess) { |
1012 LogFailedNSSFunction(*weak_net_log_, "SSL_AuthCertificateHook", ""); | 1018 LogFailedNSSFunction(*weak_net_log_, "SSL_AuthCertificateHook", ""); |
1013 return false; | 1019 return false; |
1014 } | 1020 } |
1015 | 1021 |
1016 #if defined(NSS_PLATFORM_CLIENT_AUTH) | 1022 #if defined(NSS_PLATFORM_CLIENT_AUTH) |
(...skipping 2559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3576 SignedCertificateTimestampAndStatus(*iter, | 3582 SignedCertificateTimestampAndStatus(*iter, |
3577 ct::SCT_STATUS_LOG_UNKNOWN)); | 3583 ct::SCT_STATUS_LOG_UNKNOWN)); |
3578 } | 3584 } |
3579 } | 3585 } |
3580 | 3586 |
3581 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3587 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
3582 return server_bound_cert_service_; | 3588 return server_bound_cert_service_; |
3583 } | 3589 } |
3584 | 3590 |
3585 } // namespace net | 3591 } // namespace net |
OLD | NEW |