Debian Codegraph @

crt/s2n/tls/extensions/s2n_client_sct_list.c

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 #include "tls/extensions/s2n_client_sct_list.h"
17
18 #include <stdint.h>
19
20 #include "tls/s2n_tls.h"
21 #include "tls/s2n_tls_parameters.h"
22 #include "utils/s2n_safety.h"
23
24 static bool s2n_client_sct_list_should_send(struct s2n_connection *conn);
25 static int s2n_client_sct_list_recv(struct s2n_connection *conn, struct s2n_stuffer *extension);
26
27 const s2n_extension_type s2n_client_sct_list_extension = {
28 .iana_value = TLS_EXTENSION_SCT_LIST,
29 .is_response = false,
30 .send = s2n_extension_send_noop,
31 .recv = s2n_client_sct_list_recv,
32 .should_send = s2n_client_sct_list_should_send,
33 .if_missing = s2n_extension_noop_if_missing,
34 };
35
36 static bool s2n_client_sct_list_should_send(struct s2n_connection *conn)
37 {
38 return conn->config->ct_type != S2N_CT_SUPPORT_NONE;
39 }
40
41 static int s2n_client_sct_list_recv(struct s2n_connection *conn, struct s2n_stuffer *out)
42 {
43 conn->ct_level_requested = S2N_CT_SUPPORT_REQUEST;
44 /* Skip reading the extension, per RFC6962 (3.1.1) it SHOULD be empty anyway */
45 return S2N_SUCCESS;
46 }