https://salsa.debian.org/php-team/php/-/commit/5203931e6f0174d0ad40ca4974e00c65754032db https://salsa.debian.org/php-team/php/-/commit/26860a7c5207dbe1aecf448fc9353970ec45bc02 --- php-7.4.33/ext/openssl/openssl.c +++ php-7.4.33/ext/openssl/openssl.c @@ -55,6 +55,10 @@ #include #include #include +#if PHP_OPENSSL_API_VERSION >= 0x30000 +#include +#include +#endif /* Common */ #include @@ -1517,7 +1521,9 @@ REGISTER_LONG_CONSTANT("PKCS7_NOSIGS", PKCS7_NOSIGS, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OPENSSL_PKCS1_PADDING", RSA_PKCS1_PADDING, CONST_CS|CONST_PERSISTENT); +#ifdef RSA_SSLV23_PADDING REGISTER_LONG_CONSTANT("OPENSSL_SSLV23_PADDING", RSA_SSLV23_PADDING, CONST_CS|CONST_PERSISTENT); +#endif REGISTER_LONG_CONSTANT("OPENSSL_NO_PADDING", RSA_NO_PADDING, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OPENSSL_PKCS1_OAEP_PADDING", RSA_PKCS1_OAEP_PADDING, CONST_CS|CONST_PERSISTENT); --- php-7.4.33/ext/openssl/tests/bug79589.phpt +++ php-7.4.33/ext/openssl/tests/bug79589.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #65538: TLS unexpected EOF failure +--EXTENSIONS-- +openssl +--SKIPIF-- + +--FILE-- + ['verify_peer'=> false]]) +); +echo gettype($release); + +?> +--EXPECT-- +string --- php-7.4.33/ext/openssl/xp_ssl.c +++ php-7.4.33/ext/openssl/xp_ssl.c @@ -1640,6 +1640,11 @@ ssl_ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF + /* Only for OpenSSL 3+ to keep OpenSSL 1.1.1 behavior */ + ssl_ctx_options |= SSL_OP_IGNORE_UNEXPECTED_EOF; +#endif + if (!GET_VER_OPT("disable_compression") || zend_is_true(val)) { ssl_ctx_options |= SSL_OP_NO_COMPRESSION; }