tls_main.c (037303d6760751fdb95ba62cf448ecbc1ac29c98) tls_main.c (8db44ab26bebe969851468bea6072d9a094b2ace)
1/*
2 * Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved.
3 * Copyright (c) 2016-2017, Dave Watson <davejwatson@fb.com>. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the

--- 44 unchanged lines hidden (view full) ---

53MODULE_ALIAS_TCP_ULP("tls");
54
55enum {
56 TLSV4,
57 TLSV6,
58 TLS_NUM_PROTS,
59};
60
1/*
2 * Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved.
3 * Copyright (c) 2016-2017, Dave Watson <davejwatson@fb.com>. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the

--- 44 unchanged lines hidden (view full) ---

53MODULE_ALIAS_TCP_ULP("tls");
54
55enum {
56 TLSV4,
57 TLSV6,
58 TLS_NUM_PROTS,
59};
60
61#define CIPHER_SIZE_DESC(cipher) [cipher - TLS_CIPHER_MIN] = { \
61#define CIPHER_DESC(cipher) [cipher - TLS_CIPHER_MIN] = { \
62 .iv = cipher ## _IV_SIZE, \
63 .key = cipher ## _KEY_SIZE, \
64 .salt = cipher ## _SALT_SIZE, \
65 .tag = cipher ## _TAG_SIZE, \
66 .rec_seq = cipher ## _REC_SEQ_SIZE, \
67}
68
62 .iv = cipher ## _IV_SIZE, \
63 .key = cipher ## _KEY_SIZE, \
64 .salt = cipher ## _SALT_SIZE, \
65 .tag = cipher ## _TAG_SIZE, \
66 .rec_seq = cipher ## _REC_SEQ_SIZE, \
67}
68
69const struct tls_cipher_size_desc tls_cipher_size_desc[TLS_CIPHER_MAX + 1 - TLS_CIPHER_MIN] = {
70 CIPHER_SIZE_DESC(TLS_CIPHER_AES_GCM_128),
71 CIPHER_SIZE_DESC(TLS_CIPHER_AES_GCM_256),
72 CIPHER_SIZE_DESC(TLS_CIPHER_AES_CCM_128),
73 CIPHER_SIZE_DESC(TLS_CIPHER_CHACHA20_POLY1305),
74 CIPHER_SIZE_DESC(TLS_CIPHER_SM4_GCM),
75 CIPHER_SIZE_DESC(TLS_CIPHER_SM4_CCM),
76 CIPHER_SIZE_DESC(TLS_CIPHER_ARIA_GCM_128),
77 CIPHER_SIZE_DESC(TLS_CIPHER_ARIA_GCM_256),
69const struct tls_cipher_desc tls_cipher_desc[TLS_CIPHER_MAX + 1 - TLS_CIPHER_MIN] = {
70 CIPHER_DESC(TLS_CIPHER_AES_GCM_128),
71 CIPHER_DESC(TLS_CIPHER_AES_GCM_256),
72 CIPHER_DESC(TLS_CIPHER_AES_CCM_128),
73 CIPHER_DESC(TLS_CIPHER_CHACHA20_POLY1305),
74 CIPHER_DESC(TLS_CIPHER_SM4_GCM),
75 CIPHER_DESC(TLS_CIPHER_SM4_CCM),
76 CIPHER_DESC(TLS_CIPHER_ARIA_GCM_128),
77 CIPHER_DESC(TLS_CIPHER_ARIA_GCM_256),
78};
79
80static const struct proto *saved_tcpv6_prot;
81static DEFINE_MUTEX(tcpv6_prot_mutex);
82static const struct proto *saved_tcpv4_prot;
83static DEFINE_MUTEX(tcpv4_prot_mutex);
84static struct proto tls_prots[TLS_NUM_PROTS][TLS_NUM_CONFIG][TLS_NUM_CONFIG];
85static struct proto_ops tls_proto_ops[TLS_NUM_PROTS][TLS_NUM_CONFIG][TLS_NUM_CONFIG];

--- 1196 unchanged lines hidden ---
78};
79
80static const struct proto *saved_tcpv6_prot;
81static DEFINE_MUTEX(tcpv6_prot_mutex);
82static const struct proto *saved_tcpv4_prot;
83static DEFINE_MUTEX(tcpv4_prot_mutex);
84static struct proto tls_prots[TLS_NUM_PROTS][TLS_NUM_CONFIG][TLS_NUM_CONFIG];
85static struct proto_ops tls_proto_ops[TLS_NUM_PROTS][TLS_NUM_CONFIG][TLS_NUM_CONFIG];

--- 1196 unchanged lines hidden ---