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");
32 my $proxy = TLSProxy::Proxy->new(
172 #Test 1: Check we get all the right messages for a default handshake
174 $proxy->serverconnects(2);
175 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
176 $proxy->clientflags("-no_tls1_3 -sess_out ".$session);
177 $proxy->start() or plan skip_all => "Unable to start up Proxy for tests";
181 "Default handshake test");
183 #Test 2: Resumption handshake
184 $proxy->clearClient();
185 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
186 $proxy->clientflags("-no_tls1_3 -sess_in ".$session);
187 $proxy->clientstart();
191 "Resumption handshake test");
198 #Test 3: A status_request handshake (client request only)
199 $proxy->clear();
200 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
201 $proxy->clientflags("-no_tls1_3 -status");
202 $proxy->start();
206 "status_request handshake test (client)");
208 #Test 4: A status_request handshake (server support only)
209 $proxy->clear();
210 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
211 $proxy->clientflags("-no_tls1_3");
212 $proxy->serverflags("-status_file "
213 .srctop_file("test", "recipes", "ocsp-response.der"));
214 $proxy->start();
217 "status_request handshake test (server)");
219 #Test 5: A status_request handshake (client and server)
220 $proxy->clear();
221 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
222 $proxy->clientflags("-no_tls1_3 -status");
223 $proxy->serverflags("-status_file "
224 .srctop_file("test", "recipes", "ocsp-response.der"));
225 $proxy->start();
230 "status_request handshake test");
233 #Test 6: A client auth handshake
234 $proxy->clear();
235 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
236 $proxy->clientflags("-no_tls1_3 -cert ".srctop_file("apps", "server.pem"));
237 $proxy->serverflags("-Verify 5");
238 $proxy->start();
241 "Client auth handshake test");
243 #Test 7: A handshake with a renegotiation
244 $proxy->clear();
245 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
246 $proxy->clientflags("-no_tls1_3");
247 $proxy->serverflags("-client_renegotiation");
248 $proxy->reneg(1);
249 $proxy->start();
252 "Renegotiation handshake test");
254 #Test 8: Server name handshake (no client request)
255 $proxy->clear();
256 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
257 $proxy->clientflags("-no_tls1_3 -noservername");
258 $proxy->start();
262 "Server name handshake test (client)");
264 #Test 9: Server name handshake (server support only)
265 $proxy->clear();
266 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
267 $proxy->clientflags("-no_tls1_3 -noservername");
268 $proxy->serverflags("-servername testhost");
269 $proxy->start();
273 "Server name handshake test (server)");
275 #Test 10: Server name handshake (client and server)
276 $proxy->clear();
277 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
278 $proxy->clientflags("-no_tls1_3 -servername testhost");
279 $proxy->serverflags("-servername testhost");
280 $proxy->start();
284 "Server name handshake test");
286 #Test 11: ALPN handshake (client request only)
287 $proxy->clear();
288 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
289 $proxy->clientflags("-no_tls1_3 -alpn test");
290 $proxy->start();
294 "ALPN handshake test (client)");
296 #Test 12: ALPN handshake (server support only)
297 $proxy->clear();
298 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
299 $proxy->clientflags("-no_tls1_3");
300 $proxy->serverflags("-alpn test");
301 $proxy->start();
304 "ALPN handshake test (server)");
306 #Test 13: ALPN handshake (client and server)
307 $proxy->clear();
308 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
309 $proxy->clientflags("-no_tls1_3 -alpn test");
310 $proxy->serverflags("-alpn test");
311 $proxy->start();
316 "ALPN handshake test");
322 #Test 14: SCT handshake (client request only)
323 $proxy->clear();
324 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
325 #Note: -ct also sends status_request
326 $proxy->clientflags("-no_tls1_3 -ct");
327 $proxy->serverflags("-status_file "
328 .srctop_file("test", "recipes", "ocsp-response.der"));
329 $proxy->start();
335 "SCT handshake test (client)");
342 #Test 15: SCT handshake (server support only)
343 $proxy->clear();
344 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
345 #Note: -ct also sends status_request
346 $proxy->clientflags("-no_tls1_3");
347 $proxy->serverflags("-status_file "
348 .srctop_file("test", "recipes", "ocsp-response.der"));
349 $proxy->start();
352 "SCT handshake test (server)");
359 #Test 16: SCT handshake (client and server)
360 #There is no built-in server side support for this so we are actually also
362 $proxy->clear();
363 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
364 #Note: -ct also sends status_request
365 $proxy->clientflags("-no_tls1_3 -ct");
366 $proxy->serverflags("-status_file "
367 .srctop_file("test", "recipes", "ocsp-response.der")
368 ." -serverinfo ".srctop_file("test", "serverinfo.pem"));
369 $proxy->start();
376 "SCT handshake test");
384 #Test 17: NPN handshake (client request only)
385 $proxy->clear();
386 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
387 $proxy->clientflags("-no_tls1_3 -nextprotoneg test");
388 $proxy->start();
392 "NPN handshake test (client)");
394 #Test 18: NPN handshake (server support only)
395 $proxy->clear();
396 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
397 $proxy->clientflags("-no_tls1_3");
398 $proxy->serverflags("-nextprotoneg test");
399 $proxy->start();
402 "NPN handshake test (server)");
404 #Test 19: NPN handshake (client and server)
405 $proxy->clear();
406 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
407 $proxy->clientflags("-no_tls1_3 -nextprotoneg test");
408 $proxy->serverflags("-nextprotoneg test");
409 $proxy->start();
414 "NPN handshake test");
422 #Note: We are not actually going to perform an SRP handshake (TLSProxy
426 $proxy->clear();
427 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
428 $proxy->clientflags("-no_tls1_3 -srpuser user -srppass pass:pass");
429 $proxy->start();
436 #Test 21: EC handshake
439 $proxy->clear();
440 $proxy->cipherc("DEFAULT:\@SECLEVEL=2");
441 $proxy->clientflags("-no_tls1_3");
442 $proxy->serverflags("-no_tls1_3");
443 $proxy->ciphers("ECDHE-RSA-AES128-SHA");
444 $proxy->start();
448 "EC handshake test");