1# -*- mode: perl; -*-
2# Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
3#
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
8
9
10## Test session ticket app data
11
12use strict;
13use warnings;
14
15package ssltests;
16use OpenSSL::Test::Utils;
17
18our @tests12 = (
19    {
20	"name" => "session-ticket-app-data12",
21	"client" => {
22	    "MaxProtocol" => "TLSv1.2",
23	    "Options" => "SessionTicket",
24	},
25	"server" => {
26	    "Options" => "SessionTicket",
27	    "extra" => {
28		"SessionTicketAppData" => "HelloWorld",
29	    },
30	},
31	"test" => {
32	    "HandshakeMode" => "Resume",
33	    "ExpectedResult" => "Success",
34	    "SessionTicketExpected" => "Yes",
35	    "ResumptionExpected" => "Yes",
36	    "ExpectedSessionTicketAppData" => "HelloWorld",
37	}
38    },
39    {
40	"name" => "session-ticket-app-data12",
41	"client" => {
42	    "MaxProtocol" => "TLSv1.2",
43	    "Options" => "SessionTicket",
44	},
45	"server" => {
46	    "Options" => "SessionTicket",
47	},
48	"test" => {
49	    "HandshakeMode" => "Resume",
50	    "ExpectedResult" => "Success",
51	    "SessionTicketExpected" => "Yes",
52	    "ResumptionExpected" => "Yes",
53	    "ExpectedSessionTicketAppData" => "",
54	}
55    }
56);
57our @tests13 = (
58    {
59	"name" => "session-ticket-app-data13",
60	"client" => {
61	    "MaxProtocol" => "TLSv1.3",
62	    "Options" => "SessionTicket",
63	},
64	"server" => {
65	    "Options" => "SessionTicket",
66	    "extra" => {
67		"SessionTicketAppData" => "HelloWorld",
68	    },
69	},
70	"test" => {
71	    "HandshakeMode" => "Resume",
72	    "ExpectedResult" => "Success",
73	    "SessionTicketExpected" => "Yes",
74	    "ResumptionExpected" => "Yes",
75	    "ExpectedSessionTicketAppData" => "HelloWorld",
76	}
77    },
78    {
79	"name" => "session-ticket-app-data13",
80	"client" => {
81	    "MaxProtocol" => "TLSv1.3",
82	    "Options" => "SessionTicket",
83	},
84	"server" => {
85	    "Options" => "SessionTicket",
86	},
87	"test" => {
88	    "HandshakeMode" => "Resume",
89	    "ExpectedResult" => "Success",
90	    "SessionTicketExpected" => "Yes",
91	    "ResumptionExpected" => "Yes",
92	    "ExpectedSessionTicketAppData" => "",
93	}
94    }
95);
96
97our @tests = ();
98push @tests, @tests12 unless disabled("tls1_2");
99push @tests, @tests13 unless disabled("tls1_3")
100                             || (disabled("ec") && disabled("dh"));
101