Skip to content

Commit 01a1685

Browse files
updating socat support to version 1.8.0.0
1 parent 5657d88 commit 01a1685

6 files changed

Lines changed: 41 additions & 0 deletions

File tree

src/internal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7605,6 +7605,9 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
76057605
"err = %d", ret);
76067606
return MEMORY_E;
76077607
}
7608+
#ifdef HAVE_MAX_FRAGMENT
7609+
ssl->session->maxFragmentSz = ssl->max_fragment;
7610+
#endif /* HAVE_MAX_FRAGMENT */
76087611
#ifdef HAVE_SESSION_TICKET
76097612
ssl->options.noTicketTls12 = ctx->noTicketTls12;
76107613
#endif

src/ssl.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14939,6 +14939,17 @@ int wolfSSL_COMP_add_compression_method(int method, void* data)
1493914939
}
1494014940
#endif
1494114941

14942+
#ifndef NO_WOLFSSL_STUB
14943+
const char* wolfSSL_COMP_get_name(const void* comp)
14944+
{
14945+
static const char ret[] = "not supported";
14946+
14947+
(void)comp;
14948+
WOLFSSL_STUB("wolfSSL_COMP_get_name");
14949+
return ret;
14950+
}
14951+
#endif
14952+
1494214953
/* wolfSSL_set_dynlock_create_callback
1494314954
* CRYPTO_set_dynlock_create_callback has been deprecated since openSSL 1.0.1.
1494414955
* This function exists for compatibility purposes because wolfSSL satisfies

src/ssl_sess.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,17 @@ long wolfSSL_CTX_set_session_cache_mode(WOLFSSL_CTX* ctx, long mode)
747747
}
748748

749749
#ifdef OPENSSL_EXTRA
750+
/* return the max fragment size set when handshake was negotiated */
751+
uint8_t wolfSSL_SESSION_get_max_fragment_length(WOLFSSL_SESSION* session)
752+
{
753+
if (session == NULL) {
754+
return 0;
755+
}
756+
757+
return session->maxFragmentSz;
758+
}
759+
760+
750761
/* Get the session cache mode for CTX
751762
*
752763
* ctx WOLFSSL_CTX struct to get cache mode from

wolfssl/internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4432,6 +4432,9 @@ struct WOLFSSL_SESSION {
44324432
#endif
44334433
#ifdef HAVE_EX_DATA
44344434
WOLFSSL_CRYPTO_EX_DATA ex_data;
4435+
#endif
4436+
#ifdef OPENSSL_EXTRA
4437+
word32 maxFragmentSz;
44354438
#endif
44364439
byte isSetup:1;
44374440
};

wolfssl/openssl/ssl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
367367
#define SSL_SESSION_dup wolfSSL_SESSION_dup
368368
#define SSL_SESSION_free wolfSSL_SESSION_free
369369
#define SSL_SESSION_set_cipher wolfSSL_SESSION_set_cipher
370+
#define SSL_SESSION_get_max_fragment_length \
371+
wolfSSL_SESSION_get_max_fragment_length
370372
#define SSL_is_init_finished wolfSSL_is_init_finished
371373

372374
#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_
834836
#define COMP_rle wolfSSL_COMP_rle
835837
#define SSL_COMP_add_compression_method wolfSSL_COMP_add_compression_method
836838

839+
#define SSL_get_current_compression(ssl) 0
840+
#define SSL_get_current_expansion(ssl) 0
841+
#define SSL_COMP_get_name wolfSSL_COMP_get_name
842+
837843
#define SSL_get_ex_new_index wolfSSL_get_ex_new_index
838844
#define RSA_get_ex_new_index wolfSSL_get_ex_new_index
839845

@@ -1227,6 +1233,7 @@ typedef WOLFSSL_SRTP_PROTECTION_PROFILE SRTP_PROTECTION_PROFILE;
12271233

12281234
#define TLSEXT_STATUSTYPE_ocsp 1
12291235

1236+
#define TLSEXT_max_fragment_length_DISABLED WOLFSSL_MFL_DISABLED
12301237
#define TLSEXT_max_fragment_length_512 WOLFSSL_MFL_2_9
12311238
#define TLSEXT_max_fragment_length_1024 WOLFSSL_MFL_2_10
12321239
#define TLSEXT_max_fragment_length_2048 WOLFSSL_MFL_2_11

wolfssl/ssl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,10 @@ WOLFSSL_API int wolfSSL_set_session_id_context(WOLFSSL* ssl, const unsigned cha
16811681
WOLFSSL_API void wolfSSL_set_connect_state(WOLFSSL* ssl);
16821682
WOLFSSL_API void wolfSSL_set_accept_state(WOLFSSL* ssl);
16831683
WOLFSSL_API int wolfSSL_session_reused(WOLFSSL* ssl);
1684+
#ifdef OPENSSL_EXTRA
1685+
WOLFSSL_API uint8_t wolfSSL_SESSION_get_max_fragment_length(
1686+
WOLFSSL_SESSION* session);
1687+
#endif
16841688
WOLFSSL_API int wolfSSL_SESSION_up_ref(WOLFSSL_SESSION* session);
16851689
WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_dup(WOLFSSL_SESSION* session);
16861690
WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_new(void);
@@ -3916,6 +3920,7 @@ WOLFSSL_API int wolfSSL_ALPN_FreePeerProtocol(WOLFSSL* ssl, char **list);
39163920

39173921
/* Fragment lengths */
39183922
enum {
3923+
WOLFSSL_MFL_DISABLED = 0,
39193924
WOLFSSL_MFL_2_9 = 1, /* 512 bytes */
39203925
WOLFSSL_MFL_2_10 = 2, /* 1024 bytes */
39213926
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)
51975202
WOLFSSL_API int wolfSSL_i2d_ASN1_OBJECT(WOLFSSL_ASN1_OBJECT *a, unsigned char **pp);
51985203
WOLFSSL_API void SSL_CTX_set_tmp_dh_callback(WOLFSSL_CTX *ctx, WOLFSSL_DH *(*dh) (WOLFSSL *ssl, int is_export, int keylength));
51995204
WOLFSSL_API WOLF_STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
5205+
WOLFSSL_API const char* wolfSSL_COMP_get_name(const void* comp);
52005206
WOLFSSL_API int wolfSSL_X509_STORE_load_locations(WOLFSSL_X509_STORE *str, const char *file, const char *dir);
52015207
WOLFSSL_API int wolfSSL_X509_STORE_add_crl(WOLFSSL_X509_STORE *ctx, WOLFSSL_X509_CRL *x);
52025208
WOLFSSL_API int wolfSSL_sk_SSL_CIPHER_num(const WOLF_STACK_OF(WOLFSSL_CIPHER)* p);

0 commit comments

Comments
 (0)