Add a ktls_crypto_info_t typedef.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 24 Jul 2020 20:47:35 +0000 (13:47 -0700)
committerMatt Caswell <matt@openssl.org>
Mon, 31 Aug 2020 08:34:19 +0000 (09:34 +0100)
This type is defined to hold the OS-specific structure passed to
BIO_set_ktls.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12111)

include/internal/ktls.h
ssl/t1_enc.c
ssl/tls13_enc.c

index 535e563479d88df955e27a676126bd5785814875..a9b1c741908e14eb8a931d23243a7db3d0f3aa78 100644 (file)
@@ -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
index 2e4618702415a9854a4f2ecc88db2cac91047df0..5ccf2e2a503b5607ec977979ea577f8c4cc6f587 100644 (file)
@@ -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
index ba385f6ea2e5d7b64c0064247ff7b69e72e8469f..75034f5179fc4ad1127f67178ec0e743ea29c1d6 100644 (file)
@@ -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