2 # Copyright 2016-2024 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
16 use OpenSSL::Test::Utils;
22 foreach my $sctp ("No", "Yes")
24 next if disabled("sctp") && $sctp eq "Yes";
25 next if disabled("dtls1_2") && $fips_mode;
27 my $suffix = ($sctp eq "No") ? "" : "-sctp";
30 name => "renegotiate-client-no-resume".$suffix,
32 "MaxProtocol" => "DTLSv1.2",
33 "CipherString" => 'DEFAULT:@SECLEVEL=0',
34 "Options" => "NoResumptionOnRenegotiation"
37 "CipherString" => 'DEFAULT:@SECLEVEL=0'
42 "HandshakeMode" => "RenegotiateClient",
43 "ResumptionExpected" => "No",
44 "ExpectedResult" => "Success"
48 name => "renegotiate-client-resume".$suffix,
50 "MaxProtocol" => "DTLSv1.2",
51 "CipherString" => 'DEFAULT:@SECLEVEL=0'
54 "CipherString" => 'DEFAULT:@SECLEVEL=0'
59 "HandshakeMode" => "RenegotiateClient",
60 "ResumptionExpected" => "Yes",
61 "ExpectedResult" => "Success"
64 # Note: Unlike the TLS tests, we will never do resumption with server
65 # initiated reneg. This is because an OpenSSL DTLS client will always do a full
66 # handshake (i.e. it doesn't supply a session id) when it receives a
67 # HelloRequest. This is different to the OpenSSL TLS implementation where an
68 # OpenSSL client will always try an abbreviated handshake (i.e. it will supply
69 # the session id). This goes all the way to commit 48ae85b6f when abbreviated
70 # handshake support was first added. Neither behaviour is wrong, but the
71 # discrepancy is strange. TODO: Should we harmonise the TLS and DTLS behaviour,
74 name => "renegotiate-server-resume".$suffix,
76 "MaxProtocol" => "DTLSv1.2",
77 "CipherString" => 'DEFAULT:@SECLEVEL=0'
80 "CipherString" => 'DEFAULT:@SECLEVEL=0'
85 "HandshakeMode" => "RenegotiateServer",
86 "ResumptionExpected" => "No",
87 "ExpectedResult" => "Success"
91 name => "renegotiate-client-auth-require".$suffix,
93 "MaxProtocol" => "DTLSv1.2",
94 "VerifyCAFile" => test_pem("root-cert.pem"),
95 "VerifyMode" => "Require",
96 "CipherString" => 'DEFAULT:@SECLEVEL=0'
99 "Certificate" => test_pem("ee-client-chain.pem"),
100 "PrivateKey" => test_pem("ee-key.pem"),
101 "CipherString" => 'DEFAULT:@SECLEVEL=0'
106 "HandshakeMode" => "RenegotiateServer",
107 "ResumptionExpected" => "No",
108 "ExpectedResult" => "Success"
112 name => "renegotiate-client-auth-once".$suffix,
114 "MaxProtocol" => "DTLSv1.2",
115 "VerifyCAFile" => test_pem("root-cert.pem"),
116 "VerifyMode" => "Once",
117 "CipherString" => 'DEFAULT:@SECLEVEL=0'
120 "Certificate" => test_pem("ee-client-chain.pem"),
121 "PrivateKey" => test_pem("ee-key.pem"),
122 "CipherString" => 'DEFAULT:@SECLEVEL=0'
127 "HandshakeMode" => "RenegotiateServer",
128 "ResumptionExpected" => "No",
129 "ExpectedResult" => "Success"
133 push @tests, @tests_basic;
135 next if disabled("dtls1_2");
136 our @tests_dtls1_2 = (
138 name => "renegotiate-aead-to-non-aead".$suffix,
140 "Options" => "NoResumptionOnRenegotiation"
143 "MaxProtocol" => "DTLSv1.2",
144 "CipherString" => "AES128-GCM-SHA256",
146 "RenegotiateCiphers" => "AES128-SHA"
152 "HandshakeMode" => "RenegotiateClient",
153 "ResumptionExpected" => "No",
154 "ExpectedResult" => "Success"
158 name => "renegotiate-non-aead-to-aead".$suffix,
160 "Options" => "NoResumptionOnRenegotiation"
163 "MaxProtocol" => "DTLSv1.2",
164 "CipherString" => "AES128-SHA",
166 "RenegotiateCiphers" => "AES128-GCM-SHA256"
172 "HandshakeMode" => "RenegotiateClient",
173 "ResumptionExpected" => "No",
174 "ExpectedResult" => "Success"
178 name => "renegotiate-non-aead-to-non-aead".$suffix,
180 "Options" => "NoResumptionOnRenegotiation"
183 "MaxProtocol" => "DTLSv1.2",
184 "CipherString" => "AES128-SHA",
186 "RenegotiateCiphers" => "AES256-SHA"
192 "HandshakeMode" => "RenegotiateClient",
193 "ResumptionExpected" => "No",
194 "ExpectedResult" => "Success"
198 name => "renegotiate-aead-to-aead".$suffix,
200 "Options" => "NoResumptionOnRenegotiation"
203 "MaxProtocol" => "DTLSv1.2",
204 "CipherString" => "AES128-GCM-SHA256",
206 "RenegotiateCiphers" => "AES256-GCM-SHA384"
212 "HandshakeMode" => "RenegotiateClient",
213 "ResumptionExpected" => "No",
214 "ExpectedResult" => "Success"
218 push @tests, @tests_dtls1_2;