Lines Matching +full:use +full:- +full:handshake
2 # Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
9 use strict;
10 use OpenSSL::Test qw/:DEFAULT cmdstr srctop_file srctop_dir bldtop_dir/;
11 use OpenSSL::Test::Utils;
12 use File::Temp qw(tempfile);
13 use TLSProxy::Proxy;
14 use checkhandshake qw(checkhandshake @handmessages @extensions);
23 if disabled("engine") || disabled("dynamic-engine");
202 my $proxy = TLSProxy::Proxy->new(
209 #Test 1: Check we get all the right messages for a default handshake
211 $proxy->serverconnects(2);
212 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
213 $proxy->clientflags("-no_rx_cert_comp -sess_out ".$session);
214 $proxy->sessionfile($session);
215 $proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
219 "Default handshake test");
221 #Test 2: Resumption handshake
222 $proxy->clearClient();
223 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
224 $proxy->clientflags("-no_rx_cert_comp -sess_in ".$session);
225 $proxy->clientstart();
230 "Resumption handshake test");
235 #Test 3: A status_request handshake (client request only)
236 $proxy->clear();
237 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
238 $proxy->clientflags("-no_rx_cert_comp -status");
239 $proxy->start();
243 "status_request handshake test (client)");
245 #Test 4: A status_request handshake (server support only)
246 $proxy->clear();
247 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
248 $proxy->clientflags("-no_rx_cert_comp");
249 $proxy->serverflags("-no_rx_cert_comp -status_file "
250 .srctop_file("test", "recipes", "ocsp-response.der"));
251 $proxy->start();
254 "status_request handshake test (server)");
256 #Test 5: A status_request handshake (client and server)
257 $proxy->clear();
258 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
259 $proxy->clientflags("-no_rx_cert_comp -status");
260 $proxy->serverflags("-no_rx_cert_comp -status_file "
261 .srctop_file("test", "recipes", "ocsp-response.der"));
262 $proxy->start();
267 "status_request handshake test");
269 #Test 6: A status_request handshake (client and server) with client auth
270 $proxy->clear();
271 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
272 $proxy->clientflags("-no_rx_cert_comp -status -enable_pha -cert "
274 $proxy->serverflags("-no_rx_cert_comp -Verify 5 -status_file "
275 .srctop_file("test", "recipes", "ocsp-response.der"));
276 $proxy->start();
282 "status_request handshake with client auth test");
285 #Test 7: A client auth handshake
286 $proxy->clear();
287 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
288 $proxy->clientflags("-no_rx_cert_comp -enable_pha -cert ".srctop_file("apps", "server.pem"));
289 $proxy->serverflags("-no_rx_cert_comp -Verify 5");
290 $proxy->start();
294 "Client auth handshake test");
296 #Test 8: Server name handshake (no client request)
297 $proxy->clear();
298 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
299 $proxy->clientflags("-no_rx_cert_comp -noservername");
300 $proxy->start();
304 "Server name handshake test (client)");
306 #Test 9: Server name handshake (server support only)
307 $proxy->clear();
308 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
309 $proxy->clientflags("-no_rx_cert_comp -noservername");
310 $proxy->serverflags("-no_rx_cert_comp -servername testhost");
311 $proxy->start();
315 "Server name handshake test (server)");
317 #Test 10: Server name handshake (client and server)
318 $proxy->clear();
319 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
320 $proxy->clientflags("-no_rx_cert_comp -servername testhost");
321 $proxy->serverflags("-no_rx_cert_comp -servername testhost");
322 $proxy->start();
326 "Server name handshake test");
328 #Test 11: ALPN handshake (client request only)
329 $proxy->clear();
330 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
331 $proxy->clientflags("-no_rx_cert_comp -alpn test");
332 $proxy->start();
336 "ALPN handshake test (client)");
338 #Test 12: ALPN handshake (server support only)
339 $proxy->clear();
340 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
341 $proxy->clientflags("-no_rx_cert_comp");
342 $proxy->serverflags("-no_rx_cert_comp -alpn test");
343 $proxy->start();
346 "ALPN handshake test (server)");
348 #Test 13: ALPN handshake (client and server)
349 $proxy->clear();
350 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
351 $proxy->clientflags("-no_rx_cert_comp -alpn test");
352 $proxy->serverflags("-no_rx_cert_comp -alpn test");
353 $proxy->start();
358 "ALPN handshake test");
364 #Test 14: SCT handshake (client request only)
365 $proxy->clear();
366 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
367 #Note: -ct also sends status_request
368 $proxy->clientflags("-no_rx_cert_comp -ct");
369 $proxy->serverflags("-no_rx_cert_comp -status_file "
370 .srctop_file("test", "recipes", "ocsp-response.der")
371 ." -serverinfo ".srctop_file("test", "serverinfo2.pem"));
372 $proxy->start();
379 "SCT handshake test");
382 #Test 15: HRR Handshake
383 $proxy->clear();
384 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
385 $proxy->clientflags("-no_rx_cert_comp");
386 $proxy->serverflags("-no_rx_cert_comp -curves P-384");
387 $proxy->start();
391 "HRR handshake test");
393 #Test 16: Resumption handshake with HRR
394 $proxy->clear();
395 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
396 $proxy->clientflags("-no_rx_cert_comp -sess_in ".$session);
397 $proxy->serverflags("-no_rx_cert_comp -curves P-384");
398 $proxy->start();
404 "Resumption handshake with HRR test");
407 $proxy->clear();
408 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
409 $proxy->clientflags("-no_rx_cert_comp -curves P-384");
410 $proxy->start();