summaryrefslogtreecommitdiffstats
path: root/test/ssl-tests/13-fragmentation.cnf.in
blob: ea208396a94d6c0c19ed6e35ab2238b643990935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# -*- mode: perl; -*-
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License").  You may not use
# this file except in compliance with the License.  You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html


## Test packet fragmentation

use strict;
use warnings;

package ssltests;


our @tests = (
    # Default fragment size is 512.
    {
        name => "one-fragment-minus-app-data",
        server => { },
        client => { },
        test => {
            ApplicationData => 511,
        }
    },
    {
        name => "one-fragment-app-data",
        server => { },
        client => { },
        test => {
            ApplicationData => 512,
        }
    },
    {
        name => "one-fragment-plus-app-data",
        server => { },
        client => { },
        test => {
            ApplicationData => 513,
        }
    },
    {
        name => "small-app-data",
        server => { },
        client => { },
        test => {
            ApplicationData => 4 * 1024 + 1,
        }
    },
    {
        name => "small-app-data-large-fragment-size",
        server => { },
        client => { },
        test => {
            ApplicationData => 4 * 1024 + 1,
            MaxFragmentSize => 16384,
        }
    },
    {
        name => "medium-app-data",
        server => { },
        client => { },
        test => {
            ApplicationData => 32 * 1024 + 7,
        }
    },
    # Exceeds the 64kB write buffer size.
    {
        name => "medium-plus-app-data",
        server => { },
        client => { },
        test => {
            ApplicationData => 128 * 1024 - 3,
        }
    },
    {
        name => "large-app-data",
        server => { },
        client => { },
        test => {
            ApplicationData => 1024 * 1024,
        }
    },
    {
        name => "large-app-data-large-fragment-size",
        server => { },
        client => { },
        test => {
            ApplicationData => 1024 * 1024,
            MaxFragmentSize => 16384,
        }
    },
    {
        name => "large-app-data-odd-fragment-size",
        server => { },
        client => { },
        test => {
            ApplicationData => 1024 * 1024,
            MaxFragmentSize => 5 * 1024 - 5,
        }
    },
    # When the buffer / fragment size ratio is sufficiently large,
    # multi-buffer code kicks in on some platforms for AES-SHA.  The
    # exact minimum ratio depends on the platform, and is usually
    # around 4. Since the test buffer is 64kB, a 4kB fragment is
    # easily sufficient.
    #
    # (We run this test on all platforms though it's only true multibuffer
    #  on some of them.)
    {
        name => "large-app-data-aes-sha1-multibuffer",
        server => { },
        client => {
            CipherString => "AES128-SHA",
            MaxProtocol => "TLSv1.2"
        },
        test => {
            ApplicationData => 1024 * 1024,
            MaxFragmentSize => 4 * 1024,
        }
    },
    {
        name => "large-app-data-aes-sha2-multibuffer",
        server => { },
        client => {
            CipherString => "AES128-SHA256",
            MaxProtocol => "TLSv1.2"
        },
        test => {
            ApplicationData => 1024 * 1024,
            MaxFragmentSize => 4 * 1024,
        }
    },
        {
        name => "large-app-data-aes-sha1-multibuffer-odd-fragment",
        server => { },
        client => {
            CipherString => "AES128-SHA",
            MaxProtocol => "TLSv1.2"
        },
        test => {
            ApplicationData => 1024 * 1024 + 3,
            MaxFragmentSize => 5 * 1024 - 5,
        }
    },
    {
        name => "large-app-data-aes-sha2-multibuffer-odd-fragment",
        server => { },
        client => {
            CipherString => "AES128-SHA256",
            MaxProtocol => "TLSv1.2"
        },
        test => {
            ApplicationData => 1024 * 1024 - 3,
            MaxFragmentSize => 5 * 1024 + 5,
        }
    },
    # Test that multibuffer-capable code also handles small data correctly.
    # Here fragment size == app data size < buffer size,
    # so no multibuffering should happen.
    {
        name => "small-app-data-aes-sha1-multibuffer",
        server => { },
        client => {
            CipherString => "AES128-SHA",
            MaxProtocol => "TLSv1.2"
        },
        test => {
            ApplicationData => 4 * 1024,
            MaxFragmentSize => 4 * 1024,
        }
    },
    {
        name => "small-app-data-aes-sha2-multibuffer",
        server => { },
        client => {
            CipherString => "AES128-SHA256",
            MaxProtocol => "TLSv1.2"
        },
        test => {
            ApplicationData => 4 * 1024,
            MaxFragmentSize => 4 * 1024,
        }
    },
    ############################################
    # Default (Max) Fragment Size is 512.
    # Default Application data size is 256.
    {
        name => "Maximum Fragment Len extension set to 1024 w. FragmentSize disabled",
        server => { },
        client => {
            extra => {
                MaxFragmentLenExt => 1024,
            },
        },
        test => {
            ApplicationData => 3072,
            MaxFragmentSize => 16384,
        }
    },
    {
        name => "Maximum Fragment Len extension equal FragmentSize to 2048",
        server => { },
        client => {
            extra => {
                MaxFragmentLenExt => 2048,
            },
        },
        test => {
            ApplicationData => 3072,
            MaxFragmentSize => 2048,
        }
    },
    {
        name => "Maximum Fragment Len extension 512 lower than FragmentSize 1024",
        server => { },
        client => {
            extra => {
                MaxFragmentLenExt => 512,
            },
        },
        test => {
            ApplicationData => 3072,
            MaxFragmentSize => 1024,
        }
    },
    {
        name => "Maximum Fragment Len extension 1024 lower than FragmentSize 1024",
        server => { },
        client => {
            extra => {
                MaxFragmentLenExt => 2048,
            },
        },
        test => {
            ApplicationData => 3072,
            MaxFragmentSize => 1024,
        }
    },
    {
        name => "Maximum Fragment Len extension 4096 greater than FragmentSize 2048",
        server => { },
        client => {
            extra => {
                MaxFragmentLenExt => 4096,
            },
        },
        test => {
            ApplicationData => 8196,
            MaxFragmentSize => 2048,
        }
    },
    {
        name => "Maximum Fragment Len extension 2048 greater than FragmentSize 1024",
        server => { },
        client => {
            extra => {
                MaxFragmentLenExt => 2048,
            },
        },
        test => {
            ApplicationData => 3072,
            MaxFragmentSize => 1024,
        }
    },
);