public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/perl-Net-DNS-SEC] epel10.3: Adapt tests to a crypto policy without SHA-1
Date: Mon, 19 Oct 2026 14:06:42 GMT	[thread overview]
Message-ID: <179241880207.1.4072583393302954127.rpms-perl-Net-DNS-SEC-99d217131197@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/perl-Net-DNS-SEC
Branch : epel10.3
Commit : 99d21713119737b0451ef220f38f29a741d02721
Author : Petr Písař <ppisar@redhat.com>
Date   : 2024-07-24T15:19:45+02:00
Stats  : +116/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-Net-DNS-SEC/c/99d21713119737b0451ef220f38f29a741d02721?branch=epel10.3

Log:
Adapt tests to a crypto policy without SHA-1

---
diff --git a/Net-DNS-SEC-1.24-Skip-SHA-1-signature-tests-if-OpenSSL-errors.patch b/Net-DNS-SEC-1.24-Skip-SHA-1-signature-tests-if-OpenSSL-errors.patch
new file mode 100644
index 0000000..0d2a4b6
--- /dev/null
+++ b/Net-DNS-SEC-1.24-Skip-SHA-1-signature-tests-if-OpenSSL-errors.patch
@@ -0,0 +1,109 @@
+From bc66b6dd776c378fddcba5a967e5c898f500f3f0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Wed, 24 Jul 2024 14:55:07 +0200
+Subject: [PATCH] Skip SHA-1 signature tests if OpenSSL errors
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fedora 41 DEFAULT crypto policy disabled SHA-1 in signatures
+<https://fedoraproject.org/wiki/Changes/OpenSSLDistrustSHA1SigVer>. As
+a result OpenSSL cannot make or verify signatures using SHA-1 digest
+algorithm and two tests fail like this:
+
+    libcrypto error (SEC.xs line 274) at /home/test/fedora/perl-Net-DNS-SEC/perl-Net-DNS-SEC-1.24-build/Net-DNS-SEC-1.24/blib/lib/Net/DNS/SEC/RSA.pm line 73.
+    # Looks like your test exited with 255 just after 5.
+    t/22-RSA-SHA1.t ....
+    Dubious, test returned 255 (wstat 65280, 0xff00)
+    Failed 3/8 subtests
+
+Unfortunteally OpenSSL does not provide a way how to detect the
+support/nonsupport. The only way is try it and check for errors.
+
+This patch does that.
+
+TODO: One could split computing the digest from computing/verifying
+the signature on Net-DNS-SEC level and check the policy before
+computing/verifying the signature.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=2299447
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ t/22-RSA-SHA1.t | 15 +++++++++------
+ t/31-DSA-SHA1.t | 22 +++++++++++++---------
+ 2 files changed, 22 insertions(+), 15 deletions(-)
+
+diff --git a/t/22-RSA-SHA1.t b/t/22-RSA-SHA1.t
+index 84c4582..63e9311 100755
+--- a/t/22-RSA-SHA1.t
++++ b/t/22-RSA-SHA1.t
+@@ -78,16 +78,19 @@ ok( $private, 'set up RSA private key' );
+ my $sigdata = Net::DNS::RR->new('. TXT arbitrary data')->txtdata;    # character set independent
+ my $corrupt = 'corrupted data';
+ 
+-my $signature = $class->sign( $sigdata, $private );
+-ok( $signature, 'signature created using private key' );
++my $signature = eval { $class->sign( $sigdata, $private ) };
++SKIP: {
++    skip 'RSA with SHA-1 disabled', 3 if $@;
++    ok( $signature, 'signature created using private key' );
+ 
+ 
+-my $verified = $class->verify( $sigdata, $key, $signature );
+-is( $verified, 1, 'signature verified using public key' );
++    my $verified = $class->verify( $sigdata, $key, $signature );
++    is( $verified, 1, 'signature verified using public key' );
+ 
+ 
+-my $verifiable = $class->verify( $corrupt, $key, $signature );
+-is( $verifiable, 0, 'signature not verifiable if data corrupted' );
++    my $verifiable = $class->verify( $corrupt, $key, $signature );
++    is( $verifiable, 0, 'signature not verifiable if data corrupted' );
++}
+ 
+ 
+ exit;
+diff --git a/t/31-DSA-SHA1.t b/t/31-DSA-SHA1.t
+index 90c3d6d..2902eb1 100755
+--- a/t/31-DSA-SHA1.t
++++ b/t/31-DSA-SHA1.t
+@@ -110,23 +110,27 @@ ok( $wrongprivate, 'set up non-DSA private key' );
+ my $sigdata = Net::DNS::RR->new('. TXT arbitrary data')->txtdata;    # character set independent
+ my $corrupt = 'corrupted data';
+ 
+-my $signature = $class->sign( $sigdata, $private );
+-ok( $signature, 'signature created using private key' );
++my $signature = eval { $class->sign( $sigdata, $private ) };
++SKIP: {
++    skip 'DSA with SHA-1 disabled', 6 if $@;
+ 
++    ok( $signature, 'signature created using private key' );
+ 
+-my $verified = $class->verify( $sigdata, $key, $signature );
+-is( $verified, 1, 'signature verified using public key' );
+ 
++    my $verified = $class->verify( $sigdata, $key, $signature );
++    is( $verified, 1, 'signature verified using public key' );
+ 
+-my $verifiable = $class->verify( $corrupt, $key, $signature );
+-is( $verifiable, 0, 'signature not verifiable if data corrupted' );
+ 
++    my $verifiable = $class->verify( $corrupt, $key, $signature );
++    is( $verifiable, 0, 'signature not verifiable if data corrupted' );
+ 
+-is( eval { $class->sign( $sigdata, $wrongprivate ) }, undef, 'signature not created using wrong private key' );
+ 
+-is( eval { $class->verify( $sigdata, $wrongkey, $signature ) }, undef, 'verify fails using wrong public key' );
++    is( eval { $class->sign( $sigdata, $wrongprivate ) }, undef, 'signature not created using wrong private key' );
+ 
+-is( eval { $class->verify( $sigdata, $key, undef ) }, undef, 'verify fails if signature undefined' );
++    is( eval { $class->verify( $sigdata, $wrongkey, $signature ) }, undef, 'verify fails using wrong public key' );
++
++    is( eval { $class->verify( $sigdata, $key, undef ) }, undef, 'verify fails if signature undefined' );
++}
+ 
+ exit;
+ 
+-- 
+2.45.2
+

diff --git a/perl-Net-DNS-SEC.spec b/perl-Net-DNS-SEC.spec
index e1ec492..47e0892 100644
--- a/perl-Net-DNS-SEC.spec
+++ b/perl-Net-DNS-SEC.spec
@@ -1,12 +1,15 @@
 Name:           perl-Net-DNS-SEC
 Version:        1.24
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        DNSSEC modules for Perl
 License:        HPND-MIT-disclaimer
 URL:            https://metacpan.org/release/Net-DNS-SEC
 Source0:        https://cpan.metacpan.org/authors/id/N/NL/NLNETLABS/Net-DNS-SEC-%{version}.tar.gz
 # Fix Net::DNS minimal version, proposed to the upstream, CPAN RT#153606
 Patch0:         Net-DNS-SEC-1.24-Correct-Net-DNS-minimal-version.patch
+# Adapt tests to a crypto policy without SHA-1, proposed to the upstream,
+# bug #2299447, CPAN RT#154526
+Patch1:         Net-DNS-SEC-1.24-Skip-SHA-1-signature-tests-if-OpenSSL-errors.patch
 # Build
 BuildRequires:  coreutils
 BuildRequires:  gcc
@@ -130,6 +133,9 @@ make test
 %{_libexecdir}/%{name}
 
 %changelog
+* Wed Jul 24 2024 Petr Pisar <ppisar@redhat.com> - 1.24-4
+- Adapt tests to a crypto policy without SHA-1 (bug #2299447)
+
 * Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.24-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
 

                 reply	other threads:[~2026-10-19 14:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179241880207.1.4072583393302954127.rpms-perl-Net-DNS-SEC-99d217131197@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox