diff options
author | Vadim Fedorenko <vfedorenko@novek.ru> | 2020-11-24 18:24:49 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-28 01:32:37 +0300 |
commit | 74ea610602e607338d7301e0061d6b33b6b2ad0a (patch) | |
tree | 001d673c685a07a7d88825917ca37fc1cc56857e /net/tls/tls_sw.c | |
parent | a6acbe62353834dc1913d96e1ace140bc9aafca3 (diff) | |
download | linux-74ea610602e607338d7301e0061d6b33b6b2ad0a.tar.xz |
net/tls: add CHACHA20-POLY1305 configuration
Add ChaCha-Poly specific configuration code.
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/tls/tls_sw.c')
-rw-r--r-- | net/tls/tls_sw.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index b4eefdb9c30a..53106f02def2 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -2290,6 +2290,7 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx) struct tls12_crypto_info_aes_gcm_128 *gcm_128_info; struct tls12_crypto_info_aes_gcm_256 *gcm_256_info; struct tls12_crypto_info_aes_ccm_128 *ccm_128_info; + struct tls12_crypto_info_chacha20_poly1305 *chacha20_poly1305_info; struct tls_sw_context_tx *sw_ctx_tx = NULL; struct tls_sw_context_rx *sw_ctx_rx = NULL; struct cipher_context *cctx; @@ -2402,6 +2403,21 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx) cipher_name = "ccm(aes)"; break; } + case TLS_CIPHER_CHACHA20_POLY1305: { + chacha20_poly1305_info = (void *)crypto_info; + nonce_size = 0; + tag_size = TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE; + iv_size = TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE; + iv = chacha20_poly1305_info->iv; + rec_seq_size = TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE; + rec_seq = chacha20_poly1305_info->rec_seq; + keysize = TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE; + key = chacha20_poly1305_info->key; + salt = chacha20_poly1305_info->salt; + salt_size = TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE; + cipher_name = "rfc7539(chacha20,poly1305)"; + break; + } default: rc = -EINVAL; goto free_priv; |