summaryrefslogtreecommitdiff
path: root/dev-perl/Crypt-CipherSaber
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-perl/Crypt-CipherSaber
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-perl/Crypt-CipherSaber')
-rw-r--r--dev-perl/Crypt-CipherSaber/Crypt-CipherSaber-1.10.0-r1.ebuild28
-rw-r--r--dev-perl/Crypt-CipherSaber/Manifest4
-rw-r--r--dev-perl/Crypt-CipherSaber/files/Crypt-CipherSaber-1.10.0-newline-iv.patch118
-rw-r--r--dev-perl/Crypt-CipherSaber/metadata.xml12
4 files changed, 162 insertions, 0 deletions
diff --git a/dev-perl/Crypt-CipherSaber/Crypt-CipherSaber-1.10.0-r1.ebuild b/dev-perl/Crypt-CipherSaber/Crypt-CipherSaber-1.10.0-r1.ebuild
new file mode 100644
index 000000000000..090eff20d1b8
--- /dev/null
+++ b/dev-perl/Crypt-CipherSaber/Crypt-CipherSaber-1.10.0-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DIST_AUTHOR=CHROMATIC
+DIST_VERSION=1.01
+inherit perl-module
+
+DESCRIPTION="Perl module implementing CipherSaber encryption"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND="
+ >=virtual/perl-Scalar-List-Utils-1.4.2
+"
+DEPEND="${RDEPEND}
+ dev-perl/Module-Build
+ test? (
+ >=virtual/perl-Test-Simple-0.600.0
+ >=dev-perl/Test-Warn-0.300.0
+ )
+"
+PATCHES=(
+ "${FILESDIR}/${P}-newline-iv.patch"
+)
diff --git a/dev-perl/Crypt-CipherSaber/Manifest b/dev-perl/Crypt-CipherSaber/Manifest
new file mode 100644
index 000000000000..7af7a573df03
--- /dev/null
+++ b/dev-perl/Crypt-CipherSaber/Manifest
@@ -0,0 +1,4 @@
+AUX Crypt-CipherSaber-1.10.0-newline-iv.patch 3370 BLAKE2B c2a97a2d879a26493b3a538e500f6a7cbeb6eebc1eed04ca45d9040a54dcf399529278190bcaa9f36360e5858f8a4f910d0e5d72d41234a920d1e88072a63411 SHA512 ca7d330f5e5aa7197ddb6092a737a381ba9e2d8ad7caa0c8ffcbcf570aafd402024e74baf05d32051f7239bd09c6e6d918ed8a28aeec772d8e273737cb8b626e
+DIST Crypt-CipherSaber-1.01.tar.gz 11527 BLAKE2B 620830f192fbc73812209f41fffda0f397140d2b4d6a293eb53dcbb5f8bcd27f3eb7e2881daf58bff2b976ce82dc56346931e621c3a946f41e18b2598b162363 SHA512 c523b3db0b011b560a3f1f45793cdcdfb2bda0ed196bed02f058d39a5f9505826113eb6f0f6baedcb3a0bcc5dc1218fb311361c74701b321ecf8df4080722201
+EBUILD Crypt-CipherSaber-1.10.0-r1.ebuild 510 BLAKE2B ecdc64e3659961e656868bfbc625949460b39b32c11fa0a5bde76c45ca19fd7713c66a16ad4be50bfeb5cf40944ef8d864723e050003ca2f76e07aa8e06216ca SHA512 b01172d5ab34c2dfac5f4bbd475e9146de02a592eee7f8bdabf88147cf3cd4c842169c9e7f50951c731c5a4c01ec6bcbcbc2a2007d410f48d7854107e1e91cc5
+MISC metadata.xml 406 BLAKE2B aba1171c96834acbf94f1c01069fc1eeff048ac95a65bcab4b2927ed16b22d2d1740486054dde47caa9965708f6a79bac6a5336afa509c42a8618ca17152ba48 SHA512 f4b5e09d2d58c4f2d664f55e1aa8e1c466ad5ac9df2cd20d5c83a29ad405de5b0f5c21f149218474e067a5b3e3f59828757e1d166e375f3a2d3fdc758ca4e8be
diff --git a/dev-perl/Crypt-CipherSaber/files/Crypt-CipherSaber-1.10.0-newline-iv.patch b/dev-perl/Crypt-CipherSaber/files/Crypt-CipherSaber-1.10.0-newline-iv.patch
new file mode 100644
index 000000000000..30e7a1a1ea4f
--- /dev/null
+++ b/dev-perl/Crypt-CipherSaber/files/Crypt-CipherSaber-1.10.0-newline-iv.patch
@@ -0,0 +1,118 @@
+From 966c275a76fa33b57f41cb66a908362b526629a8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Wed, 27 Aug 2014 15:38:54 +0200
+Subject: Fix reading IV with new-lines from a file
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Decrypting filehandle data by fh_crypt() could produce bad decrypted
+data if the initizalization vector read from the filehandle contained
+a new-line character. This caused random failures of 'autogenerating
+and autoreading IV should also round-trip' test in t/fh_encrypt.t.
+
+This patch fixes it by reading first 10 characters regardless of
+current line separator.
+
+Bug: https://rt.cpan.org/Ticket/Display.html?id=28370
+Bug: https://bugs.gentoo.org/632253
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ lib/Crypt/CipherSaber.pm | 14 +++++++++-----
+ t/fh_encrypt.t | 40 +++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 48 insertions(+), 6 deletions(-)
+
+diff --git a/lib/Crypt/CipherSaber.pm b/lib/Crypt/CipherSaber.pm
+index 7cb7cc0..2db153c 100644
+--- a/lib/Crypt/CipherSaber.pm
++++ b/lib/Crypt/CipherSaber.pm
+@@ -67,6 +67,15 @@ sub fh_crypt
+ $iv = $self->_gen_iv() if length($iv) == 1;
+ $self->_setup_key($iv);
+ print OUT $iv;
++ } else {
++ if ( 10 != $in->read($iv, 10) )
++ {
++ require Carp;
++ Carp::carp( 'Could not read IV from input filehandle' );
++ return;
++ }
++ ( $iv ) = unpack( "a10", $iv );
++ $self->_setup_key($iv);
+ }
+
+ my $state = $self->[1];
+@@ -75,11 +84,6 @@ sub fh_crypt
+
+ while (<$in>)
+ {
+- unless ($iv)
+- {
+- ( $iv, $_ ) = unpack( "a10a*", $_ );
+- $self->_setup_key($iv);
+- }
+ my $line;
+ ( $line, $state, @vars ) = _do_crypt( $state, $_, @vars );
+ print OUT $line;
+diff --git a/t/fh_encrypt.t b/t/fh_encrypt.t
+index 35a74fb..e595ff9 100644
+--- a/t/fh_encrypt.t
++++ b/t/fh_encrypt.t
+@@ -6,7 +6,7 @@ BEGIN
+ }
+
+ use strict;
+-use Test::More tests => 6;
++use Test::More tests => 7;
+ use_ok( 'Crypt::CipherSaber' );
+
+ # tests the fh_crypt() method
+@@ -114,6 +114,44 @@ while (<SOURCE>)
+
+ ok( ! $status, 'autogenerating and autoreading IV should also round-trip' );
+
++# IV retrieved from encrypted file can contain new-line characters. Check that
++# fh_encrypt can deal with it
++{
++ local $/ = "\012";
++
++ open( IN, 'smiles.png' ) or die "Cannot read smiles.png: $!";
++ open( OUT, '> smiles_2.cs1' ) or die "Cannot write to smiles_2.cs1: $!";
++ binmode( IN );
++ binmode( OUT );
++ $cs->fh_crypt( \*IN, \*OUT, $/ x 10 );
++ close IN;
++ close OUT;
++
++ open( IN, 'smiles_2.cs1' ) or die "Cannot read smiles_2.cs1: $!";
++ open( OUT, '> smiles_2.png' ) or die "Cannot write to smiles_2.png $!";
++ binmode( IN );
++ binmode( OUT );
++ $cs->fh_crypt( \*IN, \*OUT );
++ close IN;
++ close OUT;
++
++ open( SOURCE, 'smiles.png' ) or die "Cannot read smiles.png: $!";
++ open( DEST, 'smiles_2.png' ) or die "Cannot read smiles_2.png: $!";
++ binmode SOURCE;
++ binmode DEST;
++ $status = 0;
++ while (<SOURCE>)
++ {
++ unless ($_ eq <DEST>)
++ {
++ $status = 1;
++ last;
++ }
++ }
++ ok( ! $status, 'IV with new-lines in the encrypted file' );
++}
++
++
+ END
+ {
+ 1 while unlink qw( smiles_2.cs1 smiles_2.png outsmiles.cs1 outsmiles.png );
+--
+2.14.1
+
diff --git a/dev-perl/Crypt-CipherSaber/metadata.xml b/dev-perl/Crypt-CipherSaber/metadata.xml
new file mode 100644
index 000000000000..39268819710d
--- /dev/null
+++ b/dev-perl/Crypt-CipherSaber/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>perl@gentoo.org</email>
+ <name>Gentoo Perl Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="cpan">Crypt-CipherSaber</remote-id>
+ <remote-id type="cpan-module">Crypt::CipherSaber</remote-id>
+ </upstream>
+</pkgmetadata>