xref: /freebsd/crypto/openssl/test/ssl-tests/18-dtls-renegotiate.cnf.in (revision e7be843b4a162e68651d3911f0357ed464915629)
1e0c4386eSCy Schubert# -*- mode: perl; -*-
2*e7be843bSPierre Pronchery# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
3e0c4386eSCy Schubert#
4e0c4386eSCy Schubert# Licensed under the Apache License 2.0 (the "License").  You may not use
5e0c4386eSCy Schubert# this file except in compliance with the License.  You can obtain a copy
6e0c4386eSCy Schubert# in the file LICENSE in the source distribution or at
7e0c4386eSCy Schubert# https://www.openssl.org/source/license.html
8e0c4386eSCy Schubert
9e0c4386eSCy Schubert
10e0c4386eSCy Schubert## Test Renegotiation
11e0c4386eSCy Schubert
12e0c4386eSCy Schubertuse strict;
13e0c4386eSCy Schubertuse warnings;
14e0c4386eSCy Schubert
15e0c4386eSCy Schubertpackage ssltests;
16e0c4386eSCy Schubertuse OpenSSL::Test::Utils;
17e0c4386eSCy Schubert
18e0c4386eSCy Schubertour $fips_mode;
19*e7be843bSPierre Proncheryour $fips_3_4;
20e0c4386eSCy Schubert
21e0c4386eSCy Schubertour @tests = ();
22e0c4386eSCy Schubert
23e0c4386eSCy Schubertforeach my $sctp ("No", "Yes")
24e0c4386eSCy Schubert{
25e0c4386eSCy Schubert    next if disabled("sctp") && $sctp eq "Yes";
26e0c4386eSCy Schubert    next if disabled("dtls1_2") && $fips_mode;
27e0c4386eSCy Schubert
28e0c4386eSCy Schubert    my $suffix = ($sctp eq "No") ? "" : "-sctp";
29e0c4386eSCy Schubert    our @tests_basic = (
30e0c4386eSCy Schubert        {
31e0c4386eSCy Schubert            name => "renegotiate-client-no-resume".$suffix,
32e0c4386eSCy Schubert            server => {
33*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
34e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0',
35e0c4386eSCy Schubert                "Options" => "NoResumptionOnRenegotiation"
36e0c4386eSCy Schubert            },
37e0c4386eSCy Schubert            client => {
38e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
39e0c4386eSCy Schubert            },
40e0c4386eSCy Schubert            test => {
41e0c4386eSCy Schubert                "Method" => "DTLS",
42e0c4386eSCy Schubert                "UseSCTP" => $sctp,
43e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateClient",
44e0c4386eSCy Schubert                "ResumptionExpected" => "No",
45e0c4386eSCy Schubert                "ExpectedResult" => "Success"
46e0c4386eSCy Schubert            }
47e0c4386eSCy Schubert        },
48e0c4386eSCy Schubert        {
49e0c4386eSCy Schubert            name => "renegotiate-client-resume".$suffix,
50e0c4386eSCy Schubert            server => {
51*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
52e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
53e0c4386eSCy Schubert            },
54e0c4386eSCy Schubert            client => {
55e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
56e0c4386eSCy Schubert            },
57e0c4386eSCy Schubert            test => {
58e0c4386eSCy Schubert                "Method" => "DTLS",
59e0c4386eSCy Schubert                "UseSCTP" => $sctp,
60e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateClient",
61e0c4386eSCy Schubert                "ResumptionExpected" => "Yes",
62e0c4386eSCy Schubert                "ExpectedResult" => "Success"
63e0c4386eSCy Schubert            }
64e0c4386eSCy Schubert        },
65e0c4386eSCy Schubert        # Note: Unlike the TLS tests, we will never do resumption with server
66e0c4386eSCy Schubert        # initiated reneg. This is because an OpenSSL DTLS client will always do a full
67e0c4386eSCy Schubert        # handshake (i.e. it doesn't supply a session id) when it receives a
68e0c4386eSCy Schubert        # HelloRequest. This is different to the OpenSSL TLS implementation where an
69e0c4386eSCy Schubert        # OpenSSL client will always try an abbreviated handshake (i.e. it will supply
70e0c4386eSCy Schubert        # the session id). This goes all the way to commit 48ae85b6f when abbreviated
71e0c4386eSCy Schubert        # handshake support was first added. Neither behaviour is wrong, but the
72e0c4386eSCy Schubert        # discrepancy is strange. TODO: Should we harmonise the TLS and DTLS behaviour,
73e0c4386eSCy Schubert        # and if so, what to?
74e0c4386eSCy Schubert        {
75e0c4386eSCy Schubert            name => "renegotiate-server-resume".$suffix,
76e0c4386eSCy Schubert            server => {
77*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
78e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
79e0c4386eSCy Schubert            },
80e0c4386eSCy Schubert            client => {
81e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
82e0c4386eSCy Schubert            },
83e0c4386eSCy Schubert            test => {
84e0c4386eSCy Schubert                "Method" => "DTLS",
85e0c4386eSCy Schubert                "UseSCTP" => $sctp,
86e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateServer",
87e0c4386eSCy Schubert                "ResumptionExpected" => "No",
88e0c4386eSCy Schubert                "ExpectedResult" => "Success"
89e0c4386eSCy Schubert            }
90e0c4386eSCy Schubert        },
91e0c4386eSCy Schubert        {
92e0c4386eSCy Schubert            name => "renegotiate-client-auth-require".$suffix,
93e0c4386eSCy Schubert            server => {
94*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
95e0c4386eSCy Schubert                "VerifyCAFile" => test_pem("root-cert.pem"),
96e0c4386eSCy Schubert                "VerifyMode" => "Require",
97e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
98e0c4386eSCy Schubert            },
99e0c4386eSCy Schubert            client => {
100e0c4386eSCy Schubert                "Certificate" => test_pem("ee-client-chain.pem"),
101e0c4386eSCy Schubert                "PrivateKey"  => test_pem("ee-key.pem"),
102e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
103e0c4386eSCy Schubert            },
104e0c4386eSCy Schubert            test => {
105e0c4386eSCy Schubert                "Method" => "DTLS",
106e0c4386eSCy Schubert                "UseSCTP" => $sctp,
107e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateServer",
108e0c4386eSCy Schubert                "ResumptionExpected" => "No",
109e0c4386eSCy Schubert                "ExpectedResult" => "Success"
110e0c4386eSCy Schubert            }
111e0c4386eSCy Schubert        },
112e0c4386eSCy Schubert        {
113e0c4386eSCy Schubert            name => "renegotiate-client-auth-once".$suffix,
114e0c4386eSCy Schubert            server => {
115*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
116e0c4386eSCy Schubert                "VerifyCAFile" => test_pem("root-cert.pem"),
117e0c4386eSCy Schubert                "VerifyMode" => "Once",
118e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
119e0c4386eSCy Schubert            },
120e0c4386eSCy Schubert            client => {
121e0c4386eSCy Schubert                "Certificate" => test_pem("ee-client-chain.pem"),
122e0c4386eSCy Schubert                "PrivateKey"  => test_pem("ee-key.pem"),
123e0c4386eSCy Schubert                "CipherString" => 'DEFAULT:@SECLEVEL=0'
124e0c4386eSCy Schubert            },
125e0c4386eSCy Schubert            test => {
126e0c4386eSCy Schubert                "Method" => "DTLS",
127e0c4386eSCy Schubert                "UseSCTP" => $sctp,
128e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateServer",
129e0c4386eSCy Schubert                "ResumptionExpected" => "No",
130e0c4386eSCy Schubert                "ExpectedResult" => "Success"
131e0c4386eSCy Schubert            }
132e0c4386eSCy Schubert        }
133e0c4386eSCy Schubert    );
134e0c4386eSCy Schubert    push @tests, @tests_basic;
135e0c4386eSCy Schubert
136*e7be843bSPierre Pronchery    next if disabled("dtls1_2") || $fips_3_4;
137e0c4386eSCy Schubert    our @tests_dtls1_2 = (
138e0c4386eSCy Schubert        {
139e0c4386eSCy Schubert            name => "renegotiate-aead-to-non-aead".$suffix,
140e0c4386eSCy Schubert            server => {
141e0c4386eSCy Schubert                "Options" => "NoResumptionOnRenegotiation"
142e0c4386eSCy Schubert            },
143e0c4386eSCy Schubert            client => {
144*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
145e0c4386eSCy Schubert                "CipherString" => "AES128-GCM-SHA256",
146e0c4386eSCy Schubert                extra => {
147e0c4386eSCy Schubert                    "RenegotiateCiphers" => "AES128-SHA"
148e0c4386eSCy Schubert                }
149e0c4386eSCy Schubert            },
150e0c4386eSCy Schubert            test => {
151e0c4386eSCy Schubert                "Method" => "DTLS",
152e0c4386eSCy Schubert                "UseSCTP" => $sctp,
153e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateClient",
154e0c4386eSCy Schubert                "ResumptionExpected" => "No",
155e0c4386eSCy Schubert                "ExpectedResult" => "Success"
156e0c4386eSCy Schubert            }
157e0c4386eSCy Schubert        },
158e0c4386eSCy Schubert        {
159e0c4386eSCy Schubert            name => "renegotiate-non-aead-to-aead".$suffix,
160e0c4386eSCy Schubert            server => {
161e0c4386eSCy Schubert                "Options" => "NoResumptionOnRenegotiation"
162e0c4386eSCy Schubert            },
163e0c4386eSCy Schubert            client => {
164*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
165e0c4386eSCy Schubert                "CipherString" => "AES128-SHA",
166e0c4386eSCy Schubert                extra => {
167e0c4386eSCy Schubert                    "RenegotiateCiphers" => "AES128-GCM-SHA256"
168e0c4386eSCy Schubert                }
169e0c4386eSCy Schubert            },
170e0c4386eSCy Schubert            test => {
171e0c4386eSCy Schubert                "Method" => "DTLS",
172e0c4386eSCy Schubert                "UseSCTP" => $sctp,
173e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateClient",
174e0c4386eSCy Schubert                "ResumptionExpected" => "No",
175e0c4386eSCy Schubert                "ExpectedResult" => "Success"
176e0c4386eSCy Schubert            }
177e0c4386eSCy Schubert        },
178e0c4386eSCy Schubert        {
179e0c4386eSCy Schubert            name => "renegotiate-non-aead-to-non-aead".$suffix,
180e0c4386eSCy Schubert            server => {
181e0c4386eSCy Schubert                "Options" => "NoResumptionOnRenegotiation"
182e0c4386eSCy Schubert            },
183e0c4386eSCy Schubert            client => {
184*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
185e0c4386eSCy Schubert                "CipherString" => "AES128-SHA",
186e0c4386eSCy Schubert                extra => {
187e0c4386eSCy Schubert                    "RenegotiateCiphers" => "AES256-SHA"
188e0c4386eSCy Schubert                }
189e0c4386eSCy Schubert            },
190e0c4386eSCy Schubert            test => {
191e0c4386eSCy Schubert                "Method" => "DTLS",
192e0c4386eSCy Schubert                "UseSCTP" => $sctp,
193e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateClient",
194e0c4386eSCy Schubert                "ResumptionExpected" => "No",
195e0c4386eSCy Schubert                "ExpectedResult" => "Success"
196e0c4386eSCy Schubert            }
197e0c4386eSCy Schubert        },
198e0c4386eSCy Schubert        {
199e0c4386eSCy Schubert            name => "renegotiate-aead-to-aead".$suffix,
200e0c4386eSCy Schubert            server => {
201e0c4386eSCy Schubert                "Options" => "NoResumptionOnRenegotiation"
202e0c4386eSCy Schubert            },
203e0c4386eSCy Schubert            client => {
204*e7be843bSPierre Pronchery                "MaxProtocol" => "DTLSv1.2",
205e0c4386eSCy Schubert                "CipherString" => "AES128-GCM-SHA256",
206e0c4386eSCy Schubert                extra => {
207e0c4386eSCy Schubert                    "RenegotiateCiphers" => "AES256-GCM-SHA384"
208e0c4386eSCy Schubert                }
209e0c4386eSCy Schubert            },
210e0c4386eSCy Schubert            test => {
211e0c4386eSCy Schubert                "Method" => "DTLS",
212e0c4386eSCy Schubert                "UseSCTP" => $sctp,
213e0c4386eSCy Schubert                "HandshakeMode" => "RenegotiateClient",
214e0c4386eSCy Schubert                "ResumptionExpected" => "No",
215e0c4386eSCy Schubert                "ExpectedResult" => "Success"
216e0c4386eSCy Schubert            }
217e0c4386eSCy Schubert        },
218e0c4386eSCy Schubert    );
219e0c4386eSCy Schubert    push @tests, @tests_dtls1_2;
220e0c4386eSCy Schubert}
221