Allow getting any valid min/max protocol

i8-stream-5.24 changed/i8-stream-5.24/perl-Net-SSLeay-1.85-6.module_el8.1.0+224+75158c84.inferit
Arkady L. Shane 10 months ago
parent 8806577009
commit 823d7e833c
Signed by: tigro
GPG Key ID: 1EC08A25C9DB2503

@ -0,0 +1,55 @@
From 15c213953def3d7a60a76bd55fbd97fe9289b5d3 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
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

@ -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 <tigro@msvsphere-os.ru> - 1.85-6.inferit
- Allow getting any valid min/max protocol
* Thu Apr 18 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 1.85-6
- Rebuilt for MSVSphere 8.9

Loading…
Cancel
Save