public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/perl-Crypt-OpenSSL-ECDSA] rawhide: Fix a spurious test failure
Date: Tue, 21 Jul 2026 12:13:03 GMT	[thread overview]
Message-ID: <178463598354.1.10432248901048366904.rpms-perl-Crypt-OpenSSL-ECDSA-1453a845d17d@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/perl-Crypt-OpenSSL-ECDSA
Branch : rawhide
Commit : 1453a845d17dbfd142fc3f9e894fbb22158909c1
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-07-21T14:12:31+02:00
Stats  : +60/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-Crypt-OpenSSL-ECDSA/c/1453a845d17dbfd142fc3f9e894fbb22158909c1?branch=rawhide

Log:
Fix a spurious test failure

---
diff --git a/Crypt-OpenSSL-ECDSA-0.10-tests-Fix-checking-for-an-OpenSSL-error-queue.patch b/Crypt-OpenSSL-ECDSA-0.10-tests-Fix-checking-for-an-OpenSSL-error-queue.patch
new file mode 100644
index 0000000..d218934
--- /dev/null
+++ b/Crypt-OpenSSL-ECDSA-0.10-tests-Fix-checking-for-an-OpenSSL-error-queue.patch
@@ -0,0 +1,56 @@
+From f68ea02e1d13d98ef75148e9c920f42d46899f43 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Tue, 21 Jul 2026 13:53:29 +0200
+Subject: [PATCH] tests: Fix checking for an OpenSSL error queue
+
+The t/Crypt-OpenSSL-ECDSA.t test started to fail on s390x (big-endian)
+architecture with OpenSSL 4 like this:
+
+    #   Failed test at t/Crypt-OpenSSL-ECDSA.t line 103.
+    # Looks like you failed 1 test of 25.
+    t/Crypt-OpenSSL-ECDSA.t ..
+    Dubious, test returned 1 (wstat 256, 0x100)
+    Failed 1/25 subtests
+
+I have no idea why this failure manifests only there, bug the cause is
+obivous -- reducing the test narrowed the issue to:
+
+    # Set them to some junk
+    $sig->set_r('1234');
+    # Should now fail verify
+    $ret = Crypt::OpenSSL::ECDSA::ECDSA_do_verify($digest, $sig, $key);
+    ok(!$ret);
+    # Testing signing and verifying with the _ex version
+    my $dummy = 0;
+    $sig = Crypt::OpenSSL::ECDSA::ECDSA_do_sign_ex($digest, \$dummy, \$dummy, $key);
+    # Should be no errors so far
+    my $error = Crypt::OpenSSL::ECDSA::ERR_get_error();
+    print "its $error\n";
+    ok($error == 0);
+
+The cause was that the test expected a non-zero ERR_get_error() return
+value in spite of previously failed ECDSA_do_verify().
+
+Since ERR_get_error() "returns the earliest error code from the thread's
+error queue and removes the entry", per OpenSSL manual, a correct fix
+is depleting the error queue after the last expectedly failed
+ECDSA_do_verify() call.
+---
+ t/Crypt-OpenSSL-ECDSA.t | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/t/Crypt-OpenSSL-ECDSA.t b/t/Crypt-OpenSSL-ECDSA.t
+index 3c02025..8837053 100644
+--- a/t/Crypt-OpenSSL-ECDSA.t
++++ b/t/Crypt-OpenSSL-ECDSA.t
+@@ -68,6 +68,7 @@ $sig->set_s('1234');
+ # Should now fail verify
+ $ret = Crypt::OpenSSL::ECDSA::ECDSA_do_verify($digest, $sig, $key);
+ ok(!$ret);
++while (Crypt::OpenSSL::ECDSA::ERR_get_error()) {}
+ 
+ # Put them back the way they were
+ $sig->set_r($r);
+-- 
+2.55.0
+

diff --git a/perl-Crypt-OpenSSL-ECDSA.spec b/perl-Crypt-OpenSSL-ECDSA.spec
index d3f67b3..8f6bb2d 100644
--- a/perl-Crypt-OpenSSL-ECDSA.spec
+++ b/perl-Crypt-OpenSSL-ECDSA.spec
@@ -5,6 +5,8 @@ Summary:        Perl extension for OpenSSL ECDSA (Elliptic Curve Digital Signatu
 License:        GPL-1.0-or-later OR Artistic-1.0-Perl
 URL:            https://metacpan.org/release/Crypt-OpenSSL-ECDSA
 Source0:        https://cpan.metacpan.org/authors/id/M/MI/MIKEM/Crypt-OpenSSL-ECDSA-%{version}.tar.gz
+# Fix a spurious test failure, bug #2503155, CPAN RT#180191, proposed upstream
+Patch0:         Crypt-OpenSSL-ECDSA-0.10-tests-Fix-checking-for-an-OpenSSL-error-queue.patch
 BuildRequires:  coreutils
 BuildRequires:  findutils
 BuildRequires:  gcc
@@ -52,7 +54,7 @@ Tests from %{name}. Execute them
 with "%{_libexecdir}/%{name}/test".
 
 %prep
-%setup -q -n Crypt-OpenSSL-ECDSA-%{version}
+%autosetup -p1 -n Crypt-OpenSSL-ECDSA-%{version}
 # Help generators to recognize Perl scripts
 for F in t/*.t; do
     perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F"
@@ -97,6 +99,7 @@ make test
 %changelog
 * Tue Jul 21 2026 Petr Pisar <ppisar@redhat.com> - 0.10-22
 - Modernize a spec file
+- Fix a spurious test failure (bug #2503155)
 
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.10-21
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild

                 reply	other threads:[~2026-07-21 12:13 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=178463598354.1.10432248901048366904.rpms-perl-Crypt-OpenSSL-ECDSA-1453a845d17d@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