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

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: fix CrOS tests 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
« no previous file with comments | « net/test/spawned_test_server/base_test_server.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 cert_serial(0), 97 cert_serial(0),
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 alert_after_handshake(false) {
108 } 109 }
109 110
110 BaseTestServer::SSLOptions::SSLOptions( 111 BaseTestServer::SSLOptions::SSLOptions(
111 BaseTestServer::SSLOptions::ServerCertificate cert) 112 BaseTestServer::SSLOptions::ServerCertificate cert)
112 : server_certificate(cert), 113 : server_certificate(cert),
113 ocsp_status(OCSP_OK), 114 ocsp_status(OCSP_OK),
114 cert_serial(0), 115 cert_serial(0),
115 request_client_certificate(false), 116 request_client_certificate(false),
116 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), 117 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY),
117 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), 118 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY),
118 record_resume(false), 119 record_resume(false),
119 tls_intolerant(TLS_INTOLERANT_NONE), 120 tls_intolerant(TLS_INTOLERANT_NONE),
120 tls_intolerance_type(TLS_INTOLERANCE_ALERT), 121 tls_intolerance_type(TLS_INTOLERANCE_ALERT),
121 fallback_scsv_enabled(false), 122 fallback_scsv_enabled(false),
122 staple_ocsp_response(false), 123 staple_ocsp_response(false),
123 ocsp_server_unavailable(false), 124 ocsp_server_unavailable(false),
124 enable_npn(false) { 125 enable_npn(false),
126 alert_after_handshake(false) {
125 } 127 }
126 128
127 BaseTestServer::SSLOptions::~SSLOptions() {} 129 BaseTestServer::SSLOptions::~SSLOptions() {}
128 130
129 base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const { 131 base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const {
130 switch (server_certificate) { 132 switch (server_certificate) {
131 case CERT_OK: 133 case CERT_OK:
132 case CERT_MISMATCHED_NAME: 134 case CERT_MISMATCHED_NAME:
133 return base::FilePath(FILE_PATH_LITERAL("ok_cert.pem")); 135 return base::FilePath(FILE_PATH_LITERAL("ok_cert.pem"));
134 case CERT_EXPIRED: 136 case CERT_EXPIRED:
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 arguments->SetString("signed-cert-timestamps-tls-ext", b64_scts_tls_ext); 479 arguments->SetString("signed-cert-timestamps-tls-ext", b64_scts_tls_ext);
478 } 480 }
479 if (ssl_options_.staple_ocsp_response) 481 if (ssl_options_.staple_ocsp_response)
480 arguments->Set("staple-ocsp-response", base::Value::CreateNullValue()); 482 arguments->Set("staple-ocsp-response", base::Value::CreateNullValue());
481 if (ssl_options_.ocsp_server_unavailable) { 483 if (ssl_options_.ocsp_server_unavailable) {
482 arguments->Set("ocsp-server-unavailable", 484 arguments->Set("ocsp-server-unavailable",
483 base::Value::CreateNullValue()); 485 base::Value::CreateNullValue());
484 } 486 }
485 if (ssl_options_.enable_npn) 487 if (ssl_options_.enable_npn)
486 arguments->Set("enable-npn", base::Value::CreateNullValue()); 488 arguments->Set("enable-npn", base::Value::CreateNullValue());
489 if (ssl_options_.alert_after_handshake)
490 arguments->Set("alert-after-handshake", base::Value::CreateNullValue());
487 } 491 }
488 492
489 return GenerateAdditionalArguments(arguments); 493 return GenerateAdditionalArguments(arguments);
490 } 494 }
491 495
492 bool BaseTestServer::GenerateAdditionalArguments( 496 bool BaseTestServer::GenerateAdditionalArguments(
493 base::DictionaryValue* arguments) const { 497 base::DictionaryValue* arguments) const {
494 return true; 498 return true;
495 } 499 }
496 500
497 } // namespace net 501 } // namespace net
OLDNEW
« no previous file with comments | « net/test/spawned_test_server/base_test_server.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698