Coverage Report

Created: 2026-07-23 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl35/ssl/statem/extensions_cust.c
Line
Count
Source
1
/*
2
 * Copyright 2014-2026 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
/* Custom extension utility functions */
11
12
#include <openssl/ct.h>
13
#include "../ssl_local.h"
14
#include "internal/cryptlib.h"
15
#include "internal/ssl_unwrap.h"
16
#include "statem_local.h"
17
18
typedef struct {
19
    void *add_arg;
20
    custom_ext_add_cb add_cb;
21
    custom_ext_free_cb free_cb;
22
} custom_ext_add_cb_wrap;
23
24
typedef struct {
25
    void *parse_arg;
26
    custom_ext_parse_cb parse_cb;
27
} custom_ext_parse_cb_wrap;
28
29
/*
30
 * Provide thin wrapper callbacks which convert new style arguments to old style
31
 */
32
static int custom_ext_add_old_cb_wrap(SSL *s, unsigned int ext_type,
33
    unsigned int context,
34
    const unsigned char **out,
35
    size_t *outlen, X509 *x, size_t chainidx,
36
    int *al, void *add_arg)
37
0
{
38
0
    custom_ext_add_cb_wrap *add_cb_wrap = (custom_ext_add_cb_wrap *)add_arg;
39
40
0
    if (add_cb_wrap->add_cb == NULL)
41
0
        return 1;
42
43
0
    return add_cb_wrap->add_cb(s, ext_type, out, outlen, al,
44
0
        add_cb_wrap->add_arg);
45
0
}
46
47
static void custom_ext_free_old_cb_wrap(SSL *s, unsigned int ext_type,
48
    unsigned int context,
49
    const unsigned char *out, void *add_arg)
50
0
{
51
0
    custom_ext_add_cb_wrap *add_cb_wrap = (custom_ext_add_cb_wrap *)add_arg;
52
53
0
    if (add_cb_wrap->free_cb == NULL)
54
0
        return;
55
56
0
    add_cb_wrap->free_cb(s, ext_type, out, add_cb_wrap->add_arg);
57
0
}
58
59
static int custom_ext_parse_old_cb_wrap(SSL *s, unsigned int ext_type,
60
    unsigned int context,
61
    const unsigned char *in,
62
    size_t inlen, X509 *x, size_t chainidx,
63
    int *al, void *parse_arg)
64
0
{
65
0
    custom_ext_parse_cb_wrap *parse_cb_wrap = (custom_ext_parse_cb_wrap *)parse_arg;
66
67
0
    if (parse_cb_wrap->parse_cb == NULL)
68
0
        return 1;
69
70
0
    return parse_cb_wrap->parse_cb(s, ext_type, in, inlen, al,
71
0
        parse_cb_wrap->parse_arg);
72
0
}
73
74
/*
75
 * Find a custom extension from the list. The |role| param is there to
76
 * support the legacy API where custom extensions for client and server could
77
 * be set independently on the same SSL_CTX. It is set to ENDPOINT_SERVER if we
78
 * are trying to find a method relevant to the server, ENDPOINT_CLIENT for the
79
 * client, or ENDPOINT_BOTH for either
80
 */
81
custom_ext_method *custom_ext_find(const custom_ext_methods *exts,
82
    ENDPOINT role, unsigned int ext_type,
83
    size_t *idx)
84
202k
{
85
202k
    size_t i;
86
202k
    custom_ext_method *meth = exts->meths;
87
88
206k
    for (i = 0; i < exts->meths_count; i++, meth++) {
89
43.3k
        if (ext_type == meth->ext_type
90
39.7k
            && (role == ENDPOINT_BOTH || role == meth->role
91
39.7k
                || meth->role == ENDPOINT_BOTH)) {
92
39.7k
            if (idx != NULL)
93
19.9k
                *idx = i;
94
39.7k
            return meth;
95
39.7k
        }
96
43.3k
    }
97
162k
    return NULL;
98
202k
}
99
100
/*
101
 * Initialise custom extensions flags to indicate neither sent nor received.
102
 */
103
void custom_ext_init(custom_ext_methods *exts)
104
162k
{
105
162k
    size_t i;
106
162k
    custom_ext_method *meth = exts->meths;
107
108
213k
    for (i = 0; i < exts->meths_count; i++, meth++)
109
50.1k
        meth->ext_flags &= ~(SSL_EXT_FLAG_SENT | SSL_EXT_FLAG_RECEIVED);
110
162k
}
111
112
/* Pass received custom extension data to the application for parsing. */
113
int custom_ext_parse(SSL_CONNECTION *s, unsigned int context,
114
    unsigned int ext_type,
115
    const unsigned char *ext_data, size_t ext_size, X509 *x,
116
    size_t chainidx)
117
24.2k
{
118
24.2k
    int al = 0;
119
24.2k
    custom_ext_methods *exts = &s->cert->custext;
120
24.2k
    custom_ext_method *meth;
121
24.2k
    ENDPOINT role = ENDPOINT_BOTH;
122
123
24.2k
    if ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO)) != 0)
124
4.40k
        role = s->server ? ENDPOINT_SERVER : ENDPOINT_CLIENT;
125
126
24.2k
    meth = custom_ext_find(exts, role, ext_type, NULL);
127
    /* If not found return success */
128
24.2k
    if (!meth)
129
4.45k
        return 1;
130
131
    /* Check if extension is defined for our protocol. If not, skip */
132
19.7k
    if (!extension_is_relevant(s, meth->context, context))
133
0
        return 1;
134
135
19.7k
    if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS)) != 0) {
136
        /*
137
         * If it's ServerHello or EncryptedExtensions we can't have any
138
         * extensions not sent in ClientHello.
139
         */
140
19.7k
        if ((meth->ext_flags & SSL_EXT_FLAG_SENT) == 0) {
141
0
            SSLfatal(s, TLS1_AD_UNSUPPORTED_EXTENSION, SSL_R_BAD_EXTENSION);
142
0
            return 0;
143
0
        }
144
19.7k
    }
145
146
    /*
147
     * Extensions received in the ClientHello or CertificateRequest are marked
148
     * with the SSL_EXT_FLAG_RECEIVED. This is so we know to add the equivalent
149
     * extensions in the response messages
150
     */
151
19.7k
    if ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST))
152
19.7k
        != 0)
153
0
        meth->ext_flags |= SSL_EXT_FLAG_RECEIVED;
154
155
    /* If no parse function set return success */
156
19.7k
    if (meth->parse_cb == NULL)
157
0
        return 1;
158
159
19.7k
    if (meth->parse_cb(SSL_CONNECTION_GET_USER_SSL(s), ext_type, context, ext_data,
160
19.7k
            ext_size, x, chainidx, &al, meth->parse_arg)
161
19.7k
        <= 0) {
162
1.15k
        SSLfatal(s, al, SSL_R_BAD_EXTENSION);
163
1.15k
        return 0;
164
1.15k
    }
165
166
18.6k
    return 1;
167
19.7k
}
168
169
/*
170
 * Request custom extension data from the application and add to the return
171
 * buffer.
172
 */
173
int custom_ext_add(SSL_CONNECTION *s, int context, WPACKET *pkt, X509 *x,
174
    size_t chainidx, int maxversion)
175
119k
{
176
119k
    custom_ext_methods *exts = &s->cert->custext;
177
119k
    custom_ext_method *meth;
178
119k
    size_t i;
179
119k
    int al;
180
119k
    int for_comp = (context & SSL_EXT_TLS1_3_CERTIFICATE_COMPRESSION) != 0;
181
182
161k
    for (i = 0; i < exts->meths_count; i++) {
183
41.9k
        const unsigned char *out = NULL;
184
41.9k
        size_t outlen = 0;
185
186
41.9k
        meth = exts->meths + i;
187
188
41.9k
        if (!should_add_extension(s, meth->context, context, maxversion))
189
0
            continue;
190
191
41.9k
        if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_RAW_PUBLIC_KEY | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) {
192
            /* Only send extensions present in ClientHello/CertificateRequest */
193
0
            if (!(meth->ext_flags & SSL_EXT_FLAG_RECEIVED))
194
0
                continue;
195
0
        }
196
        /*
197
         * We skip it if the callback is absent - except for a ClientHello where
198
         * we add an empty extension.
199
         */
200
41.9k
        if ((context & SSL_EXT_CLIENT_HELLO) == 0 && meth->add_cb == NULL)
201
0
            continue;
202
203
41.9k
        if (meth->add_cb != NULL) {
204
41.9k
            int cb_retval = meth->add_cb(SSL_CONNECTION_GET_USER_SSL(s),
205
41.9k
                meth->ext_type, context, &out,
206
41.9k
                &outlen, x, chainidx, &al,
207
41.9k
                meth->add_arg);
208
209
41.9k
            if (cb_retval < 0) {
210
0
                if (!for_comp)
211
0
                    SSLfatal(s, al, SSL_R_CALLBACK_FAILED);
212
0
                return 0; /* error */
213
0
            }
214
41.9k
            if (cb_retval == 0)
215
0
                continue; /* skip this extension */
216
41.9k
        }
217
218
41.9k
        if (!WPACKET_put_bytes_u16(pkt, meth->ext_type)
219
41.9k
            || !WPACKET_start_sub_packet_u16(pkt)
220
41.9k
            || (outlen > 0 && !WPACKET_memcpy(pkt, out, outlen))
221
41.9k
            || !WPACKET_close(pkt)) {
222
0
            if (meth->free_cb != NULL)
223
0
                meth->free_cb(SSL_CONNECTION_GET_USER_SSL(s), meth->ext_type,
224
0
                    context, out, meth->add_arg);
225
0
            if (!for_comp)
226
0
                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
227
0
            return 0;
228
0
        }
229
41.9k
        if ((context & SSL_EXT_CLIENT_HELLO) != 0) {
230
            /*
231
             * We can't send duplicates: code logic should prevent this.
232
             */
233
41.9k
            if (!ossl_assert((meth->ext_flags & SSL_EXT_FLAG_SENT) == 0)) {
234
0
                if (meth->free_cb != NULL)
235
0
                    meth->free_cb(SSL_CONNECTION_GET_USER_SSL(s), meth->ext_type,
236
0
                        context, out, meth->add_arg);
237
0
                if (!for_comp)
238
0
                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
239
0
                return 0;
240
0
            }
241
            /*
242
             * Indicate extension has been sent: this is both a sanity check to
243
             * ensure we don't send duplicate extensions and indicates that it
244
             * is not an error if the extension is present in ServerHello.
245
             */
246
41.9k
            meth->ext_flags |= SSL_EXT_FLAG_SENT;
247
41.9k
        }
248
41.9k
        if (meth->free_cb != NULL)
249
41.9k
            meth->free_cb(SSL_CONNECTION_GET_USER_SSL(s), meth->ext_type,
250
41.9k
                context, out, meth->add_arg);
251
41.9k
    }
252
119k
    return 1;
253
119k
}
254
255
/* Copy the flags from src to dst for any extensions that exist in both */
256
int custom_exts_copy_flags(custom_ext_methods *dst,
257
    const custom_ext_methods *src)
258
0
{
259
0
    size_t i;
260
0
    custom_ext_method *methsrc = src->meths;
261
262
0
    for (i = 0; i < src->meths_count; i++, methsrc++) {
263
0
        custom_ext_method *methdst = custom_ext_find(dst, methsrc->role,
264
0
            methsrc->ext_type, NULL);
265
266
0
        if (methdst == NULL)
267
0
            continue;
268
269
0
        methdst->ext_flags = methsrc->ext_flags;
270
0
    }
271
272
0
    return 1;
273
0
}
274
275
/* Copy old style API wrapper arguments */
276
static void custom_ext_copy_old_cb(custom_ext_method *methdst,
277
    const custom_ext_method *methsrc,
278
    int *err)
279
0
{
280
0
    if (methsrc->add_cb != custom_ext_add_old_cb_wrap)
281
0
        return;
282
283
0
    if (*err) {
284
0
        methdst->add_arg = NULL;
285
0
        methdst->parse_arg = NULL;
286
0
        return;
287
0
    }
288
289
0
    methdst->add_arg = OPENSSL_memdup(methsrc->add_arg,
290
0
        sizeof(custom_ext_add_cb_wrap));
291
0
    methdst->parse_arg = OPENSSL_memdup(methsrc->parse_arg,
292
0
        sizeof(custom_ext_parse_cb_wrap));
293
294
0
    if (methdst->add_arg == NULL || methdst->parse_arg == NULL)
295
0
        *err = 1;
296
297
0
    return;
298
0
}
299
300
/* Copy table of custom extensions */
301
int custom_exts_copy(custom_ext_methods *dst, const custom_ext_methods *src)
302
89.9k
{
303
89.9k
    size_t i;
304
89.9k
    int err = 0;
305
306
89.9k
    if (src->meths_count > 0) {
307
0
        dst->meths = OPENSSL_memdup(src->meths,
308
0
            sizeof(*src->meths) * src->meths_count);
309
0
        if (dst->meths == NULL)
310
0
            return 0;
311
0
        dst->meths_count = src->meths_count;
312
313
0
        for (i = 0; i < src->meths_count; i++)
314
0
            custom_ext_copy_old_cb(&dst->meths[i], &src->meths[i], &err);
315
0
    }
316
317
89.9k
    if (err) {
318
0
        custom_exts_free(dst);
319
0
        return 0;
320
0
    }
321
322
89.9k
    return 1;
323
89.9k
}
324
325
/* Copy custom extensions that were set on connection */
326
int custom_exts_copy_conn(custom_ext_methods *dst,
327
    const custom_ext_methods *src)
328
0
{
329
0
    size_t i;
330
0
    int err = 0;
331
332
0
    if (src->meths_count > 0) {
333
0
        size_t meths_count = 0;
334
335
0
        for (i = 0; i < src->meths_count; i++)
336
0
            if ((src->meths[i].ext_flags & SSL_EXT_FLAG_CONN) != 0)
337
0
                meths_count++;
338
339
0
        if (meths_count > 0) {
340
0
            custom_ext_method *methdst = OPENSSL_realloc(dst->meths,
341
0
                (dst->meths_count + meths_count) * sizeof(custom_ext_method));
342
343
0
            if (methdst == NULL)
344
0
                return 0;
345
346
0
            dst->meths = methdst;
347
0
            methdst += dst->meths_count;
348
349
0
            for (i = 0; i < src->meths_count; i++) {
350
0
                custom_ext_method *methsrc = &src->meths[i];
351
352
0
                if ((methsrc->ext_flags & SSL_EXT_FLAG_CONN) == 0)
353
0
                    continue;
354
355
0
                memcpy(methdst, methsrc, sizeof(custom_ext_method));
356
0
                custom_ext_copy_old_cb(methdst, methsrc, &err);
357
0
                methdst++;
358
0
            }
359
360
0
            dst->meths_count += meths_count;
361
0
        }
362
0
    }
363
364
0
    if (err) {
365
0
        custom_exts_free(dst);
366
0
        return 0;
367
0
    }
368
369
0
    return 1;
370
0
}
371
372
void custom_exts_free(custom_ext_methods *exts)
373
333k
{
374
333k
    size_t i;
375
333k
    custom_ext_method *meth;
376
377
383k
    for (i = 0, meth = exts->meths; i < exts->meths_count; i++, meth++) {
378
50.1k
        if (meth->add_cb != custom_ext_add_old_cb_wrap)
379
50.1k
            continue;
380
381
        /* Old style API wrapper. Need to free the arguments too */
382
0
        OPENSSL_free(meth->add_arg);
383
0
        OPENSSL_free(meth->parse_arg);
384
0
    }
385
333k
    OPENSSL_free(exts->meths);
386
333k
    exts->meths = NULL;
387
333k
    exts->meths_count = 0;
388
333k
}
389
390
/* Return true if a client custom extension exists, false otherwise */
391
int SSL_CTX_has_client_custom_ext(const SSL_CTX *ctx, unsigned int ext_type)
392
0
{
393
0
    return custom_ext_find(&ctx->cert->custext, ENDPOINT_CLIENT, ext_type,
394
0
               NULL)
395
0
        != NULL;
396
0
}
397
398
int ossl_tls_add_custom_ext_intern(SSL_CTX *ctx, custom_ext_methods *exts,
399
    ENDPOINT role, unsigned int ext_type,
400
    unsigned int context,
401
    SSL_custom_ext_add_cb_ex add_cb,
402
    SSL_custom_ext_free_cb_ex free_cb,
403
    void *add_arg,
404
    SSL_custom_ext_parse_cb_ex parse_cb,
405
    void *parse_arg)
406
27.9k
{
407
27.9k
    custom_ext_method *meth, *tmp;
408
409
    /*
410
     * Check application error: if add_cb is not set free_cb will never be
411
     * called.
412
     */
413
27.9k
    if (add_cb == NULL && free_cb != NULL)
414
0
        return 0;
415
416
27.9k
    if (exts == NULL)
417
0
        exts = &ctx->cert->custext;
418
419
27.9k
#ifndef OPENSSL_NO_CT
420
    /*
421
     * We don't want applications registering callbacks for SCT extensions
422
     * whilst simultaneously using the built-in SCT validation features, as
423
     * these two things may not play well together.
424
     */
425
27.9k
    if (ext_type == TLSEXT_TYPE_signed_certificate_timestamp
426
0
        && (context & SSL_EXT_CLIENT_HELLO) != 0
427
0
        && ctx != NULL
428
0
        && SSL_CTX_ct_is_enabled(ctx))
429
0
        return 0;
430
27.9k
#endif
431
432
    /*
433
     * Don't add if extension supported internally, but make exception
434
     * for extension types that previously were not supported, but now are.
435
     */
436
27.9k
    if (SSL_extension_supported(ext_type)
437
0
        && ext_type != TLSEXT_TYPE_signed_certificate_timestamp)
438
0
        return 0;
439
440
    /* Extension type must fit in 16 bits */
441
27.9k
    if (ext_type > 0xffff)
442
0
        return 0;
443
    /* Search for duplicate */
444
27.9k
    if (custom_ext_find(exts, role, ext_type, NULL))
445
0
        return 0;
446
27.9k
    tmp = OPENSSL_realloc(exts->meths,
447
27.9k
        (exts->meths_count + 1) * sizeof(custom_ext_method));
448
27.9k
    if (tmp == NULL)
449
0
        return 0;
450
451
27.9k
    exts->meths = tmp;
452
27.9k
    meth = exts->meths + exts->meths_count;
453
27.9k
    memset(meth, 0, sizeof(*meth));
454
27.9k
    meth->role = role;
455
27.9k
    meth->context = context;
456
27.9k
    meth->parse_cb = parse_cb;
457
27.9k
    meth->add_cb = add_cb;
458
27.9k
    meth->free_cb = free_cb;
459
27.9k
    meth->ext_type = ext_type;
460
27.9k
    meth->ext_flags = (ctx == NULL) ? SSL_EXT_FLAG_CONN : 0;
461
27.9k
    meth->add_arg = add_arg;
462
27.9k
    meth->parse_arg = parse_arg;
463
27.9k
    exts->meths_count++;
464
27.9k
    return 1;
465
27.9k
}
466
467
static int add_old_custom_ext(SSL_CTX *ctx, ENDPOINT role,
468
    unsigned int ext_type,
469
    unsigned int context,
470
    custom_ext_add_cb add_cb,
471
    custom_ext_free_cb free_cb,
472
    void *add_arg,
473
    custom_ext_parse_cb parse_cb, void *parse_arg)
474
0
{
475
0
    custom_ext_add_cb_wrap *add_cb_wrap
476
0
        = OPENSSL_malloc(sizeof(*add_cb_wrap));
477
0
    custom_ext_parse_cb_wrap *parse_cb_wrap
478
0
        = OPENSSL_malloc(sizeof(*parse_cb_wrap));
479
0
    int ret;
480
481
0
    if (add_cb_wrap == NULL || parse_cb_wrap == NULL) {
482
0
        OPENSSL_free(add_cb_wrap);
483
0
        OPENSSL_free(parse_cb_wrap);
484
0
        return 0;
485
0
    }
486
487
0
    add_cb_wrap->add_arg = add_arg;
488
0
    add_cb_wrap->add_cb = add_cb;
489
0
    add_cb_wrap->free_cb = free_cb;
490
0
    parse_cb_wrap->parse_arg = parse_arg;
491
0
    parse_cb_wrap->parse_cb = parse_cb;
492
493
0
    ret = ossl_tls_add_custom_ext_intern(ctx, NULL, role, ext_type,
494
0
        context,
495
0
        custom_ext_add_old_cb_wrap,
496
0
        custom_ext_free_old_cb_wrap,
497
0
        add_cb_wrap,
498
0
        custom_ext_parse_old_cb_wrap,
499
0
        parse_cb_wrap);
500
501
0
    if (!ret) {
502
0
        OPENSSL_free(add_cb_wrap);
503
0
        OPENSSL_free(parse_cb_wrap);
504
0
    }
505
506
0
    return ret;
507
0
}
508
509
/* Application level functions to add the old custom extension callbacks */
510
int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
511
    custom_ext_add_cb add_cb,
512
    custom_ext_free_cb free_cb,
513
    void *add_arg,
514
    custom_ext_parse_cb parse_cb, void *parse_arg)
515
0
{
516
0
    return add_old_custom_ext(ctx, ENDPOINT_CLIENT, ext_type,
517
0
        SSL_EXT_TLS1_2_AND_BELOW_ONLY
518
0
            | SSL_EXT_CLIENT_HELLO
519
0
            | SSL_EXT_TLS1_2_SERVER_HELLO
520
0
            | SSL_EXT_IGNORE_ON_RESUMPTION,
521
0
        add_cb, free_cb, add_arg, parse_cb, parse_arg);
522
0
}
523
524
int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
525
    custom_ext_add_cb add_cb,
526
    custom_ext_free_cb free_cb,
527
    void *add_arg,
528
    custom_ext_parse_cb parse_cb, void *parse_arg)
529
0
{
530
0
    return add_old_custom_ext(ctx, ENDPOINT_SERVER, ext_type,
531
0
        SSL_EXT_TLS1_2_AND_BELOW_ONLY
532
0
            | SSL_EXT_CLIENT_HELLO
533
0
            | SSL_EXT_TLS1_2_SERVER_HELLO
534
0
            | SSL_EXT_IGNORE_ON_RESUMPTION,
535
0
        add_cb, free_cb, add_arg, parse_cb, parse_arg);
536
0
}
537
538
int SSL_CTX_add_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
539
    unsigned int context,
540
    SSL_custom_ext_add_cb_ex add_cb,
541
    SSL_custom_ext_free_cb_ex free_cb,
542
    void *add_arg,
543
    SSL_custom_ext_parse_cb_ex parse_cb, void *parse_arg)
544
0
{
545
0
    return ossl_tls_add_custom_ext_intern(ctx, NULL, ENDPOINT_BOTH, ext_type,
546
0
        context, add_cb, free_cb, add_arg,
547
0
        parse_cb, parse_arg);
548
0
}
549
550
int SSL_extension_supported(unsigned int ext_type)
551
41.9k
{
552
41.9k
    switch (ext_type) {
553
        /* Internally supported extensions. */
554
0
    case TLSEXT_TYPE_application_layer_protocol_negotiation:
555
0
    case TLSEXT_TYPE_ec_point_formats:
556
0
    case TLSEXT_TYPE_supported_groups:
557
0
    case TLSEXT_TYPE_key_share:
558
0
#ifndef OPENSSL_NO_NEXTPROTONEG
559
0
    case TLSEXT_TYPE_next_proto_neg:
560
0
#endif
561
0
    case TLSEXT_TYPE_padding:
562
0
    case TLSEXT_TYPE_renegotiate:
563
0
    case TLSEXT_TYPE_max_fragment_length:
564
0
    case TLSEXT_TYPE_server_name:
565
0
    case TLSEXT_TYPE_session_ticket:
566
0
    case TLSEXT_TYPE_signature_algorithms:
567
0
#ifndef OPENSSL_NO_SRP
568
0
    case TLSEXT_TYPE_srp:
569
0
#endif
570
0
#ifndef OPENSSL_NO_OCSP
571
0
    case TLSEXT_TYPE_status_request:
572
0
#endif
573
0
#ifndef OPENSSL_NO_CT
574
0
    case TLSEXT_TYPE_signed_certificate_timestamp:
575
0
#endif
576
0
#ifndef OPENSSL_NO_SRTP
577
0
    case TLSEXT_TYPE_use_srtp:
578
0
#endif
579
0
    case TLSEXT_TYPE_encrypt_then_mac:
580
0
    case TLSEXT_TYPE_supported_versions:
581
0
    case TLSEXT_TYPE_extended_master_secret:
582
0
    case TLSEXT_TYPE_psk_kex_modes:
583
0
    case TLSEXT_TYPE_cookie:
584
0
    case TLSEXT_TYPE_early_data:
585
0
    case TLSEXT_TYPE_certificate_authorities:
586
0
    case TLSEXT_TYPE_psk:
587
0
    case TLSEXT_TYPE_post_handshake_auth:
588
0
    case TLSEXT_TYPE_compress_certificate:
589
0
    case TLSEXT_TYPE_client_cert_type:
590
0
    case TLSEXT_TYPE_server_cert_type:
591
0
        return 1;
592
41.9k
    default:
593
41.9k
        return 0;
594
41.9k
    }
595
41.9k
}