Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: net/socket/ssl_client_socket_nss.cc

Issue 6792032: net: remove forced renegotiation checks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 user_read_buf_len_(0), 479 user_read_buf_len_(0),
480 user_write_buf_len_(0), 480 user_write_buf_len_(0),
481 server_cert_nss_(NULL), 481 server_cert_nss_(NULL),
482 server_cert_verify_result_(NULL), 482 server_cert_verify_result_(NULL),
483 ssl_connection_status_(0), 483 ssl_connection_status_(0),
484 client_auth_cert_needed_(false), 484 client_auth_cert_needed_(false),
485 cert_verifier_(cert_verifier), 485 cert_verifier_(cert_verifier),
486 handshake_callback_called_(false), 486 handshake_callback_called_(false),
487 completed_handshake_(false), 487 completed_handshake_(false),
488 pseudo_connected_(false), 488 pseudo_connected_(false),
489 eset_mitm_detected_(false), 489 eset_mitm_detected_(false),
wtc 2011/04/05 17:20:03 I guess we should keep eset_mitm_detected_ because
agl 2011/04/05 19:55:41 Yes, we still need the ESET MITM code.
490 predicted_cert_chain_correct_(false), 490 predicted_cert_chain_correct_(false),
491 peername_initialized_(false), 491 peername_initialized_(false),
492 dnssec_provider_(NULL), 492 dnssec_provider_(NULL),
493 next_handshake_state_(STATE_NONE), 493 next_handshake_state_(STATE_NONE),
494 nss_fd_(NULL), 494 nss_fd_(NULL),
495 nss_bufs_(NULL), 495 nss_bufs_(NULL),
496 net_log_(transport_socket->socket()->NetLog()), 496 net_log_(transport_socket->socket()->NetLog()),
497 predicted_npn_status_(kNextProtoUnsupported), 497 predicted_npn_status_(kNextProtoUnsupported),
498 predicted_npn_proto_used_(false), 498 predicted_npn_proto_used_(false),
499 ssl_host_info_(ssl_host_info), 499 ssl_host_info_(ssl_host_info),
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 #ifdef SSL_ENABLE_SNAP_START 976 #ifdef SSL_ENABLE_SNAP_START
977 // TODO(agl): check that SSL_ENABLE_SNAP_START actually does something in the 977 // TODO(agl): check that SSL_ENABLE_SNAP_START actually does something in the
978 // current NSS code. 978 // current NSS code.
979 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_SNAP_START, 979 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_SNAP_START,
980 ssl_config_.snap_start_enabled); 980 ssl_config_.snap_start_enabled);
981 if (rv != SECSuccess) 981 if (rv != SECSuccess)
982 VLOG(1) << "SSL_ENABLE_SNAP_START failed. Old system nss?"; 982 VLOG(1) << "SSL_ENABLE_SNAP_START failed. Old system nss?";
983 #endif 983 #endif
984 984
985 #ifdef SSL_ENABLE_RENEGOTIATION 985 #ifdef SSL_ENABLE_RENEGOTIATION
986 // Deliberately disable this check for now: http://crbug.com/55410 986 // We allow servers to request renegotiation. Since we're a client,
987 if (false && 987 // prohibiting this is rather a waste of time. Only servers are in a
988 SSLConfigService::IsKnownStrictTLSServer(host_and_port_.host()) && 988 // position to prevent renegotiation attacks.
989 !ssl_config_.mitm_proxies_allowed) { 989 // http://extendedsubset.com/?p=8
wtc 2011/04/05 17:20:03 Hmm... so this code has been disabled (by the 'fal
990 rv = SSL_OptionSet(nss_fd_, SSL_REQUIRE_SAFE_NEGOTIATION, PR_TRUE);
991 if (rv != SECSuccess) {
992 LogFailedNSSFunction(
993 net_log_, "SSL_OptionSet", "SSL_REQUIRE_SAFE_NEGOTIATION");
994 }
995 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_RENEGOTIATION,
996 SSL_RENEGOTIATE_REQUIRES_XTN);
997 } else {
998 // We allow servers to request renegotiation. Since we're a client,
999 // prohibiting this is rather a waste of time. Only servers are in a
1000 // position to prevent renegotiation attacks.
1001 // http://extendedsubset.com/?p=8
1002 990
1003 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_RENEGOTIATION, 991 rv = SSL_OptionSet(nss_fd_, SSL_ENABLE_RENEGOTIATION,
1004 SSL_RENEGOTIATE_TRANSITIONAL); 992 SSL_RENEGOTIATE_TRANSITIONAL);
1005 }
1006 if (rv != SECSuccess) { 993 if (rv != SECSuccess) {
1007 LogFailedNSSFunction( 994 LogFailedNSSFunction(
1008 net_log_, "SSL_OptionSet", "SSL_ENABLE_RENEGOTIATION"); 995 net_log_, "SSL_OptionSet", "SSL_ENABLE_RENEGOTIATION");
1009 } 996 }
1010 #endif // SSL_ENABLE_RENEGOTIATION 997 #endif // SSL_ENABLE_RENEGOTIATION
1011 998
1012 #ifdef SSL_NEXT_PROTO_NEGOTIATED 999 #ifdef SSL_NEXT_PROTO_NEGOTIATED
1013 if (!ssl_config_.next_protos.empty()) { 1000 if (!ssl_config_.next_protos.empty()) {
1014 rv = SSL_SetNextProtoNego( 1001 rv = SSL_SetNextProtoNego(
1015 nss_fd_, 1002 nss_fd_,
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 valid_thread_id_ = base::PlatformThread::CurrentId(); 2528 valid_thread_id_ = base::PlatformThread::CurrentId();
2542 } 2529 }
2543 2530
2544 bool SSLClientSocketNSS::CalledOnValidThread() const { 2531 bool SSLClientSocketNSS::CalledOnValidThread() const {
2545 EnsureThreadIdAssigned(); 2532 EnsureThreadIdAssigned();
2546 base::AutoLock auto_lock(lock_); 2533 base::AutoLock auto_lock(lock_);
2547 return valid_thread_id_ == base::PlatformThread::CurrentId(); 2534 return valid_thread_id_ == base::PlatformThread::CurrentId();
2548 } 2535 }
2549 2536
2550 } // namespace net 2537 } // namespace net
OLDNEW
« net/http/http_stream_factory_impl_job.cc ('K') | « net/http/http_stream_factory_impl_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698