aboutsummaryrefslogtreecommitdiffstats
path: root/testing/perl-convert-pem
diff options
context:
space:
mode:
authorTimothy Legge <timlegge@gmail.com>2019-04-24 19:46:33 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2019-04-26 04:43:17 +0000
commite20a0a2e525d54d159c3b31ae0162c2af3f71291 (patch)
treed53616178bb3bbf1567e355f8c8af3aed1d3ca26 /testing/perl-convert-pem
parent8d91ccdc2f76a73327c2c0c04f15d1b0fa032f9c (diff)
downloadaports-e20a0a2e525d54d159c3b31ae0162c2af3f71291.tar.bz2
aports-e20a0a2e525d54d159c3b31ae0162c2af3f71291.tar.xz
testing/perl-convert-pem: new aport
Diffstat (limited to 'testing/perl-convert-pem')
-rw-r--r--testing/perl-convert-pem/0001-Do-not-test-the-reason-for-decryption-failure-on-bad.patch69
-rw-r--r--testing/perl-convert-pem/APKBUILD44
-rw-r--r--testing/perl-convert-pem/remove-test-from-manifest.patch15
3 files changed, 128 insertions, 0 deletions
diff --git a/testing/perl-convert-pem/0001-Do-not-test-the-reason-for-decryption-failure-on-bad.patch b/testing/perl-convert-pem/0001-Do-not-test-the-reason-for-decryption-failure-on-bad.patch
new file mode 100644
index 0000000000..c062a7b7f5
--- /dev/null
+++ b/testing/perl-convert-pem/0001-Do-not-test-the-reason-for-decryption-failure-on-bad.patch
@@ -0,0 +1,69 @@
+From 2d6ec9bc13a0994ba5a5911c1c210082ed4da09f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Fri, 5 Sep 2014 11:04:30 +0200
+Subject: [PATCH] Do not test the reason for decryption failure on bad key
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Tests checking error message after using bad decryption key fails
+randomly.
+
+Some bad keys can fool the "Bad key/passphrase" heuristic in the
+Convert::PEM::CBC::decode() because it's a feature a stream cipher to
+spit out bad output on bad key. So the heuristic is just a kind
+service to point to the cause of the decoding failure (i.e. bad key).
+By probabilistic nature of the heuristic, we cannot rely on the
+/^Decryption failed/ error message.
+
+This patch removes these tests.
+
+CPAN RT#27574
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ t/01-readwrite.t | 3 +--
+ t/02-encode.t | 3 +--
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/t/01-readwrite.t b/t/01-readwrite.t
+index 42a4416..208eba1 100644
+--- a/t/01-readwrite.t
++++ b/t/01-readwrite.t
+@@ -1,5 +1,5 @@
+ use strict;
+-use Test::More tests => 16;
++use Test::More tests => 15;
+ use Test::Exception;
+
+ use Convert::PEM;
+@@ -29,7 +29,6 @@ lives_ok { $pem->write( Filename => $objfile, Content => $obj, Password => 'xx'
+ ok -e $objfile, 'output file exists';
+ lives_ok { $obj2 = $pem->read( Filename => $objfile ) } 'can read';
+ ok !defined $obj2, 'cannot read encrypted file';
+-like $pem->errstr, qr/^Decryption failed/, 'errstr matches decryption failed';
+ lives_ok { $obj2 = $pem->read( Filename => $objfile, Password => 'xx') } 'can read';
+ is $obj->{TestObject}{int}, $obj2->{TestObject}{int}, 'input matches output';
+ unlink $objfile;
+diff --git a/t/02-encode.t b/t/02-encode.t
+index 37aa987..9c6ab4c 100644
+--- a/t/02-encode.t
++++ b/t/02-encode.t
+@@ -1,5 +1,5 @@
+ use strict;
+-use Test::More tests => 9;
++use Test::More tests => 8;
+
+ use Convert::PEM;
+ use Math::BigInt;
+@@ -25,7 +25,6 @@ $blob = $pem->encode( Content => $obj, Password => 'xx' );
+ ok $blob, 'encode gave us something';
+ $obj2 = $pem->decode( Content => $blob );
+ ok !defined $obj2, 'decode fails on encrypted input';
+-like $pem->errstr, qr/^Decryption failed/, 'errstr matches decrypt failed';
+ $obj2 = $pem->decode( Content => $blob, Password => 'xx' );
+ is $obj->{TestObject}{int}, $obj2->{TestObject}{int}, 'input matches output';
+
+--
+1.9.3
+
diff --git a/testing/perl-convert-pem/APKBUILD b/testing/perl-convert-pem/APKBUILD
new file mode 100644
index 0000000000..5bf8b204a2
--- /dev/null
+++ b/testing/perl-convert-pem/APKBUILD
@@ -0,0 +1,44 @@
+# Automatically generated by apkbuild-cpan, template 2
+# Contributor: Timothy Legge <timlegge@gmail.com>
+# Maintainer: Timothy Legge <timlegge@gmail.com>
+pkgname=perl-convert-pem
+_pkgreal=Convert-PEM
+pkgver=0.08
+pkgrel=0
+pkgdesc="Read/write encrypted ASN.1 PEM files"
+url="https://metacpan.org/release/Convert-PEM/"
+arch="noarch"
+license="GPL-1.0-or-later Artistic-1.0-Perl"
+cpandepends="perl-convert-asn1 perl-crypt-des_ede3 perl-class-errorhandler"
+depends="$cpandepends"
+makedepends="perl-crypt-des_ede3 perl-test-simple perl-test-exception perl-dev"
+subpackages="$pkgname-doc"
+source="https://cpan.metacpan.org/authors/id/B/BT/BTROTT/Convert-PEM-$pkgver.tar.gz
+ remove-test-from-manifest.patch
+ 0001-Do-not-test-the-reason-for-decryption-failure-on-bad.patch"
+builddir="$srcdir/$_pkgreal-$pkgver"
+
+prepare() {
+ rm -fr "$builddir/inc/Test"
+ default_prepare
+}
+
+build() {
+ export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
+ PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor
+ make
+}
+
+check() {
+ export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
+ make test
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+ find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
+}
+
+sha512sums="d5e4342b40d01d534ec5f81ab009af185f795267c1bce792d26739ab07078a618093c720230ac2b6cf10c4b5ae1c282c94afa5b9db2eef6fd66e684d2080c273 Convert-PEM-0.08.tar.gz
+47260ed095310d96c92d51f750d2502bf43d938e9ea3417e86df2c6f4796f5e4a3aa5e272b14394298435e7dcd4b630db17de2ff156e98f55a804ce5e76cb0e7 remove-test-from-manifest.patch
+3cfbef7a5fe8c97aada17fc4acae2ef4a242ef89f1592afd0bba8d4095d2027377247eb9f760c2ed75b83f81028462c0ff4c6502a9af9f6e055da8e03d754645 0001-Do-not-test-the-reason-for-decryption-failure-on-bad.patch"
diff --git a/testing/perl-convert-pem/remove-test-from-manifest.patch b/testing/perl-convert-pem/remove-test-from-manifest.patch
new file mode 100644
index 0000000000..b9bf03caf8
--- /dev/null
+++ b/testing/perl-convert-pem/remove-test-from-manifest.patch
@@ -0,0 +1,15 @@
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -14,12 +14,6 @@
+ inc/Module/Install/WriteAll.pm
+ inc/Spiffy.pm
+ inc/Sub/Uplevel.pm
+-inc/Test/Base.pm
+-inc/Test/Base/Filter.pm
+-inc/Test/Builder.pm
+-inc/Test/Builder/Module.pm
+-inc/Test/Exception.pm
+-inc/Test/More.pm
+ lib/Convert/PEM.pm
+ lib/Convert/PEM/CBC.pm
+ Makefile.PL