]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/recipes/70-test_sslskewith0p.t
2 # Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
10 use OpenSSL
::Test qw
/:DEFAULT cmdstr srctop_file bldtop_dir/;
11 use OpenSSL
::Test
::Utils
;
14 my $test_name = "test_sslskewith0p";
17 plan skip_all
=> "TLSProxy isn't usable on $^O"
20 plan skip_all
=> "$test_name needs the dynamic engine feature enabled"
21 if disabled
("engine") || disabled
("dynamic-engine");
23 plan skip_all
=> "dh is not supported by this OpenSSL build"
26 plan skip_all
=> "$test_name needs the sock feature enabled"
29 plan skip_all
=> "$test_name needs TLS enabled"
30 if alldisabled
(available_protocols
("tls"));
32 $ENV{OPENSSL_ia32cap
} = '~0x200000200000000';
33 my $proxy = TLSProxy
::Proxy
->new(
35 cmdstr
(app
(["openssl"]), display
=> 1),
36 srctop_file
("apps", "server.pem"),
37 (!$ENV{HARNESS_ACTIVE
} || $ENV{HARNESS_VERBOSE
})
40 #We must use an anon DHE cipher for this test
41 $proxy->cipherc('ADH-AES128-SHA:@SECLEVEL=0');
42 $proxy->ciphers('ADH-AES128-SHA:@SECLEVEL=0');
44 $proxy->clientflags("-no_tls1_3");
45 $proxy->start() or plan skip_all
=> "Unable to start up Proxy for tests";
47 ok
(TLSProxy
::Message
->fail, "ServerKeyExchange with 0 p");
53 # We're only interested in the SKE - always in flight 1
54 if ($proxy->flight != 1) {
58 foreach my $message (@
{$proxy->message_list}) {
59 if ($message->mt == TLSProxy
::Message
::MT_SERVER_KEY_EXCHANGE
) {
60 #Set p to a value of 0
61 $message->p(pack('C', 0));