https://salsa.debian.org/php-team/php/-/commit/bb0acf3dfdc47527a14264f0a5245e285c684b29 https://salsa.debian.org/php-team/php/-/commit/9438f1e3d49f2819324c09fd5edac6e6454ffd5e --- php-8.0.30/ext/openssl/openssl.c +++ php-8.0.30/ext/openssl/openssl.c @@ -56,6 +56,10 @@ #include #include #include +#if PHP_OPENSSL_API_VERSION >= 0x30000 +#include +#include +#endif /* Common */ #include @@ -1325,7 +1329,9 @@ REGISTER_LONG_CONSTANT("OPENSSL_CMS_NOSIGS", CMS_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-8.0.30/ext/openssl/tests/bug79589.phpt +++ php-8.0.30/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-8.0.30/ext/openssl/xp_ssl.c +++ php-8.0.30/ext/openssl/xp_ssl.c @@ -1637,6 +1637,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; }