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

Side by Side Diff: net/test/spawned_test_server/base_test_server.cc

Issue 994373004: Properly handle alerts from the peer in SSL_read. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "net/test/spawned_test_server/base_test_server.h" 5 #include "net/test/spawned_test_server/base_test_server.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 request_client_certificate(false), 98 request_client_certificate(false),
99 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), 99 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY),
100 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), 100 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY),
101 record_resume(false), 101 record_resume(false),
102 tls_intolerant(TLS_INTOLERANT_NONE), 102 tls_intolerant(TLS_INTOLERANT_NONE),
103 tls_intolerance_type(TLS_INTOLERANCE_ALERT), 103 tls_intolerance_type(TLS_INTOLERANCE_ALERT),
104 fallback_scsv_enabled(false), 104 fallback_scsv_enabled(false),
105 staple_ocsp_response(false), 105 staple_ocsp_response(false),
106 ocsp_server_unavailable(false), 106 ocsp_server_unavailable(false),
107 enable_npn(false), 107 enable_npn(false),
108 disable_session_cache(false) { 108 disable_session_cache(false),
109 alert_after_handshake(false) {
109 } 110 }
110 111
111 BaseTestServer::SSLOptions::SSLOptions( 112 BaseTestServer::SSLOptions::SSLOptions(
112 BaseTestServer::SSLOptions::ServerCertificate cert) 113 BaseTestServer::SSLOptions::ServerCertificate cert)
113 : server_certificate(cert), 114 : server_certificate(cert),
114 ocsp_status(OCSP_OK), 115 ocsp_status(OCSP_OK),
115 cert_serial(0), 116 cert_serial(0),
116 request_client_certificate(false), 117 request_client_certificate(false),
117 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), 118 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY),
118 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), 119 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY),
119 record_resume(false), 120 record_resume(false),
120 tls_intolerant(TLS_INTOLERANT_NONE), 121 tls_intolerant(TLS_INTOLERANT_NONE),
121 tls_intolerance_type(TLS_INTOLERANCE_ALERT), 122 tls_intolerance_type(TLS_INTOLERANCE_ALERT),
122 fallback_scsv_enabled(false), 123 fallback_scsv_enabled(false),
123 staple_ocsp_response(false), 124 staple_ocsp_response(false),
124 ocsp_server_unavailable(false), 125 ocsp_server_unavailable(false),
125 enable_npn(false), 126 enable_npn(false),
126 disable_session_cache(false) { 127 disable_session_cache(false),
128 alert_after_handshake(false) {
127 } 129 }
128 130
129 BaseTestServer::SSLOptions::~SSLOptions() {} 131 BaseTestServer::SSLOptions::~SSLOptions() {}
130 132
131 base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const { 133 base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const {
132 switch (server_certificate) { 134 switch (server_certificate) {
133 case CERT_OK: 135 case CERT_OK:
134 case CERT_MISMATCHED_NAME: 136 case CERT_MISMATCHED_NAME:
135 return base::FilePath(FILE_PATH_LITERAL("ok_cert.pem")); 137 return base::FilePath(FILE_PATH_LITERAL("ok_cert.pem"));
136 case CERT_EXPIRED: 138 case CERT_EXPIRED:
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 if (ssl_options_.staple_ocsp_response) 483 if (ssl_options_.staple_ocsp_response)
482 arguments->Set("staple-ocsp-response", base::Value::CreateNullValue()); 484 arguments->Set("staple-ocsp-response", base::Value::CreateNullValue());
483 if (ssl_options_.ocsp_server_unavailable) { 485 if (ssl_options_.ocsp_server_unavailable) {
484 arguments->Set("ocsp-server-unavailable", 486 arguments->Set("ocsp-server-unavailable",
485 base::Value::CreateNullValue()); 487 base::Value::CreateNullValue());
486 } 488 }
487 if (ssl_options_.enable_npn) 489 if (ssl_options_.enable_npn)
488 arguments->Set("enable-npn", base::Value::CreateNullValue()); 490 arguments->Set("enable-npn", base::Value::CreateNullValue());
489 if (ssl_options_.disable_session_cache) 491 if (ssl_options_.disable_session_cache)
490 arguments->Set("disable-session-cache", base::Value::CreateNullValue()); 492 arguments->Set("disable-session-cache", base::Value::CreateNullValue());
493 if (ssl_options_.alert_after_handshake)
494 arguments->Set("alert-after-handshake", base::Value::CreateNullValue());
491 } 495 }
492 496
493 return GenerateAdditionalArguments(arguments); 497 return GenerateAdditionalArguments(arguments);
494 } 498 }
495 499
496 bool BaseTestServer::GenerateAdditionalArguments( 500 bool BaseTestServer::GenerateAdditionalArguments(
497 base::DictionaryValue* arguments) const { 501 base::DictionaryValue* arguments) const {
498 return true; 502 return true;
499 } 503 }
500 504
501 } // namespace net 505 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698