summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bss_sock.c
diff options
context:
space:
mode:
authorVadim Fedorenko <vadimjunk@gmail.com>2020-01-24 16:57:56 +0300
committerMatt Caswell <matt@openssl.org>2020-06-08 11:13:52 +0100
commit4ffccf6c4deebd6f3ab5d46234c64f957ff1c1c5 (patch)
tree86c0bb72610106b0f01e7da53724357e5127194b /crypto/bio/bss_sock.c
parent95badfeb60603b1bbcfc4d0fef555aed06038d55 (diff)
kTLS: add support for AES_CCM128 and AES_GCM256
The support of new algos is added by converting code to use helper functions found in ktls.h. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11589)
Diffstat (limited to 'crypto/bio/bss_sock.c')
-rw-r--r--crypto/bio/bss_sock.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
index a72a476803..ff2bde7a58 100644
--- a/crypto/bio/bss_sock.c
+++ b/crypto/bio/bss_sock.c
@@ -154,10 +154,11 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
long ret = 1;
int *ip;
# ifndef OPENSSL_NO_KTLS
+ size_t crypto_info_len;
# ifdef __FreeBSD__
struct tls_enable *crypto_info;
# else
- struct tls12_crypto_info_aes_gcm_128 *crypto_info;
+ struct tls_crypto_info_all *crypto_info;
# endif
# endif
@@ -191,10 +192,12 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
case BIO_CTRL_SET_KTLS:
# ifdef __FreeBSD__
crypto_info = (struct tls_enable *)ptr;
+ crypto_info_len = sizeof(*crypto_info);
# else
- crypto_info = (struct tls12_crypto_info_aes_gcm_128 *)ptr;
+ crypto_info = (struct tls_crypto_info_all *)ptr;
+ crypto_info_len = crypto_info->tls_crypto_info_len;
# endif
- ret = ktls_start(b->num, crypto_info, sizeof(*crypto_info), num);
+ ret = ktls_start(b->num, crypto_info, crypto_info_len, num);
if (ret)
BIO_set_ktls_flag(b, num);
break;