From c34ca13a60f2acb4509be0aec9f506853ffbd1ea Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 24 Jul 2020 13:47:35 -0700 Subject: [PATCH] Add a ktls_crypto_info_t typedef. This type is defined to hold the OS-specific structure passed to BIO_set_ktls. Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/12111) --- include/internal/ktls.h | 5 +++++ ssl/t1_enc.c | 6 ++---- ssl/tls13_enc.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/internal/ktls.h b/include/internal/ktls.h index 535e563479d..a9b1c741908 100644 --- a/include/internal/ktls.h +++ b/include/internal/ktls.h @@ -37,6 +37,8 @@ */ # define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 8 +typedef struct tls_enable ktls_crypto_info_t; + /* * FreeBSD does not require any additional steps to enable KTLS before * setting keys. @@ -173,6 +175,9 @@ struct tls_crypto_info_all { }; size_t tls_crypto_info_len; }; + +typedef struct tls_crypto_info_all ktls_crypto_info_t; + /* * When successful, this socket option doesn't change the behaviour of the * TCP socket, except changing the TCP setsockopt handler to enable the diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 2e461870241..5ccf2e2a503 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -192,10 +192,8 @@ int tls1_change_cipher_state(SSL *s, int which) size_t n, i, j, k, cl; int reuse_dd = 0; #ifndef OPENSSL_NO_KTLS -# ifdef __FreeBSD__ - struct tls_enable crypto_info; -# else - struct tls_crypto_info_all crypto_info; + ktls_crypto_info_t crypto_info; +# ifndef __FreeBSD__ unsigned char *rec_seq; void *rl_sequence; # ifndef OPENSSL_NO_KTLS_RX diff --git a/ssl/tls13_enc.c b/ssl/tls13_enc.c index ba385f6ea2e..75034f5179f 100644 --- a/ssl/tls13_enc.c +++ b/ssl/tls13_enc.c @@ -517,7 +517,7 @@ int tls13_change_cipher_state(SSL *s, int which) const EVP_CIPHER *cipher = NULL; #if !defined(OPENSSL_NO_KTLS) && defined(OPENSSL_KTLS_TLS13) # ifndef __FreeBSD__ - struct tls_crypto_info_all crypto_info; + ktls_crypto_info_t crypto_info; BIO *bio; # endif #endif -- 2.47.2