Skip to content

Commit c050b08

Browse files
authored
ktls: rm kTLS request field on config (#3816)
1 parent ecedd2b commit c050b08

File tree

3 files changed

+0
-63
lines changed

3 files changed

+0
-63
lines changed

tests/unit/s2n_ktls_mode_test.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,6 @@ int main(int argc, char **argv)
2121
{
2222
BEGIN_TEST();
2323

24-
/* Default config kTLS mode */
25-
{
26-
DEFER_CLEANUP(struct s2n_config *config = s2n_config_new(), s2n_config_ptr_free);
27-
EXPECT_NOT_NULL(config);
28-
EXPECT_FALSE(config->ktls_send_requested);
29-
EXPECT_FALSE(config->ktls_recv_requested);
30-
};
31-
32-
/* Request config kTLS mode */
33-
{
34-
DEFER_CLEANUP(struct s2n_config *config = s2n_config_new(), s2n_config_ptr_free);
35-
EXPECT_NOT_NULL(config);
36-
37-
EXPECT_SUCCESS(s2n_config_set_ktls_mode(config, S2N_KTLS_MODE_SEND));
38-
EXPECT_TRUE(config->ktls_send_requested);
39-
EXPECT_FALSE(config->ktls_recv_requested);
40-
41-
EXPECT_SUCCESS(s2n_config_set_ktls_mode(config, S2N_KTLS_MODE_RECV));
42-
EXPECT_FALSE(config->ktls_send_requested);
43-
EXPECT_TRUE(config->ktls_recv_requested);
44-
45-
EXPECT_SUCCESS(s2n_config_set_ktls_mode(config, S2N_KTLS_MODE_DISABLED));
46-
EXPECT_FALSE(config->ktls_send_requested);
47-
EXPECT_FALSE(config->ktls_recv_requested);
48-
49-
EXPECT_SUCCESS(s2n_config_set_ktls_mode(config, S2N_KTLS_MODE_DUPLEX));
50-
EXPECT_TRUE(config->ktls_send_requested);
51-
EXPECT_TRUE(config->ktls_recv_requested);
52-
};
53-
5424
/* Default connection kTLS mode */
5525
{
5626
DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_CLIENT),

tls/s2n_config.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,30 +1072,3 @@ int s2n_config_set_recv_multi_record(struct s2n_config *config, bool enabled)
10721072

10731073
return S2N_SUCCESS;
10741074
}
1075-
1076-
/* Indicates if the connection should attempt to enable kTLS. */
1077-
int s2n_config_set_ktls_mode(struct s2n_config *config, s2n_ktls_mode ktls_mode)
1078-
{
1079-
POSIX_ENSURE_REF(config);
1080-
1081-
switch (ktls_mode) {
1082-
case S2N_KTLS_MODE_DUPLEX:
1083-
config->ktls_recv_requested = true;
1084-
config->ktls_send_requested = true;
1085-
break;
1086-
case S2N_KTLS_MODE_SEND:
1087-
config->ktls_recv_requested = false;
1088-
config->ktls_send_requested = true;
1089-
break;
1090-
case S2N_KTLS_MODE_RECV:
1091-
config->ktls_recv_requested = true;
1092-
config->ktls_send_requested = false;
1093-
break;
1094-
case S2N_KTLS_MODE_DISABLED:
1095-
config->ktls_recv_requested = false;
1096-
config->ktls_send_requested = false;
1097-
break;
1098-
}
1099-
1100-
return S2N_SUCCESS;
1101-
}

tls/s2n_config.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ struct s2n_config {
101101
*/
102102
unsigned recv_multi_record : 1;
103103

104-
/* Depending on OS and configuration it is possible to use kTLS.
105-
*
106-
* This option indicates if connections should attempt to use kTLS. */
107-
unsigned ktls_send_requested : 1;
108-
unsigned ktls_recv_requested : 1;
109-
110104
struct s2n_dh_params *dhparams;
111105
/* Needed until we can deprecate s2n_config_add_cert_chain_and_key. This is
112106
* used to release memory allocated only in the deprecated API that the application

0 commit comments

Comments
 (0)