summaryrefslogtreecommitdiff
path: root/ssl/ssl_local.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-02-24 10:12:07 -0800
committerTomas Mraz <tomas@openssl.org>2022-04-06 13:15:27 +0200
commit85773128d0e80cd8dcc772a6931d385b8cf4acd1 (patch)
treeea03d88474e6837280b084a245f2637d3cb2e613 /ssl/ssl_local.h
parentdedb1927751bc9a7ada08cfc4dcc481b8ce1ad81 (diff)
downloadopenssl-new-85773128d0e80cd8dcc772a6931d385b8cf4acd1.tar.gz
KTLS: Check for unprocessed receive records in ktls_configure_crypto.
KTLS implementations currently assume that the start of the in-kernel socket buffer is aligned with the start of a TLS record for the receive side. The socket option to enable KTLS specifies the TLS sequence number of this initial record. When read ahead is enabled, data can be pending in the SSL read buffer after negotiating session keys. This pending data must be examined to ensurs that the kernel's socket buffer does not contain a partial TLS record as well as to determine the correct sequence number of the first TLS record to be processed by the kernel. In preparation for enabling receive kernel offload for TLS 1.3, move the existing logic to handle read ahead from t1_enc.c into ktls.c and invoke it from ktls_configure_crypto(). Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17942)
Diffstat (limited to 'ssl/ssl_local.h')
-rw-r--r--ssl/ssl_local.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ssl/ssl_local.h b/ssl/ssl_local.h
index aee8f9272f..5e3c908cd2 100644
--- a/ssl/ssl_local.h
+++ b/ssl/ssl_local.h
@@ -2764,9 +2764,9 @@ __owur int ssl_log_secret(SSL *ssl, const char *label,
/* ktls.c */
int ktls_check_supported_cipher(const SSL *s, const EVP_CIPHER *c,
const EVP_CIPHER_CTX *dd);
-int ktls_configure_crypto(const SSL *s, const EVP_CIPHER *c, EVP_CIPHER_CTX *dd,
+int ktls_configure_crypto(SSL *s, const EVP_CIPHER *c, EVP_CIPHER_CTX *dd,
void *rl_sequence, ktls_crypto_info_t *crypto_info,
- unsigned char **rec_seq, unsigned char *iv,
+ int is_tx, unsigned char *iv,
unsigned char *key, unsigned char *mac_key,
size_t mac_secret_size);
# endif