summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-06-28 16:07:59 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-28 08:28:35 +0200
commit06ff90ba3c8c4ddd4d411ce5bea3a0fe3a34e0a3 (patch)
treebd11fdcd1161bc2a9958c3ba7b5a3fefe8ecd3c4
parent53911428585db5042649fc568b2e12facc55d184 (diff)
downloadlinux-stable-06ff90ba3c8c4ddd4d411ce5bea3a0fe3a34e0a3.tar.gz
linux-stable-06ff90ba3c8c4ddd4d411ce5bea3a0fe3a34e0a3.tar.bz2
linux-stable-06ff90ba3c8c4ddd4d411ce5bea3a0fe3a34e0a3.zip
net/tls: reject offload of TLS 1.3
[ Upstream commit 618bac45937a3dc6126ac0652747481e97000f99 ] Neither drivers nor the tls offload code currently supports TLS version 1.3. Check the TLS version when installing connection state. TLS 1.3 will just fallback to the kernel crypto for now. Fixes: 130b392c6cd6 ("net: tls: Add tls 1.3 support") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/tls/tls_device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index f6e258e37611..fdcf18c78bb5 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -746,6 +746,11 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx)
}
crypto_info = &ctx->crypto_send.info;
+ if (crypto_info->version != TLS_1_2_VERSION) {
+ rc = -EOPNOTSUPP;
+ goto free_offload_ctx;
+ }
+
switch (crypto_info->cipher_type) {
case TLS_CIPHER_AES_GCM_128:
nonce_size = TLS_CIPHER_AES_GCM_128_IV_SIZE;
@@ -880,6 +885,9 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx)
struct net_device *netdev;
int rc = 0;
+ if (ctx->crypto_recv.info.version != TLS_1_2_VERSION)
+ return -EOPNOTSUPP;
+
/* We support starting offload on multiple sockets
* concurrently, so we only need a read lock here.
* This lock must precede get_netdev_for_sock to prevent races between