From 823d7e833cc48e1a5ae24007216c5d8a9b37e724 Mon Sep 17 00:00:00 2001 From: tigro Date: Fri, 26 Apr 2024 13:23:10 +0300 Subject: [PATCH] Allow getting any valid min/max protocol --- ...g-any-valid-min-max-protocol-version.patch | 55 +++++++++++++++++++ SPECS/perl-Net-SSLeay.spec | 7 ++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-Allow-getting-any-valid-min-max-protocol-version.patch diff --git a/SOURCES/0001-Allow-getting-any-valid-min-max-protocol-version.patch b/SOURCES/0001-Allow-getting-any-valid-min-max-protocol-version.patch new file mode 100644 index 0000000..bc06bd8 --- /dev/null +++ b/SOURCES/0001-Allow-getting-any-valid-min-max-protocol-version.patch @@ -0,0 +1,55 @@ +From 15c213953def3d7a60a76bd55fbd97fe9289b5d3 Mon Sep 17 00:00:00 2001 +From: tigro +Date: Fri, 26 Apr 2024 13:05:55 +0300 +Subject: [PATCH] Allow getting any valid min/max protocol version + +--- + t/local/09_ctx_new.t | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/t/local/09_ctx_new.t b/t/local/09_ctx_new.t +index c584856..c58cdde 100644 +--- a/t/local/09_ctx_new.t ++++ b/t/local/09_ctx_new.t +@@ -12,6 +12,19 @@ Net::SSLeay::load_error_strings(); + Net::SSLeay::add_ssl_algorithms(); + Net::SSLeay::OpenSSL_add_all_algorithms(); + ++sub is_known_proto_version { ++ return 1 if $_[0] == 0x0000; # Automatic version selection ++ return 1 if $_[0] == Net::SSLeay::SSL3_VERSION(); # OpenSSL 0.9.8+ ++ return 1 if $_[0] == Net::SSLeay::TLS1_VERSION(); # OpenSSL 0.9.8+ ++ return 1 if $_[0] == Net::SSLeay::TLS1_1_VERSION(); # OpenSSL 0.9.8+ ++ return 1 if $_[0] == Net::SSLeay::TLS1_2_VERSION(); # OpenSSL 0.9.8+ ++ if (eval { Net::SSLeay::TLS1_3_VERSION() }) { ++ return 1 if $_[0] == Net::SSLeay::TLS1_3_VERSION(); # OpenSSL 1.1.1+ ++ } ++ ++ return; ++} ++ + # Shortcuts from SSLeay.xs + my $ctx = Net::SSLeay::CTX_new(); + ok($ctx, 'CTX_new'); +@@ -129,14 +142,14 @@ if ($ctx_tls && exists &Net::SSLeay::CTX_get_min_proto_version) + } + my $ver; + $ver = Net::SSLeay::CTX_get_min_proto_version($ctx_tls); +- is($ver, $min_ver, 'TLS_method CTX has automatic minimum version'); ++ ok(is_known_proto_version($ver), 'TLS_method CTX has known minimum version'); + $ver = Net::SSLeay::CTX_get_max_proto_version($ctx_tls); +- is($ver, 0, 'TLS_method CTX has automatic maximum version'); ++ ok(is_known_proto_version($ver), 'TLS_method CTX has known maximum version'); + + $ver = Net::SSLeay::get_min_proto_version($ssl_tls); +- is($ver, $min_ver, 'SSL from TLS_method CTX has automatic minimum version'); ++ ok(is_known_proto_version($ver), 'SSL from TLS_method CTX has known minimum version'); + $ver = Net::SSLeay::get_max_proto_version($ssl_tls); +- is($ver, 0, 'SSL from TLS_method CTX has automatic maximum version'); ++ ok(is_known_proto_version($ver), 'SSL from TLS_method CTX has known maximum version'); + + # First see if our CTX has min and max settings enabled + $ver = Net::SSLeay::CTX_get_min_proto_version($ctx_tls_client); +-- +2.44.0 + diff --git a/SPECS/perl-Net-SSLeay.spec b/SPECS/perl-Net-SSLeay.spec index 5bde689..10cd882 100644 --- a/SPECS/perl-Net-SSLeay.spec +++ b/SPECS/perl-Net-SSLeay.spec @@ -5,7 +5,7 @@ Name: perl-Net-SSLeay Version: 1.85 -Release: 6%{?dist} +Release: 6%{?dist}.inferit Summary: Perl extension for using OpenSSL License: Artistic 2.0 URL: http://search.cpan.org/dist/Net-SSLeay/ @@ -25,6 +25,8 @@ Patch4: Net-SSLeay-1.85-Avoid-SIGPIPE-in-t-local-36_verify.t.patch Patch5: Net-SSLeay-1.85-Move-SSL_ERROR_WANT_READ-SSL_ERROR_WANT_WRITE-retry-.patch # Revert retry in Net::SSLeay::write_partial(), bug #1610376, CPAN RT#125218 Patch6: Net-SSLeay-1.85-Move-SSL_ERROR_WANT_READ-SSL_ERROR_WANT_WRITE-retry-from_write_partial.patch +# Allow getting any valid min/max protocol +Patch7: 0001-Allow-getting-any-valid-min-max-protocol-version.patch # =========== Module Build =========================== BuildRequires: coreutils BuildRequires: findutils @@ -126,6 +128,9 @@ make test %{_mandir}/man3/Net::SSLeay::Handle.3* %changelog +* Fri Apr 26 2024 Arkady L. Shane - 1.85-6.inferit +- Allow getting any valid min/max protocol + * Thu Apr 18 2024 MSVSphere Packaging Team - 1.85-6 - Rebuilt for MSVSphere 8.9