Debian Codegraph @

crt/s2n/tests/unit/s2n_ktls_mode_test.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 "s2n_test.h"
17 #include "testlib/s2n_testlib.h"
18 #include "tls/s2n_ktls.h"
19
20 int main(int argc, char **argv)
21 {
22 BEGIN_TEST();
23
24 /* Default connection kTLS mode */
25 {
26 DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_CLIENT),
27 s2n_connection_ptr_free);
28 EXPECT_NOT_NULL(conn);
29 DEFER_CLEANUP(struct s2n_test_io_pair io_pair = { 0 }, s2n_io_pair_close);
30 EXPECT_SUCCESS(s2n_io_pair_init_non_blocking(&io_pair));
31 EXPECT_SUCCESS(s2n_connection_set_io_pair(conn, &io_pair));
32
33 EXPECT_FALSE(conn->ktls_recv_enabled);
34 EXPECT_FALSE(conn->ktls_send_enabled);
35 };
36
37 END_TEST();
38 }