diff --git a/deps/libssl/openssl b/deps/libssl/openssl index 462a8003a..210dff23f 120000 --- a/deps/libssl/openssl +++ b/deps/libssl/openssl @@ -1 +1 @@ -openssl-3.1.4 \ No newline at end of file +openssl-3.2.1 \ No newline at end of file diff --git a/deps/libssl/openssl-3.1.4.tar.gz b/deps/libssl/openssl-3.2.1.tar.gz similarity index 60% rename from deps/libssl/openssl-3.1.4.tar.gz rename to deps/libssl/openssl-3.2.1.tar.gz index 97c9a36dd..890dbfff0 100644 Binary files a/deps/libssl/openssl-3.1.4.tar.gz and b/deps/libssl/openssl-3.2.1.tar.gz differ diff --git a/deps/libssl/verify-bio_st-match.sh b/deps/libssl/verify-bio_st-match.sh index b4903e032..666932c55 100755 --- a/deps/libssl/verify-bio_st-match.sh +++ b/deps/libssl/verify-bio_st-match.sh @@ -17,9 +17,15 @@ echo "extracting 'struct bio_st' from 'lib/mysql_data_stream.cpp'" LIBBIOST=$(cd ../../; cat ./lib/mysql_data_stream.cpp | sed '/^\/\*/,/*\//d' | sed -n '/^struct bio_st {/,/}/p') echo -n "Comparing ... " -if [[ "$LIBBIOST" == "$DEPBIOST" ]]; then - echo "PASS - bio_st is a match!"; +if [[ "$LIBBIOST" =~ "$DEPBIOST" ]]; then + echo "PASS - bio_st is a match!" else - echo "FAIL - bio_st does not match!"; + echo "FAIL - bio_st does not match!" + echo + echo ">>> lib/mysql_data_stream.cpp" + echo "$LIBBIOST" + echo "===" + echo "$DEPBIOST" + echo "<<< deps/libssl/openssl/crypto/bio/bio_local.h" exit 1 fi diff --git a/lib/mysql_data_stream.cpp b/lib/mysql_data_stream.cpp index dd2f2e2d3..4d1fa9ae0 100644 --- a/lib/mysql_data_stream.cpp +++ b/lib/mysql_data_stream.cpp @@ -10,36 +10,39 @@ #include -/* - -in libssl 1.1.0 -struct bio_st { - const BIO_METHOD *method; - long (*callback) (struct bio_st *, int, const char *, int, long, long); - char *cb_arg; - int init; - int shutdown; - int flags; - int retry_reason; - int num; - void *ptr; - struct bio_st *next_bio; - struct bio_st *prev_bio; - int references; - uint64_t num_read; - uint64_t num_write; - CRYPTO_EX_DATA ex_data; - CRYPTO_RWLOCK *lock; -}; -*/ - -typedef int CRYPTO_REF_COUNT; /** - * @brief This is the 'bio_st' struct definition from libssl 3.0.0. NOTE: This is an internal struct from + * @brief This is the 'bio_st' struct definition from libssl. NOTE: This is an internal struct from * OpenSSL library, currently it's used for performing checks on the reads/writes performed on the BIO objects. * It's extremely important to keep this struct up to date with each OpenSSL dependency update. */ +typedef int CRYPTO_REF_COUNT; + +#if (OPENSSL_VERSION_NUMBER & 0xFFFF0000) == 0x10100000 +#pragma message "libssl 1.1.x detected" +struct bio_st { + const BIO_METHOD *method; + /* bio, mode, argp, argi, argl, ret */ + BIO_callback_fn callback; + BIO_callback_fn_ex callback_ex; + char *cb_arg; /* first argument for the callback */ + int init; + int shutdown; + int flags; /* extra storage */ + int retry_reason; + int num; + void *ptr; + struct bio_st *next_bio; /* used by filter BIOs */ + struct bio_st *prev_bio; /* used by filter BIOs */ + CRYPTO_REF_COUNT references; + uint64_t num_read; + uint64_t num_write; + CRYPTO_EX_DATA ex_data; + CRYPTO_RWLOCK *lock; +}; + +#elif (OPENSSL_VERSION_NUMBER & 0xFFFF0000) == 0x30000000 || (OPENSSL_VERSION_NUMBER & 0xFFFF0000) == 0x30100000 +#pragma message "libssl 3.0.x / 3.1.x detected" struct bio_st { OSSL_LIB_CTX *libctx; const BIO_METHOD *method; @@ -64,6 +67,35 @@ struct bio_st { CRYPTO_RWLOCK *lock; }; +#elif (OPENSSL_VERSION_NUMBER & 0xFFFF0000) == 0x30200000 +#pragma message "libssl 3.2.x detected" +struct bio_st { + OSSL_LIB_CTX *libctx; + const BIO_METHOD *method; + /* bio, mode, argp, argi, argl, ret */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 + BIO_callback_fn callback; +#endif + BIO_callback_fn_ex callback_ex; + char *cb_arg; /* first argument for the callback */ + int init; + int shutdown; + int flags; /* extra storage */ + int retry_reason; + int num; + void *ptr; + struct bio_st *next_bio; /* used by filter BIOs */ + struct bio_st *prev_bio; /* used by filter BIOs */ + CRYPTO_REF_COUNT references; + uint64_t num_read; + uint64_t num_write; + CRYPTO_EX_DATA ex_data; +}; + +#else +#error "libssl version not supported: OPENSSL_VERSION_NUMBER = " ##OPENSSL_VERSION_NUMBER +#endif + #define RESULTSET_BUFLEN_DS_16K 16000 #define RESULTSET_BUFLEN_DS_1M 1000*1024