Skip to content

Commit

Permalink
Merge pull request #4165 from sysown/v2.x-update-openssl3.1
Browse files Browse the repository at this point in the history
update OpenSSL to 3.1.0
  • Loading branch information
renecannao authored Apr 13, 2023
2 parents 7a9e864 + c2c3268 commit f577d13
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ endif
libinjection: libinjection/libinjection/src/libinjection.a


BIO_MATCH := $(shell ./libssl/verify-bio_st-match.sh \&>/dev/null; echo $$?)
ifneq ($(BIO_MATCH),0)
$(error Incompatible OpenSSL version: struct bio_st mismatch!)
endif

libssl/openssl/libssl.a:
cd libssl && rm -rf openssl-openssl-*/ openssl-3*/ || true
cd libssl && tar -zxf openssl-*.tar.gz
Expand All @@ -93,6 +98,7 @@ libssl/openssl/libssl.a:

libssl: libssl/openssl/libssl.a


MIN_VERSION := 4.9.0
GCC_VERSION := $(shell gcc -dumpversion)
SORTED_VERSIONS := $(shell echo -e "$(GCC_VERSION)\n$(MIN_VERSION)" | sort -V)
Expand Down
7 changes: 7 additions & 0 deletions deps/libssl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ In ProxySQL 2.1.1 , libssl was upgraded to version 1.1.1j

In ProxySQL 2.4.0 , libssl was upgraded from version 1.1.1j to 3.0.2

In ProxySQL 2.4.8 , libssl was upgraded from version 3.0.2 to 3.0.8

In ProxySQL 2.5.x , libssl was upgraded from version 3.0.8 to 3.1.0


Do not upgrade without extensive testing.

See note about `struct bio_st` in MySQL_Data_Stream.cpp .

Run `verify-bio_st-match.sh` to confirm compatibility.
2 changes: 1 addition & 1 deletion deps/libssl/openssl
Binary file not shown.
6 changes: 3 additions & 3 deletions deps/libssl/verify-bio_st-match.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
pushd $(dirname $0) &>/dev/null
trap 'popd &>/dev/null' EXIT

echo "checking for './deps/libssl/openssl/crypto/bio/bio_local.h'"
echo "checking for 'deps/libssl/openssl/crypto/bio/bio_local.h'"
if [[ ! -e './openssl/crypto/bio/bio_local.h' ]]; then
echo "extracting 'openssl-*.tar.gz'"
tar -zxf openssl-*.tar.gz
fi

echo "extracting 'struct bio_st' from './deps/libssl/openssl/crypto/bio/bio_local.h'"
echo "extracting 'struct bio_st' from 'deps/libssl/openssl/crypto/bio/bio_local.h'"
DEPBIOST=$(cd ../../; cat ./deps/libssl/openssl/crypto/bio/bio_local.h | sed -n '/^struct bio_st {/,/}/p')

echo "extracting 'struct bio_st' from './lib/mysql_data_stream.cpp'"
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 ... "
Expand Down

0 comments on commit f577d13

Please sign in to comment.