Debian Codegraph @

crt/s2n/tests/unit/s2n_client_renegotiation_info_extension_test.c

raw symbols SCIP
1 /*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 #include "s2n_test.h"
17 #include "testlib/s2n_testlib.h"
18 #include "tls/extensions/s2n_client_renegotiation_info.h"
19 #include "tls/s2n_tls.h"
20
21 int s2n_parse_client_hello(struct s2n_connection *conn);
22
23 int main(int argc, char **argv)
24 {
25 BEGIN_TEST();
26 EXPECT_SUCCESS(s2n_disable_tls13_in_test());
27
28 const uint8_t renegotiation_info_scsv_iana[] = { TLS_EMPTY_RENEGOTIATION_INFO_SCSV };
29 const uint8_t client_verify_data[] = "client verify data";
30
31 DEFER_CLEANUP(struct s2n_cert_chain_and_key *chain_and_key = NULL, s2n_cert_chain_and_key_ptr_free);
32 EXPECT_SUCCESS(s2n_test_cert_chain_and_key_new(&chain_and_key,
33 S2N_DEFAULT_TEST_CERT_CHAIN, S2N_DEFAULT_TEST_PRIVATE_KEY));
34
35 DEFER_CLEANUP(struct s2n_config *config = s2n_config_new(), s2n_config_ptr_free);
36 EXPECT_NOT_NULL(config);
37 EXPECT_OK(s2n_config_set_tls12_security_policy(config));
38 EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(config, chain_and_key));
39
40 /* Test receive - too much data */
41 {
42 struct s2n_connection *conn = NULL;
43 EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
44
45 struct s2n_stuffer stuffer = { 0 };
46 EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));
47
48 EXPECT_SUCCESS(s2n_stuffer_write_uint16(&stuffer, 0));
49
50 EXPECT_FAILURE_WITH_ERRNO(s2n_client_renegotiation_info_extension.recv(conn, &stuffer),
51 S2N_ERR_NON_EMPTY_RENEGOTIATION_INFO);
52 EXPECT_FALSE(conn->secure_renegotiation);
53
54 EXPECT_SUCCESS(s2n_stuffer_free(&stuffer));
55 EXPECT_SUCCESS(s2n_connection_free(conn));
56 };
57
58 /* Test receive - value not 0
59 *
60 *= https://www.rfc-editor.org/rfc/rfc5746#3.6
61 *= type=test
62 *# The server MUST then verify
63 *# that the length of the "renegotiated_connection" field is zero,
64 *# and if it is not, MUST abort the handshake.
65 */
66 {
67 struct s2n_connection *conn = NULL;
68 EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
69
70 struct s2n_stuffer stuffer = { 0 };
71 EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));
72
73 EXPECT_SUCCESS(s2n_stuffer_write_uint8(&stuffer, 1));
74
75 EXPECT_FAILURE_WITH_ERRNO(s2n_client_renegotiation_info_extension.recv(conn, &stuffer),
76 S2N_ERR_NON_EMPTY_RENEGOTIATION_INFO);
77 EXPECT_FALSE(conn->secure_renegotiation);
78
79 EXPECT_SUCCESS(s2n_stuffer_free(&stuffer));
80 EXPECT_SUCCESS(s2n_connection_free(conn));
81 };
82
83 /* Test receive */
84 {
85 struct s2n_connection *conn = NULL;
86 EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
87
88 struct s2n_stuffer stuffer = { 0 };
89 EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));
90
91 EXPECT_SUCCESS(s2n_stuffer_write_uint8(&stuffer, 0));
92
93 EXPECT_SUCCESS(s2n_client_renegotiation_info_extension.recv(conn, &stuffer));
94 EXPECT_TRUE(conn->secure_renegotiation);
95
96 EXPECT_SUCCESS(s2n_stuffer_free(&stuffer));
97 EXPECT_SUCCESS(s2n_connection_free(conn));
98 };
99
100 /* Test receive when using SSLv3
101 *
102 *= https://www.rfc-editor.org/rfc/rfc5746#4.5
103 *= type=test
104 *# TLS servers that support secure renegotiation and support SSLv3 MUST accept SCSV or the
105 *# "renegotiation_info" extension and respond as described in this
106 *# specification even if the offered client version is {0x03, 0x00}.
107 **/
108 {
109 DEFER_CLEANUP(struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER),
110 s2n_connection_ptr_free);
111 EXPECT_NOT_NULL(server_conn);
112
113 DEFER_CLEANUP(struct s2n_stuffer extension = { 0 }, s2n_stuffer_free);
114 EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&extension, 0));
115 EXPECT_SUCCESS(s2n_stuffer_write_uint8(&extension, 0));
116
117 server_conn->server_protocol_version = S2N_SSLv3;
118 server_conn->actual_protocol_version = S2N_SSLv3;
119 EXPECT_SUCCESS(s2n_client_renegotiation_info_extension.recv(server_conn, &extension));
120 EXPECT_TRUE(server_conn->secure_renegotiation);
121 };
122
123 /*
124 *= https://www.rfc-editor.org/rfc/rfc5746#3.4
125 *= type=test
126 *# o The client MUST include either an empty "renegotiation_info"
127 *# extension, or the TLS_EMPTY_RENEGOTIATION_INFO_SCSV signaling
128 *# cipher suite value in the ClientHello. Including both is NOT
129 *# RECOMMENDED.
130 */
131 {
132 DEFER_CLEANUP(struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT),
133 s2n_connection_ptr_free);
134 EXPECT_NOT_NULL(client_conn);
135 EXPECT_OK(s2n_connection_set_tls12_security_policy(client_conn));
136
137 DEFER_CLEANUP(struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER),
138 s2n_connection_ptr_free);
139 EXPECT_NOT_NULL(server_conn);
140 EXPECT_OK(s2n_connection_set_tls12_security_policy(server_conn));
141
142 /* Process the client hello on the server */
143 EXPECT_SUCCESS(s2n_client_hello_send(client_conn));
144 EXPECT_SUCCESS(s2n_stuffer_copy(&client_conn->handshake.io, &server_conn->handshake.io,
145 s2n_stuffer_data_available(&client_conn->handshake.io)));
146 EXPECT_SUCCESS(s2n_parse_client_hello(server_conn));
147
148 /* Expect TLS_EMPTY_RENEGOTIATION_INFO_SCSV */
149 bool found_renegotiation_info_scsv = false;
150 for (size_t i = 0; i < server_conn->client_hello.cipher_suites.size; i += S2N_TLS_CIPHER_SUITE_LEN) {
151 uint8_t *iana = server_conn->client_hello.cipher_suites.data + i;
152 if (memcmp(iana, renegotiation_info_scsv_iana, S2N_TLS_CIPHER_SUITE_LEN) == 0) {
153 found_renegotiation_info_scsv = true;
154 }
155 }
156 EXPECT_TRUE(found_renegotiation_info_scsv);
157
158 /* Do NOT expect "renegotiation_info" extension */
159 s2n_extension_type_id extension_id = 0;
160 EXPECT_SUCCESS(s2n_extension_supported_iana_value_to_id(
161 s2n_client_renegotiation_info_extension.iana_value, &extension_id));
162 s2n_parsed_extension *extension = &server_conn->client_hello.extensions.parsed_extensions[extension_id];
163 EXPECT_EQUAL(extension->extension.size, 0);
164 EXPECT_EQUAL(extension->extension_type, 0);
165 };
166
167 /**
168 *= https://www.rfc-editor.org/rfc/rfc5746#3.6
169 *= type=test
170 *# o The server MUST check if the "renegotiation_info" extension is
171 *# included in the ClientHello.
172 */
173 {
174 DEFER_CLEANUP(struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT),
175 s2n_connection_ptr_free);
176 EXPECT_NOT_NULL(client_conn);
177 EXPECT_OK(s2n_connection_set_tls12_security_policy(client_conn));
178
179 DEFER_CLEANUP(struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER),
180 s2n_connection_ptr_free);
181 EXPECT_NOT_NULL(server_conn);
182 EXPECT_OK(s2n_connection_set_tls12_security_policy(server_conn));
183
184 /* s2n-tls clients do not send the "renegotiation_info" extension.
185 * Instead, they send the TLS_EMPTY_RENEGOTIATION_INFO_SCSV cipher suite.
186 * See previous test.
187 */
188 EXPECT_SUCCESS(s2n_client_hello_send(client_conn));
189
190 /* Process the extensions on the server */
191 EXPECT_SUCCESS(s2n_stuffer_copy(&client_conn->handshake.io, &server_conn->handshake.io,
192 s2n_stuffer_data_available(&client_conn->handshake.io)));
193 EXPECT_SUCCESS(s2n_parse_client_hello(server_conn));
194 EXPECT_SUCCESS(s2n_extension_list_process(S2N_EXTENSION_LIST_CLIENT_HELLO, server_conn,
195 &server_conn->client_hello.extensions));
196
197 /* Expect secure renegotiation to still be false: no extension received */
198 EXPECT_FALSE(server_conn->secure_renegotiation);
199
200 /* Manually append the "renegotiation_info" extension to the original list. */
201 uint8_t extension[] = {
202 0xff, 0x01, /* extension type: renegotiation_info */
203 0x00, 0x01, /* extension length: 1 */
204 0x00, /* renegotiated_connection length: 0 */
205 };
206 size_t client_hello_size = server_conn->client_hello.raw_message.size;
207 size_t old_extensions_size = server_conn->client_hello.extensions.raw.size;
208 size_t new_extensions_size = old_extensions_size + sizeof(extension);
209 EXPECT_SUCCESS(s2n_stuffer_rewrite(&client_conn->handshake.io));
210 EXPECT_SUCCESS(s2n_stuffer_skip_write(&client_conn->handshake.io,
211 client_hello_size - old_extensions_size - sizeof(uint16_t)));
212 EXPECT_SUCCESS(s2n_stuffer_write_uint16(&client_conn->handshake.io, new_extensions_size));
213 EXPECT_SUCCESS(s2n_stuffer_skip_write(&client_conn->handshake.io, old_extensions_size));
214 EXPECT_SUCCESS(s2n_stuffer_write_bytes(&client_conn->handshake.io, extension, sizeof(extension)));
215
216 /* Process the extensions on the server again */
217 EXPECT_SUCCESS(s2n_connection_wipe(server_conn));
218 EXPECT_SUCCESS(s2n_stuffer_copy(&client_conn->handshake.io, &server_conn->handshake.io,
219 s2n_stuffer_data_available(&client_conn->handshake.io)));
220 EXPECT_SUCCESS(s2n_parse_client_hello(server_conn));
221 EXPECT_SUCCESS(s2n_extension_list_process(S2N_EXTENSION_LIST_CLIENT_HELLO, server_conn,
222 &server_conn->client_hello.extensions));
223
224 /* Expect secure renegotiation to be true: extension received */
225 EXPECT_TRUE(server_conn->secure_renegotiation);
226 };
227
228 /* Test: should_send during renegotiation handshake
229 *
230 *= https://www.rfc-editor.org/rfc/rfc5746#3.5
231 *= type=test
232 *# o The client MUST include the "renegotiation_info" extension in the
233 *# ClientHello
234 */
235 {
236 DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_CLIENT),
237 s2n_connection_ptr_free);
238 EXPECT_NOT_NULL(conn);
239
240 /* Not included by default */
241 EXPECT_FALSE(s2n_client_renegotiation_info_extension.should_send(conn));
242
243 /* Included if renegotiation enabled */
244 conn->handshake.renegotiation = true;
245 EXPECT_TRUE(s2n_client_renegotiation_info_extension.should_send(conn));
246 };
247
248 /* Test: send during renegotiation handshake
249 *
250 *= https://www.rfc-editor.org/rfc/rfc5746#3.5
251 *= type=test
252 *# o The client MUST include the "renegotiation_info" extension in the
253 *# ClientHello, containing the saved client_verify_data.
254 */
255 {
256 /* Send client_verify_data */
257 {
258 DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_CLIENT),
259 s2n_connection_ptr_free);
260 EXPECT_NOT_NULL(conn);
261 conn->handshake.renegotiation = true;
262
263 /* Setup client_verify_data */
264 EXPECT_MEMCPY_SUCCESS(conn->handshake.client_finished,
265 client_verify_data, sizeof(client_verify_data));
266 conn->handshake.finished_len = sizeof(client_verify_data);
267
268 /* Error if secure renegotiation not supported */
269 {
270 conn->secure_renegotiation = false;
271
272 DEFER_CLEANUP(struct s2n_stuffer out = { 0 }, s2n_stuffer_free);
273 EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&out, 0));
274 EXPECT_FAILURE_WITH_ERRNO(s2n_client_renegotiation_info_extension.send(conn, &out),
275 S2N_ERR_NO_RENEGOTIATION);
276 };
277
278 /* Success if secure renegotiation supported */
279 {
280 conn->secure_renegotiation = true;
281
282 DEFER_CLEANUP(struct s2n_stuffer out = { 0 }, s2n_stuffer_free);
283 EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&out, 0));
284 EXPECT_SUCCESS(s2n_client_renegotiation_info_extension.send(conn, &out));
285
286 uint8_t actual_len = 0;
287 EXPECT_SUCCESS(s2n_stuffer_read_uint8(&out, &actual_len));
288 EXPECT_EQUAL(actual_len, sizeof(client_verify_data));
289
290 uint8_t *actual_data = s2n_stuffer_raw_read(&out, actual_len);
291 EXPECT_BYTEARRAY_EQUAL(actual_data, client_verify_data, actual_len);
292 };
293 };
294
295 /*
296 *= https://www.rfc-editor.org/rfc/rfc5746#3.5
297 *= type=test
298 *# The SCSV MUST NOT be included.
299 */
300 {
301 DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_CLIENT),
302 s2n_connection_ptr_free);
303 EXPECT_NOT_NULL(conn);
304 EXPECT_OK(s2n_connection_set_tls12_security_policy(conn));
305
306 conn->secure_renegotiation = true;
307 conn->handshake.renegotiation = true;
308
309 /* Setup client_verify_data */
310 EXPECT_MEMCPY_SUCCESS(conn->handshake.client_finished,
311 client_verify_data, sizeof(client_verify_data));
312 conn->handshake.finished_len = sizeof(client_verify_data);
313
314 EXPECT_SUCCESS(s2n_client_hello_send(conn));
315 EXPECT_SUCCESS(s2n_parse_client_hello(conn));
316
317 /* Expect TLS_EMPTY_RENEGOTIATION_INFO_SCSV */
318 bool found_renegotiation_info_scsv = false;
319 for (size_t i = 0; i < conn->client_hello.cipher_suites.size; i += S2N_TLS_CIPHER_SUITE_LEN) {
320 uint8_t *iana = conn->client_hello.cipher_suites.data + i;
321 if (memcmp(iana, renegotiation_info_scsv_iana, S2N_TLS_CIPHER_SUITE_LEN) == 0) {
322 found_renegotiation_info_scsv = true;
323 }
324 }
325 EXPECT_FALSE(found_renegotiation_info_scsv);
326 };
327 };
328
329 /* Test: recv during renegotiation handshake
330 *
331 *= https://www.rfc-editor.org/rfc/rfc5746#3.7
332 *= type=test
333 *# o The server MUST verify that the value of the
334 *# "renegotiated_connection" field is equal to the saved
335 *# client_verify_data value; if it is not, the server MUST abort the
336 *# handshake.
337 */
338 {
339 DEFER_CLEANUP(struct s2n_connection *client_conn = s2n_connection_new(S2N_SERVER),
340 s2n_connection_ptr_free);
341 EXPECT_NOT_NULL(client_conn);
342 client_conn->handshake.renegotiation = true;
343 client_conn->secure_renegotiation = true;
344
345 DEFER_CLEANUP(struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER),
346 s2n_connection_ptr_free);
347 EXPECT_NOT_NULL(server_conn);
348 server_conn->handshake.renegotiation = true;
349 server_conn->secure_renegotiation = true;
350
351 DEFER_CLEANUP(struct s2n_stuffer stuffer = { 0 }, s2n_stuffer_free);
352 EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0));
353
354 EXPECT_MEMCPY_SUCCESS(client_conn->handshake.client_finished,
355 client_verify_data, sizeof(client_verify_data));
356 client_conn->handshake.finished_len = sizeof(client_verify_data);
357
358 /* Test: client_verify matches */
359 {
360 EXPECT_MEMCPY_SUCCESS(server_conn->handshake.client_finished,
361 client_verify_data, sizeof(client_verify_data));
362 server_conn->handshake.finished_len = sizeof(client_verify_data);
363
364 EXPECT_SUCCESS(s2n_client_renegotiation_info_extension.send(client_conn, &stuffer));
365 EXPECT_SUCCESS(s2n_client_renegotiation_info_extension.recv(server_conn, &stuffer));
366 };
367
368 /* Test: client_verify does not match */
369 {
370 const uint8_t bad_client_verify[] = "not correct";
371
372 EXPECT_MEMCPY_SUCCESS(server_conn->handshake.client_finished,
373 bad_client_verify, sizeof(bad_client_verify));
374 server_conn->handshake.finished_len = sizeof(bad_client_verify);
375
376 EXPECT_SUCCESS(s2n_client_renegotiation_info_extension.send(client_conn, &stuffer));
377 EXPECT_FAILURE_WITH_ERRNO(s2n_client_renegotiation_info_extension.recv(server_conn, &stuffer),
378 S2N_ERR_BAD_MESSAGE);
379 };
380
381 /* Test: no secure_renegotiation */
382 {
383 server_conn->secure_renegotiation = false;
384
385 EXPECT_MEMCPY_SUCCESS(server_conn->handshake.client_finished,
386 client_verify_data, sizeof(client_verify_data));
387 server_conn->handshake.finished_len = sizeof(client_verify_data);
388
389 EXPECT_SUCCESS(s2n_client_renegotiation_info_extension.send(client_conn, &stuffer));
390 EXPECT_FAILURE_WITH_ERRNO(s2n_client_renegotiation_info_extension.recv(server_conn, &stuffer),
391 S2N_ERR_NO_RENEGOTIATION);
392 };
393 };
394
395 /* Test: if_missing during renegotiation handshake
396 *
397 *= https://www.rfc-editor.org/rfc/rfc5746#3.7
398 *= type=test
399 *# o The server MUST verify that the "renegotiation_info" extension is
400 *# present; if it is not, the server MUST abort the handshake.
401 */
402 {
403 DEFER_CLEANUP(struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT),
404 s2n_connection_ptr_free);
405 EXPECT_NOT_NULL(client_conn);
406 EXPECT_OK(s2n_connection_set_tls12_security_policy(client_conn));
407 client_conn->handshake.renegotiation = false;
408
409 DEFER_CLEANUP(struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER),
410 s2n_connection_ptr_free);
411 EXPECT_NOT_NULL(server_conn);
412 EXPECT_OK(s2n_connection_set_tls12_security_policy(server_conn));
413 server_conn->handshake.renegotiation = true;
414 server_conn->secure_renegotiation = true;
415
416 EXPECT_SUCCESS(s2n_client_hello_send(client_conn));
417 EXPECT_SUCCESS(s2n_stuffer_copy(&client_conn->handshake.io, &server_conn->handshake.io,
418 s2n_stuffer_data_available(&client_conn->handshake.io)));
419
420 /* Verify if_missing throws error */
421 EXPECT_FAILURE_WITH_ERRNO(s2n_client_renegotiation_info_extension.if_missing(server_conn),
422 S2N_ERR_MISSING_EXTENSION);
423
424 /* Verify server marks extension as missing when processing client hello */
425 EXPECT_FAILURE_WITH_ERRNO(s2n_client_hello_recv(server_conn), S2N_ERR_MISSING_EXTENSION);
426 };
427
428 /* Test: receiving SCSV during renegotiation is an error
429 *
430 *= https://www.rfc-editor.org/rfc/rfc5746#3.7
431 *= type=test
432 *# o When a ClientHello is received, the server MUST verify that it
433 *# does not contain the TLS_EMPTY_RENEGOTIATION_INFO_SCSV SCSV. If
434 *# the SCSV is present, the server MUST abort the handshake.
435 */
436 {
437 DEFER_CLEANUP(struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT),
438 s2n_connection_ptr_free);
439 EXPECT_NOT_NULL(client_conn);
440 EXPECT_OK(s2n_connection_set_tls12_security_policy(client_conn));
441 client_conn->secure_renegotiation = true;
442
443 DEFER_CLEANUP(struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER),
444 s2n_connection_ptr_free);
445 EXPECT_NOT_NULL(server_conn);
446 EXPECT_SUCCESS(s2n_connection_set_config(server_conn, config));
447 server_conn->secure_renegotiation = true;
448
449 /* Construct a security policy that will write the SCSV like a regular cipher suite */
450 struct s2n_cipher_suite forced_scsv = {
451 .available = true,
452 .iana_value = { TLS_EMPTY_RENEGOTIATION_INFO_SCSV },
453 };
454 struct s2n_cipher_suite *cipher_suites[] = {
455 &forced_scsv,
456 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256
457 };
458 struct s2n_cipher_preferences cipher_preferences = { .suites = cipher_suites, .count = s2n_array_len(cipher_suites) };
459 struct s2n_security_policy security_policy = *config->security_policy;
460 security_policy.cipher_preferences = &cipher_preferences;
461 client_conn->security_policy_override = &security_policy;
462
463 /* Succeeds if server expects an initial handshake */
464 EXPECT_SUCCESS(s2n_client_hello_send(client_conn));
465 EXPECT_SUCCESS(s2n_stuffer_copy(&client_conn->handshake.io, &server_conn->handshake.io,
466 s2n_stuffer_data_available(&client_conn->handshake.io)));
467 EXPECT_SUCCESS(s2n_client_hello_recv(server_conn));
468
469 client_conn->handshake.renegotiation = true;
470 EXPECT_MEMCPY_SUCCESS(client_conn->handshake.client_finished,
471 client_verify_data, sizeof(client_verify_data));
472 client_conn->handshake.finished_len = sizeof(client_verify_data);
473
474 server_conn->handshake.renegotiation = true;
475 EXPECT_MEMCPY_SUCCESS(server_conn->handshake.client_finished,
476 client_verify_data, sizeof(client_verify_data));
477 server_conn->handshake.finished_len = sizeof(client_verify_data);
478
479 /* Fails if server expects renegotiation */
480 EXPECT_SUCCESS(s2n_client_hello_send(client_conn));
481 EXPECT_SUCCESS(s2n_stuffer_copy(&client_conn->handshake.io, &server_conn->handshake.io,
482 s2n_stuffer_data_available(&client_conn->handshake.io)));
483 EXPECT_FAILURE_WITH_ERRNO(s2n_client_hello_recv(server_conn), S2N_ERR_BAD_MESSAGE);
484 };
485
486 END_TEST();
487 }