Skip Menu |

This queue is for tickets about the Crypt-OpenSSL-EC CPAN distribution.

Report information
The Basics
Id: 104000
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Crypt-OpenSSL-EC

People
Owner: MIKEM [...] cpan.org
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.01
Fixed in: (no value)



Subject: Skip prime-field tests if OpenSSL does not suppport EC2M
Some distributors disable EC2M feature in OpenSSL. Then many of the t/prime-field.t tests fail. I don't understand how OpenSSL decides which fields are unsupported, but I believe that this Perl module is useful even with such constrained OpenSSL libraries. Am I right? Attached patch checks whether OpenSSL has disabled EC2M and skips all t/prime-field.t tests in that case.
Subject: 0001-Skip-prime-field-tests-if-OpenSSL-does-not-suppport-.patch
From 89a1e4be8bccf793478fc07aac7003121de73dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Mon, 27 Apr 2015 16:01:52 +0200 Subject: [PATCH] Skip prime-field tests if OpenSSL does not suppport EC2M MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prime-field.t exhibits many function calls with arguments that are not support by OpenSSL if it was built without EC2M support. It's easier to skip all the tests instead of skipping almost all of them. This patch does that if <openssl/opensslconf.h> defines OPENSSL_NO_EC2M. Signed-off-by: Petr Písař <ppisar@redhat.com> diff --git a/Makefile.PL b/Makefile.PL index edacc74..4290278 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,6 +10,9 @@ WriteMakefile( NAME => 'Crypt::OpenSSL::EC', VERSION_FROM => 'lib/Crypt/OpenSSL/EC.pm', PREREQ_PM => { 'Crypt::OpenSSL::Bignum' => 0.04, + 'ExtUtils::CBuilder' => 0, + 'File::Spec' => 0, + 'File::Temp' => 0, }, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/Crypt/OpenSSL/EC.pm', # retrieve abstract from module diff --git a/t/prime-field.t b/t/prime-field.t index 0a9a2d9..033c0bf 100644 --- a/t/prime-field.t +++ b/t/prime-field.t @@ -7,7 +7,34 @@ use Crypt::OpenSSL::Bignum::CTX; BEGIN { use_ok('Crypt::OpenSSL::EC') }; -&prime_field_tests(); + +# Check OpenSSL supports EC2M +my $no_ec2m = 1; +{ + use File::Spec; + use File::Temp; + use ExtUtils::CBuilder; + my $dir = File::Temp::tempdir(CLEANUP => 1); + my $file = File::Spec->catfile($dir, 'test.c'); + open my $fh, '>', $file or die; + print $fh <<TEST; +#include <openssl/opensslconf.h> +#ifdef OPENSSL_NO_EC2M +#error EC2M disabled +#endif +TEST + close $fh or die; + my $object; + eval { $object = ExtUtils::CBuilder->new->compile(source => $file) }; + if (defined $object) { + $no_ec2m = 0; + } +} + +SKIP: { + skip('OpenSSL does not support EC2M', 262) if $no_ec2m; + &prime_field_tests(); +}; sub prime_field_tests() { -- 2.1.0
On 2015-04-27 10:23:46, ppisar wrote: Show quoted text
> Some distributors disable EC2M feature in OpenSSL. Then many of the > t/prime-field.t tests fail. > > I don't understand how OpenSSL decides which fields are unsupported, > but I believe that this Perl module is useful even with such > constrained OpenSSL libraries. Am I right? > > Attached patch checks whether OpenSSL has disabled EC2M and skips all > t/prime-field.t tests in that case.
This seems still to be a problem with 1.2. At least the t/prime-field.t test fails on my CentOS7 smoker.
Should be fixed in version 1.3
Subject: Re: [rt.cpan.org #104000] Skip prime-field tests if OpenSSL does not suppport EC2M
Date: Thu, 01 Jun 2017 18:35:13 +1000
To: bug-Crypt-OpenSSL-EC [...] rt.cpan.org
From: Mike McCauley <mikem [...] airspayce.com>
Hello, Hmmm, dont know what happened to this. Sorry. A new and better fix has been added in new version 1.3 now uploaded to CPAN. Cheers. On Thursday, 1 June 2017 3:24:47 AM AEST Slaven_Rezic via RT wrote: Show quoted text
> Queue: Crypt-OpenSSL-EC > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104000 > > > On 2015-04-27 10:23:46, ppisar wrote:
> > Some distributors disable EC2M feature in OpenSSL. Then many of the > > t/prime-field.t tests fail. > > > > I don't understand how OpenSSL decides which fields are unsupported, > > but I believe that this Perl module is useful even with such > > constrained OpenSSL libraries. Am I right? > > > > Attached patch checks whether OpenSSL has disabled EC2M and skips all > > t/prime-field.t tests in that case.
> > This seems still to be a problem with 1.2. At least the t/prime-field.t test > fails on my CentOS7 smoker.
-- Mike McCauley VK4AMM mikem@airspayce.com Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.airspayce.com Phone +61 7 5598-7474
From: ppisar [...] redhat.com
Dne Čt 01.čen.2017 04:57:48, mikem@airspayce.com napsal(a): Show quoted text
> A new and better fix has been added in new version 1.3 now uploaded to > CPAN. >
I think 1.3 has some remnants from the previous fix. Specifically, it declares dependency unused modules: 'ExtUtils::CBuilder' => 0, 'File::Spec' => 0, 'File::Temp' => 0,
Subject: Re: [rt.cpan.org #104000] Skip prime-field tests if OpenSSL does not suppport EC2M
Date: Fri, 02 Jun 2017 11:29:08 +1000
To: bug-Crypt-OpenSSL-EC [...] rt.cpan.org
From: Mike McCauley <mikem [...] airspayce.com>
Hi, thanks, new version 1.31 should fix this. Cheers. On Thursday, 1 June 2017 9:30:50 AM AEST you wrote: Show quoted text
> Queue: Crypt-OpenSSL-EC > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104000 > > > Dne Čt 01.čen.2017 04:57:48, mikem@airspayce.com napsal(a):
> > A new and better fix has been added in new version 1.3 now uploaded to > > CPAN.
> > I think 1.3 has some remnants from the previous fix. Specifically, it > declares dependency unused modules: > > 'ExtUtils::CBuilder' => 0, > 'File::Spec' => 0, > 'File::Temp' => 0,
-- Mike McCauley VK4AMM mikem@airspayce.com Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.airspayce.com Phone +61 7 5598-7474