From 01a16851590daa2adda5b4afcaf5b041b47e7a45 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 22 May 2024 15:43:13 -0600 Subject: [PATCH] updating socat support to version 1.8.0.0 --- src/internal.c | 3 +++ src/ssl.c | 11 +++++++++++ src/ssl_sess.c | 11 +++++++++++ wolfssl/internal.h | 3 +++ wolfssl/openssl/ssl.h | 7 +++++++ wolfssl/ssl.h | 6 ++++++ 6 files changed, 41 insertions(+) diff --git a/src/internal.c b/src/internal.c index 56e72376f..8a2a584b2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -7605,6 +7605,9 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup) "err = %d", ret); return MEMORY_E; } +#ifdef HAVE_MAX_FRAGMENT + ssl->session->maxFragmentSz = ssl->max_fragment; +#endif /* HAVE_MAX_FRAGMENT */ #ifdef HAVE_SESSION_TICKET ssl->options.noTicketTls12 = ctx->noTicketTls12; #endif diff --git a/src/ssl.c b/src/ssl.c index 5fd3364b9..e80267139 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -14939,6 +14939,17 @@ int wolfSSL_COMP_add_compression_method(int method, void* data) } #endif +#ifndef NO_WOLFSSL_STUB +const char* wolfSSL_COMP_get_name(const void* comp) +{ + static const char ret[] = "not supported"; + + (void)comp; + WOLFSSL_STUB("wolfSSL_COMP_get_name"); + return ret; +} +#endif + /* wolfSSL_set_dynlock_create_callback * CRYPTO_set_dynlock_create_callback has been deprecated since openSSL 1.0.1. * This function exists for compatibility purposes because wolfSSL satisfies diff --git a/src/ssl_sess.c b/src/ssl_sess.c index 23b595be8..695eb0677 100644 --- a/src/ssl_sess.c +++ b/src/ssl_sess.c @@ -747,6 +747,17 @@ long wolfSSL_CTX_set_session_cache_mode(WOLFSSL_CTX* ctx, long mode) } #ifdef OPENSSL_EXTRA +/* return the max fragment size set when handshake was negotiated */ +uint8_t wolfSSL_SESSION_get_max_fragment_length(WOLFSSL_SESSION* session) +{ + if (session == NULL) { + return 0; + } + + return session->maxFragmentSz; +} + + /* Get the session cache mode for CTX * * ctx WOLFSSL_CTX struct to get cache mode from diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 15c1c7489..f9160b693 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -4432,6 +4432,9 @@ struct WOLFSSL_SESSION { #endif #ifdef HAVE_EX_DATA WOLFSSL_CRYPTO_EX_DATA ex_data; +#endif +#ifdef OPENSSL_EXTRA + word32 maxFragmentSz; #endif byte isSetup:1; }; diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index d26cfdbb1..14f222c34 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -367,6 +367,8 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; #define SSL_SESSION_dup wolfSSL_SESSION_dup #define SSL_SESSION_free wolfSSL_SESSION_free #define SSL_SESSION_set_cipher wolfSSL_SESSION_set_cipher +#define SSL_SESSION_get_max_fragment_length \ + wolfSSL_SESSION_get_max_fragment_length #define SSL_is_init_finished wolfSSL_is_init_finished #define SSL_SESSION_set1_id wolfSSL_SESSION_set1_id @@ -834,6 +836,10 @@ wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_ #define COMP_rle wolfSSL_COMP_rle #define SSL_COMP_add_compression_method wolfSSL_COMP_add_compression_method +#define SSL_get_current_compression(ssl) 0 +#define SSL_get_current_expansion(ssl) 0 +#define SSL_COMP_get_name wolfSSL_COMP_get_name + #define SSL_get_ex_new_index wolfSSL_get_ex_new_index #define RSA_get_ex_new_index wolfSSL_get_ex_new_index @@ -1227,6 +1233,7 @@ typedef WOLFSSL_SRTP_PROTECTION_PROFILE SRTP_PROTECTION_PROFILE; #define TLSEXT_STATUSTYPE_ocsp 1 +#define TLSEXT_max_fragment_length_DISABLED WOLFSSL_MFL_DISABLED #define TLSEXT_max_fragment_length_512 WOLFSSL_MFL_2_9 #define TLSEXT_max_fragment_length_1024 WOLFSSL_MFL_2_10 #define TLSEXT_max_fragment_length_2048 WOLFSSL_MFL_2_11 diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index f12d32a23..ba13f5ce5 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1681,6 +1681,10 @@ WOLFSSL_API int wolfSSL_set_session_id_context(WOLFSSL* ssl, const unsigned cha WOLFSSL_API void wolfSSL_set_connect_state(WOLFSSL* ssl); WOLFSSL_API void wolfSSL_set_accept_state(WOLFSSL* ssl); WOLFSSL_API int wolfSSL_session_reused(WOLFSSL* ssl); +#ifdef OPENSSL_EXTRA +WOLFSSL_API uint8_t wolfSSL_SESSION_get_max_fragment_length( + WOLFSSL_SESSION* session); +#endif WOLFSSL_API int wolfSSL_SESSION_up_ref(WOLFSSL_SESSION* session); WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_dup(WOLFSSL_SESSION* session); WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_new(void); @@ -3916,6 +3920,7 @@ WOLFSSL_API int wolfSSL_ALPN_FreePeerProtocol(WOLFSSL* ssl, char **list); /* Fragment lengths */ enum { + WOLFSSL_MFL_DISABLED = 0, WOLFSSL_MFL_2_9 = 1, /* 512 bytes */ WOLFSSL_MFL_2_10 = 2, /* 1024 bytes */ WOLFSSL_MFL_2_11 = 3, /* 2048 bytes */ @@ -5197,6 +5202,7 @@ WOLFSSL_API int wolfSSL_i2a_ASN1_OBJECT(WOLFSSL_BIO *bp, WOLFSSL_ASN1_OBJECT *a) WOLFSSL_API int wolfSSL_i2d_ASN1_OBJECT(WOLFSSL_ASN1_OBJECT *a, unsigned char **pp); WOLFSSL_API void SSL_CTX_set_tmp_dh_callback(WOLFSSL_CTX *ctx, WOLFSSL_DH *(*dh) (WOLFSSL *ssl, int is_export, int keylength)); WOLFSSL_API WOLF_STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); +WOLFSSL_API const char* wolfSSL_COMP_get_name(const void* comp); WOLFSSL_API int wolfSSL_X509_STORE_load_locations(WOLFSSL_X509_STORE *str, const char *file, const char *dir); WOLFSSL_API int wolfSSL_X509_STORE_add_crl(WOLFSSL_X509_STORE *ctx, WOLFSSL_X509_CRL *x); WOLFSSL_API int wolfSSL_sk_SSL_CIPHER_num(const WOLF_STACK_OF(WOLFSSL_CIPHER)* p);