Debian Codegraph @

crt/s2n/tls/extensions/s2n_extension_list.h

raw symbols SCIP
1 /*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 #pragma once
17
18 #include "stuffer/s2n_stuffer.h"
19 #include "tls/extensions/s2n_extension_type.h"
20
21 #define S2N_PARSED_EXTENSIONS_COUNT S2N_SUPPORTED_EXTENSIONS_COUNT
22
23 typedef struct {
24 struct s2n_blob extension;
25 uint16_t extension_type;
26 uint16_t wire_index;
27 unsigned processed : 1;
28 } s2n_parsed_extension;
29
30 typedef struct {
31 s2n_parsed_extension parsed_extensions[S2N_PARSED_EXTENSIONS_COUNT];
32 struct s2n_blob raw; /* Needed by some ClientHello APIs */
33 uint16_t count;
34 } s2n_parsed_extensions_list;
35
36 typedef enum {
37 S2N_EXTENSION_LIST_CLIENT_HELLO = 0,
38 S2N_EXTENSION_LIST_HELLO_RETRY_REQUEST,
39 S2N_EXTENSION_LIST_SERVER_HELLO_DEFAULT,
40 S2N_EXTENSION_LIST_SERVER_HELLO_TLS13,
41 S2N_EXTENSION_LIST_ENCRYPTED_EXTENSIONS,
42 S2N_EXTENSION_LIST_CERT_REQ,
43 S2N_EXTENSION_LIST_CERTIFICATE,
44 S2N_EXTENSION_LIST_NST,
45 S2N_EXTENSION_LIST_ENCRYPTED_EXTENSIONS_TLS12,
46 S2N_EXTENSION_LIST_EMPTY,
47 S2N_EXTENSION_LIST_IDS_COUNT,
48 } s2n_extension_list_id;
49
50 int s2n_extension_list_send(s2n_extension_list_id list_type, struct s2n_connection *conn, struct s2n_stuffer *out);
51 int s2n_extension_list_recv(s2n_extension_list_id list_type, struct s2n_connection *conn, struct s2n_stuffer *in);
52
53 int s2n_extension_process(const s2n_extension_type *extension_type, struct s2n_connection *conn,
54 s2n_parsed_extensions_list *parsed_extension_list);
55 int s2n_extension_list_process(s2n_extension_list_id list_type, struct s2n_connection *conn,
56 s2n_parsed_extensions_list *parsed_extension_list);
57 int s2n_extension_list_parse(struct s2n_stuffer *in, s2n_parsed_extensions_list *parsed_extension_list);