Hello community,
here is the log from the commit of package perl-Mcrypt
checked in at Fri Jan 18 00:12:30 CET 2008.
--------
--- perl-Mcrypt/perl-Mcrypt.changes 2007-02-15 11:50:42.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-Mcrypt/perl-Mcrypt.changes 2007-12-13 16:28:11.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Dec 13 16:27:34 CET 2007 - anicka@suse.cz
+
+- update to 2.5.7.0
+ * update tests to pass.. test against libmcrypt 2.5.7
+
+-------------------------------------------------------------------
Old:
----
Mcrypt-2.4.8.3-3way+sk64+sk128.diff
Mcrypt-2.4.8.3-cast256.diff
Mcrypt-2.4.8.3.diff
Mcrypt-2.4.8.3.tar.bz2
Mcrypt-2.4.8.3-type.diff
New:
----
Mcrypt-2.5.7.0-cast256.diff
Mcrypt-2.5.7.0.diff
Mcrypt-2.5.7.0.tar.bz2
Mcrypt-2.5.7.0-type.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mcrypt.spec ++++++
--- /var/tmp/diff_new_pack.F15178/_old 2008-01-18 00:11:05.000000000 +0100
+++ /var/tmp/diff_new_pack.F15178/_new 2008-01-18 00:11:05.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package perl-Mcrypt (Version 2.4.8.3)
+# spec file for package perl-Mcrypt (Version 2.5.7.0)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -12,20 +12,18 @@
Name: perl-Mcrypt
BuildRequires: libmcrypt-devel
-Version: 2.4.8.3
+Version: 2.5.7.0
Release: 1
-Requires: libmcrypt
Requires: perl = %{perl_version}
-Autoreqprov: on
+AutoReqProv: on
Group: Development/Libraries/Perl
License: Artistic License
-URL: http://search.cpan.org/CPAN/authors/id/J/JE/JESUS/
+Url: http://search.cpan.org/CPAN/authors/id/J/JE/JESUS/
Summary: An Autoload-Capable Interface Module for libmcrypt
Source: Mcrypt-%{version}.tar.bz2
Patch0: Mcrypt-%{version}.diff
Patch1: Mcrypt-%{version}-type.diff
Patch2: Mcrypt-%{version}-cast256.diff
-Patch3: Mcrypt-%{version}-3way+sk64+sk128.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -47,16 +45,15 @@
%ifarch alpha s390 s390x ia64 x86_64 ppc64
%patch2
%endif
-# 3way+sk64+sk128 doesnt work anywhere with libmcrypt-2.5.5
-%patch3
%build
perl Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall"
make
+
+%check
make test
%install
-rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install_vendor
%perl_process_packlist
@@ -71,39 +68,42 @@
%{perl_vendorarch}/Mcrypt.pm
/var/adm/perl-modules/%{name}
-%changelog -n perl-Mcrypt
-* Thu Feb 15 2007 - anicka@suse.cz
+%changelog
+* Thu Dec 13 2007 anicka@suse.cz
+- update to 2.5.7.0
+ * update tests to pass.. test against libmcrypt 2.5.7
+* Thu Feb 15 2007 anicka@suse.cz
- update to 2.4.8.3
* fix AUTOLOAD recursion problem when Mcrypt.so dependencies
aren't met at runtime.
-* Wed Jan 25 2006 - mls@suse.de
+* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
-* Sun Jan 11 2004 - adrian@suse.de
+* Sun Jan 11 2004 adrian@suse.de
- build as user
-* Fri Aug 22 2003 - mjancar@suse.cz
+* Fri Aug 22 2003 mjancar@suse.cz
- require the perl version we build with
-* Tue Jul 15 2003 - mjancar@suse.cz
+* Tue Jul 15 2003 mjancar@suse.cz
- adapt to perl-5.8.1
- use %%perl_process_packlist
-* Thu May 22 2003 - mjancar@suse.cz
+* Thu May 22 2003 mjancar@suse.cz
- use $RPM_OPT_FLAGS
- disable 3way, sk64 and sk128
-* Tue May 20 2003 - mjancar@suse.cz
+* Tue May 20 2003 mjancar@suse.cz
- remove unpackaged files
-* Sat Dec 28 2002 - prehak@suse.cz
+* Sat Dec 28 2002 prehak@suse.cz
- removed 3way, safer_sk64 and safer_sk128 algorithms on i586 and x86_64
(unable to use them with libmcrypt-2.5.4)
- patched tests to report algorithms that can't be opened using libmcrypt
-* Wed Aug 28 2002 - prehak@suse.cz
+* Wed Aug 28 2002 prehak@suse.cz
- removed CAST_256 algorithm on ia64
-* Tue Jul 02 2002 - mls@suse.de
+* Tue Jul 02 2002 mls@suse.de
- remove race in .packlist generation
-* Thu Sep 06 2001 - rvasice@suse.cz
+* Thu Sep 06 2001 rvasice@suse.cz
- removed CAST_256 algorithm for arch axp, s390 (unsupported by
libmcrypt)
-* Wed Aug 22 2001 - rvasice@suse.cz
+* Wed Aug 22 2001 rvasice@suse.cz
- spec file cleanup
-* Mon May 21 2001 - pblaha@suse.cz
+* Mon May 21 2001 pblaha@suse.cz
- update on 2.4.8.2
-* Wed Jan 24 2001 - pblaha@suse.cz
+* Wed Jan 24 2001 pblaha@suse.cz
- create this package
++++++ Mcrypt-2.4.8.3-cast256.diff -> Mcrypt-2.5.7.0-cast256.diff ++++++
--- perl-Mcrypt/Mcrypt-2.4.8.3-cast256.diff 2007-02-15 11:55:38.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-Mcrypt/Mcrypt-2.5.7.0-cast256.diff 2007-12-13 16:23:54.000000000 +0100
@@ -12,7 +12,15 @@
char *name;
--- t/oop-block.t
+++ t/oop-block.t
-@@ -13,7 +13,6 @@
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl
+
+-use Test::More tests => 150;
++use Test::More tests => 140;
+ # 9 tests for each alg/mode
+
+ @algs = qw (BLOWFISH
+@@ -11,7 +11,6 @@
XTEA
RC2
TWOFISH
@@ -22,7 +30,15 @@
SERPENT
--- t/oop-noblock.t
+++ t/oop-noblock.t
-@@ -13,7 +13,6 @@
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl
+
+-use Test::More tests => 150;
++use Test::More tests => 140;
+ # 9 tests for each alg/mode
+
+ @algs = qw (BLOWFISH
+@@ -11,7 +11,6 @@
XTEA
RC2
TWOFISH
@@ -32,7 +48,15 @@
SERPENT
--- t/prp-block.t
+++ t/prp-block.t
-@@ -13,7 +13,6 @@
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl
+
+-use Test::More tests => 210;
++use Test::More tests => 196;
+
+ @algs = qw (BLOWFISH
+ DES
+@@ -10,7 +10,6 @@
XTEA
RC2
TWOFISH
@@ -42,7 +66,15 @@
SERPENT
--- t/prp-noblock.t
+++ t/prp-noblock.t
-@@ -13,7 +13,6 @@
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl
+
+-use Test::More tests => 210;
++use Test::More tests => 196;
+
+ @algs = qw (BLOWFISH
+ DES
+@@ -10,7 +10,6 @@
XTEA
RC2
TWOFISH
++++++ Mcrypt-2.4.8.3-3way+sk64+sk128.diff -> Mcrypt-2.5.7.0.diff ++++++
--- perl-Mcrypt/Mcrypt-2.4.8.3-3way+sk64+sk128.diff 2007-02-15 11:55:39.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-Mcrypt/Mcrypt-2.5.7.0.diff 2007-12-13 16:23:54.000000000 +0100
@@ -1,66 +1,33 @@
---- Mcrypt.xs
-+++ Mcrypt.xs
-@@ -44,6 +44,11 @@
- // list of algorithms not implemented
- #undef MCRYPT_CAST_256
-
-+// list of algorithms not implemented
-+#undef MCRYPT_3WAY
-+#undef SAFER_SK64
-+#undef SAFER_SK128
-+
- static SV *
- constant(name, arg)
- char *name;
---- t/oop-block.t
-+++ t/oop-block.t
-@@ -5,10 +5,7 @@
- @algs = qw (BLOWFISH
- DES
- 3DES
-- 3WAY
- GOST
-- SAFER_SK64
-- SAFER_SK128
- CAST_128
- XTEA
- RC2
---- t/oop-noblock.t
-+++ t/oop-noblock.t
-@@ -5,10 +5,7 @@
- @algs = qw (BLOWFISH
- DES
- 3DES
-- 3WAY
- GOST
-- SAFER_SK64
-- SAFER_SK128
- CAST_128
- XTEA
- RC2
+--- Mcrypt.pm
++++ Mcrypt.pm
+@@ -137,6 +137,10 @@
+ $arg{'mode_dir'} = '' unless defined($arg{'mode_dir'});
+ my $td = mcrypt_load( $arg{'algorithm'}, $arg{'algorithm_dir'},
+ $arg{'mode'}, $arg{'mode_dir'} );
++ if(!defined($td)) {
++ print STDERR "Couldn't load algorithm $arg{'algorithm'}/$arg{'mode'}\n";
++ return undef;
++ }
+ my $mcrypt = bless { TD => $td }, $class;
+ $mcrypt->{Verbose} = 1;
+ $mcrypt->{Verbose} = $arg{'verbose'} if(defined($arg{'verbose'}));
--- t/prp-block.t
+++ t/prp-block.t
-@@ -5,10 +5,7 @@
- @algs = qw (BLOWFISH
- DES
- 3DES
-- 3WAY
- GOST
-- SAFER_SK64
-- SAFER_SK128
- CAST_128
- XTEA
- RC2
+@@ -26,6 +26,7 @@
+ sub doit {
+ my($method, $alg, $mode, $infile, $outfile) = @_;
+ my($td) = Mcrypt::mcrypt_load( $alg, "", $mode, "");
++ print STDERR "Couldn't load algorithm $alg/$mode\n" unless defined($td);
+ ok($td, "Loaded $alg/$mode");
+ $keysize = Mcrypt::mcrypt_get_key_size($td);
+ $ivsize = Mcrypt::mcrypt_get_iv_size($td);
--- t/prp-noblock.t
+++ t/prp-noblock.t
-@@ -5,10 +5,7 @@
- @algs = qw (BLOWFISH
- DES
- 3DES
-- 3WAY
- GOST
-- SAFER_SK64
-- SAFER_SK128
- CAST_128
- XTEA
- RC2
+@@ -27,6 +27,7 @@
+ sub doit {
+ my($method, $alg, $mode, $infile, $outfile) = @_;
+ my($td) = Mcrypt::mcrypt_load( $alg, "", $mode, "");
++ print STDERR "Couldn't load algorithm $alg/$mode\n" unless defined($td);
+ ok($td, "Loaded $alg/$mode");
+ $keysize = Mcrypt::mcrypt_get_key_size($td);
+ $ivsize = Mcrypt::mcrypt_get_iv_size($td);
++++++ Mcrypt-2.4.8.3.tar.bz2 -> Mcrypt-2.5.7.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mcrypt-2.4.8.3/ChangeLog new/Mcrypt-2.5.7.0/ChangeLog
--- old/Mcrypt-2.4.8.3/ChangeLog 2007-02-04 01:30:28.000000000 +0100
+++ new/Mcrypt-2.5.7.0/ChangeLog 2007-10-12 20:51:39.000000000 +0200
@@ -2,3 +2,4 @@
2.4.8.2 -- fix accidental double mcrypt_end'ing which using strict.
2.4.8.3 -- fix AUTOLOAD recursion problem when Mcrypt.so dependencies
aren't met at runtime.
+2.5.7.0 -- update tests to pass.. test against libmcrypt 2.5.7
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mcrypt-2.4.8.3/Makefile.PL new/Mcrypt-2.5.7.0/Makefile.PL
--- old/Mcrypt-2.4.8.3/Makefile.PL 2007-02-04 01:26:28.000000000 +0100
+++ new/Mcrypt-2.5.7.0/Makefile.PL 2007-10-12 20:53:02.000000000 +0200
@@ -2,12 +2,12 @@
use ExtUtils::MakeMaker 5.16 ;
use Config ;
-$MCRYPT_LIBDIR = '' ;
-$MCRYPT_INCLUDE = '' ;
+$MCRYPT_LDFLAGS = $ENV{MCRYPT_LDFLAGS} ;
+$MCRYPT_CPPFLAGS = $ENV{MCRYPT_CPPFLAGS} ;
WriteMakefile(
NAME => 'Mcrypt',
VERSION_FROM => 'Mcrypt.pm',
- LIBS => [ "$MCRYPT_LIBDIR -lltdl -lmcrypt" ],
- INC => " $MCRYPT_INCLUDE" ,
+ LIBS => [ "$MCRYPT_LDFLAGS -lltdl -lmcrypt" ],
+ INC => " $MCRYPT_CPPFLAGS" ,
);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mcrypt-2.4.8.3/Mcrypt.pm new/Mcrypt-2.5.7.0/Mcrypt.pm
--- old/Mcrypt-2.4.8.3/Mcrypt.pm 2007-02-04 01:30:28.000000000 +0100
+++ new/Mcrypt-2.5.7.0/Mcrypt.pm 2007-10-12 20:51:39.000000000 +0200
@@ -1,7 +1,7 @@
# Filename: Mcrypt.pm
# Author: Theo Schlossnagle
# Created: 17th January 2001
-# Version: 2.4.8.3
+# Version: 2.5.7.0
#
# Copyright (c) 1999,2001,2007 Theo Schlossnagle. All rights reserved.
# This program is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
-$VERSION = "2.4.8.3" ;
+$VERSION = "2.5.7.0" ;
@ISA = qw(Exporter DynaLoader);
@@ -29,10 +29,7 @@
ALGORITHMS => [ qw(BLOWFISH
DES
3DES
- 3WAY
GOST
- SAFER_SK64
- SAFER_SK128
CAST_128
XTEA
RC2
@@ -71,10 +68,7 @@
BLOWFISH
DES
3DES
- 3WAY
GOST
- SAFER_SK64
- SAFER_SK128
CAST_128
XTEA
RC2
@@ -268,7 +262,7 @@
use Mcrypt qw(:ALGORITHMS);
-Exports the BLOWFISH DES 3DES 3WAY GOST SAFER_SK64 SAFER_SK128
+Exports the BLOWFISH DES 3DES GOST
CAST_128 XTEA RC2 TWOFISH CAST_256 SAFERPLUS LOKI97 SERPENT
RIJNDAEL_128 RIJNDAEL_192 RIJNDAEL_256 ENIGMA ARCFOUR WAKE libmcrypt
algorithms. See the mcrypt(3) man page for more details.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mcrypt-2.4.8.3/Mcrypt.xs new/Mcrypt-2.5.7.0/Mcrypt.xs
--- old/Mcrypt-2.4.8.3/Mcrypt.xs 2007-02-04 01:30:28.000000000 +0100
+++ new/Mcrypt-2.5.7.0/Mcrypt.xs 2007-10-12 20:51:39.000000000 +0200
@@ -1,7 +1,7 @@
/* Filename: Mcrypt.xs
* Author: Theo Schlossnagle
* Created: 17th January 2001
- * Version: 2.4.8.3
+ * Version: 2.5.7.0
*
* Copyright (c) 1999 Theo Schlossnagle. All rights reserved.
* This program is free software; you can redistribute it and/or
@@ -55,12 +55,6 @@
#else
goto not_there;
#endif
- if(strEQ(name, "3WAY"))
-#ifdef MCRYPT_3WAY
- return newSVpv(MCRYPT_3WAY, 0);
-#else
- goto not_there;
-#endif
break;
case 'A':
if(strEQ(name, "ARCFOUR"))
@@ -191,18 +185,6 @@
#else
goto not_there;
#endif
- if(strEQ(name, "SAFER_SK128"))
-#ifdef MCRYPT_SAFER_SK128
- return newSVpv(MCRYPT_SAFER_SK128, 0);
-#else
- goto not_there;
-#endif
- if(strEQ(name, "SAFER_SK64"))
-#ifdef MCRYPT_SAFER_SK64
- return newSVpv(MCRYPT_SAFER_SK64, 0);
-#else
- goto not_there;
-#endif
if(strEQ(name, "SERPENT"))
#ifdef MCRYPT_SERPENT
return newSVpv(MCRYPT_SERPENT, 0);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mcrypt-2.4.8.3/README new/Mcrypt-2.5.7.0/README
--- old/Mcrypt-2.4.8.3/README 2007-02-04 01:30:28.000000000 +0100
+++ new/Mcrypt-2.5.7.0/README 2007-10-12 20:51:39.000000000 +0200
@@ -1,4 +1,4 @@
-Mcrypt Version 2.4.8.3
+Mcrypt Version 2.5.7.0
========================
DESCRIPTION
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mcrypt-2.4.8.3/t/destruct.t new/Mcrypt-2.5.7.0/t/destruct.t
--- old/Mcrypt-2.4.8.3/t/destruct.t 2007-02-04 01:26:28.000000000 +0100
+++ new/Mcrypt-2.5.7.0/t/destruct.t 2007-10-12 20:51:39.000000000 +0200
@@ -1,15 +1,10 @@
#!/usr/bin/perl
# this test will actually core for version < 2.4.8.2 :-))
+use Test::More tests => 1;
use strict;
use Mcrypt qw(:ALGORITHMS :MODES :FUNCS);
-my $loaded = 1;
-my $totaltests = 1;
-BEGIN { $| = 1 }
-END {print "not ok 1\n" unless ($loaded > 0);}
-
-print "1..$totaltests\n";
my($input) = "0123456701234567";
my $td = Mcrypt->new( algorithm => Mcrypt::BLOWFISH,
@@ -20,4 +15,5 @@
$td->init($key, $iv);
$td->decrypt($input);
$td->end();
-print "ok $loaded\n"; $loaded++;
+
+ok(1, "survived");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mcrypt-2.4.8.3/t/oop-block.t new/Mcrypt-2.5.7.0/t/oop-block.t
--- old/Mcrypt-2.4.8.3/t/oop-block.t 2007-02-04 01:26:28.000000000 +0100
+++ new/Mcrypt-2.5.7.0/t/oop-block.t 2007-10-12 20:51:39.000000000 +0200
@@ -1,14 +1,12 @@
#!/usr/bin/perl
+use Test::More tests => 150;
# 9 tests for each alg/mode
@algs = qw (BLOWFISH
DES
3DES
- 3WAY
GOST
- SAFER_SK64
- SAFER_SK128
CAST_128
XTEA
RC2
@@ -24,49 +22,34 @@
@modes = qw (CBC
ECB);
-$totaltests = 9*scalar(@algs)*scalar(@modes);
-
-BEGIN { $| = 1 }
-END {print "not ok 1\n" unless ($loaded > 1);}
-
-print "1..$totaltests\n";
-
use Mcrypt qw(:ALGORITHMS :MODES :FUNCS);
-$loaded = 1;
sub doit {
my($method, $alg, $mode, $infile, $outfile) = @_;
my($td) = Mcrypt->new( algorithm => $alg,
mode => $mode,
verbose => 0 );
- (($loaded+=4) && return 0) unless($td);
- print "ok $loaded\n"; $loaded++;
+ ok($td, "Loaded $alg/$mode");
my($key) = "k" x $td->{KEY_SIZE};
my($iv) = "i" x $td->{IV_SIZE};
- $td->init($key, $iv) || (($loaded+=3) && return 0);
- print "ok $loaded\n"; $loaded++;
- open(IN, "<$infile" ) || (($loaded+=2) && return 0);
- open(OUT, ">$outfile") || (($loaded+=2) && return 0);
- if($method eq "encrypt") {
- while(sysread(IN, $_, $td->{BLOCK_SIZE})) {
-# print "In: ".length($_);
- $out = $td->encrypt($_);
-# print " Out: ".length($out)."\n";
- print OUT $out;
- }
- } else {
- while(sysread(IN, $_, $td->{BLOCK_SIZE})) {
-# print "In: ".length($_);
- $out = $td->decrypt($_);
-# print " Out: ".length($out)."\n";
- print OUT $out;
+ my $i = eval { $td->init($key, $iv) };
+ ok($i && !$@, "initialized");
+ open(IN, "<$infile" );
+ open(OUT, ">$outfile");
+ eval {
+ if($method eq "encrypt") {
+ while(sysread(IN, $_, $td->{BLOCK_SIZE})) {
+ $out = $td->encrypt($_);
+ print OUT $out;
+ }
+ } else {
+ while(sysread(IN, $_, $td->{BLOCK_SIZE})) {
+ $out = $td->decrypt($_);
+ print OUT $out;
+ }
}
- }
+ };
close(IN) && close(OUT);
- print "ok $loaded\n"; $loaded++;
- # we could cann $td->end(), but the destructor will take care of that
- print "ok $loaded\n"; $loaded++;
- return 1;
}
sub testam {
@@ -81,7 +64,7 @@
$file1 = <FILE>;
$/ = $oldis;
close(FILE);
- open(FILE, " 150;
# 9 tests for each alg/mode
@algs = qw (BLOWFISH
DES
3DES
- 3WAY
GOST
- SAFER_SK64
- SAFER_SK128
CAST_128
XTEA
RC2
@@ -24,49 +22,34 @@
@modes = qw (CFB
OFB);
-$totaltests = 9*scalar(@algs)*scalar(@modes);
-
-BEGIN { $| = 1 }
-END {print "not ok 1\n" unless ($loaded > 1);}
-
-print "1..$totaltests\n";
-
use Mcrypt qw(:ALGORITHMS :MODES :FUNCS);
-$loaded = 1;
sub doit {
my($method, $alg, $mode, $infile, $outfile) = @_;
my($td) = Mcrypt->new( algorithm => $alg,
mode => $mode,
verbose => 0 );
- (($loaded+=4) && return 0) unless($td);
- print "ok $loaded\n"; $loaded++;
+ ok($td, "Loaded $alg/$mode");
my($key) = "k" x $td->{KEY_SIZE};
my($iv) = "i" x $td->{IV_SIZE};
- $td->init($key, $iv) || (($loaded+=3) && return 0);
- print "ok $loaded\n"; $loaded++;
- open(IN, "<$infile" ) || (($loaded+=2) && return 0);
- open(OUT, ">$outfile") || (($loaded+=2) && return 0);
- if($method eq "encrypt") {
- while(<IN>) {
-# print "In: ".length($_);
- $out = $td->encrypt($_);
-# print " Out: ".length($out)."\n";
- print OUT $out;
- }
- } else {
- while(<IN>) {
-# print "In: ".length($_);
- $out = $td->decrypt($_);
-# print " Out: ".length($out)."\n";
- print OUT $out;
+ my $i = eval { $td->init($key, $iv) };
+ ok($i && !$@, "initialized");
+ open(IN, "<$infile" );
+ open(OUT, ">$outfile");
+ eval {
+ if($method eq "encrypt") {
+ while(sysread(IN, $_, $td->{BLOCK_SIZE})) {
+ $out = $td->encrypt($_);
+ print OUT $out;
+ }
+ } else {
+ while(sysread(IN, $_, $td->{BLOCK_SIZE})) {
+ $out = $td->decrypt($_);
+ print OUT $out;
+ }
}
- }
+ };
close(IN) && close(OUT);
- print "ok $loaded\n"; $loaded++;
- # we could cann $td->end(), but the destructor will take care of that
- print "ok $loaded\n"; $loaded++;
- return 1;
}
sub testam {
@@ -81,7 +64,7 @@
$file1 = <FILE>;
$/ = $oldis;
close(FILE);
- open(FILE, " 5;
# 9 tests for each alg/mode
@algs = qw (ARCFOUR);
@modes = qw (STREAM);
-$totaltests = 9*scalar(@algs)*scalar(@modes);
-
-BEGIN { $| = 1 }
-END {print "not ok 1\n" unless ($loaded > 1);}
-
-print "1..$totaltests\n";
-
use Mcrypt qw(:ALGORITHMS :MODES :FUNCS);
-$loaded = 1;
sub doit {
my($method, $alg, $mode, $infile, $outfile) = @_;
my($td) = Mcrypt->new( algorithm => $alg,
mode => $mode,
verbose => 0 );
- (($loaded+=4) && return 0) unless($td);
- print "ok $loaded\n"; $loaded++;
+ ok($td, "Loaded $alg/$mode");
my($key) = "k" x $td->{KEY_SIZE};
my($iv) = "i" x $td->{IV_SIZE};
- $td->init($key, $iv) || (($loaded+=3) && return 0);
- print "ok $loaded\n"; $loaded++;
- open(IN, "<$infile" ) || (($loaded+=2) && return 0);
- open(OUT, ">$outfile") || (($loaded+=2) && return 0);
- if($method eq "encrypt") {
- while(<IN>) {
-# print "In: ".length($_);
- $out = $td->encrypt($_);
-# print " Out: ".length($out)."\n";
- print OUT $out;
- }
- } else {
- while(<IN>) {
-# print "In: ".length($_);
- $out = $td->decrypt($_);
-# print " Out: ".length($out)."\n";
- print OUT $out;
+ my $i = eval { $td->init($key, $iv) };
+ ok($i && !$@, "initialized");
+ open(IN, "<$infile" );
+ open(OUT, ">$outfile");
+ eval {
+ if($method eq "encrypt") {
+ while(<IN>) {
+ $out = $td->encrypt($_);
+ print OUT $out;
+ }
+ } else {
+ while(<IN>) {
+ $out = $td->decrypt($_);
+ print OUT $out;
+ }
}
- }
+ };
close(IN) && close(OUT);
- print "ok $loaded\n"; $loaded++;
- # we could cann $td->end(), but the destructor will take care of that
- print "ok $loaded\n"; $loaded++;
- return 1;
}
sub testam {
@@ -63,7 +49,7 @@
$file1 = <FILE>;
$/ = $oldis;
close(FILE);
- open(FILE, " 210;
@algs = qw (BLOWFISH
DES
3DES
- 3WAY
GOST
- SAFER_SK64
- SAFER_SK128
CAST_128
XTEA
RC2
@@ -24,50 +21,35 @@
@modes = qw (CBC
ECB);
-$totaltests = 9*scalar(@algs)*scalar(@modes);
-
-BEGIN { $| = 1 }
-END {print "not ok 1\n" unless ($loaded > 1);}
-
-print "1..$totaltests\n";
-
use Mcrypt qw(:ALGORITHMS :MODES :FUNCS);
-$loaded = 1;
sub doit {
my($method, $alg, $mode, $infile, $outfile) = @_;
my($td) = Mcrypt::mcrypt_load( $alg, "", $mode, "");
- (($loaded+=4) && return 0) unless($td);
- print "ok $loaded\n"; $loaded++;
+ ok($td, "Loaded $alg/$mode");
$keysize = Mcrypt::mcrypt_get_key_size($td);
$ivsize = Mcrypt::mcrypt_get_iv_size($td);
$blocksize = Mcrypt::mcrypt_get_block_size($td);
my($key) = "k" x $keysize;
my($iv) = "i" x $ivsize;
- Mcrypt::mcrypt_init($td, $key, $iv) || (($loaded+=3) && return 0);
- print "ok $loaded\n"; $loaded++;
+ my $i = eval { Mcrypt::mcrypt_init($td, $key, $iv); };
+ ok($i && !$@, "initialized");
open(IN, "<$infile" ) || (($loaded+=2) && return 0);
open(OUT, ">$outfile") || (($loaded+=2) && return 0);
if($method eq "encrypt") {
while(sysread(IN, $_, $blocksize)) {
-# print "In: ".length($_);
$out = Mcrypt::mcrypt_encrypt($td, $_);
-# print " Out: ".length($out)."\n";
print OUT $out;
}
} else {
while(sysread(IN, $_, $blocksize)) {
-# print "In: ".length($_);
$out = Mcrypt::mcrypt_decrypt($td, $_);
-# print " Out: ".length($out)."\n";
print OUT $out;
}
}
close(IN) && close(OUT);
- print "ok $loaded\n"; $loaded++;
- Mcrypt::mcrypt_end($td);
- print "ok $loaded\n"; $loaded++;
- return 1;
+ eval { Mcrypt::mcrypt_end($td); };
+ ok(!$@, "destroyed");
}
sub testam {
@@ -82,7 +64,7 @@
$file1 = <FILE>;
$/ = $oldis;
close(FILE);
- open(FILE, " 210;
@algs = qw (BLOWFISH
DES
3DES
- 3WAY
GOST
- SAFER_SK64
- SAFER_SK128
CAST_128
XTEA
RC2
@@ -24,34 +21,24 @@
@modes = qw (CFB
OFB);
-$totaltests = 9*scalar(@algs)*scalar(@modes);
-
-BEGIN { $| = 1 }
-END {print "not ok 1\n" unless ($loaded > 1);}
-
-print "1..$totaltests\n";
-
use Mcrypt qw(:ALGORITHMS :MODES :FUNCS);
$loaded = 1;
sub doit {
my($method, $alg, $mode, $infile, $outfile) = @_;
my($td) = Mcrypt::mcrypt_load( $alg, "", $mode, "");
- (($loaded+=4) && return 0) unless($td);
- print "ok $loaded\n"; $loaded++;
+ ok($td, "Loaded $alg/$mode");
$keysize = Mcrypt::mcrypt_get_key_size($td);
$ivsize = Mcrypt::mcrypt_get_iv_size($td);
my($key) = "k" x $keysize;
my($iv) = "i" x $ivsize;
- Mcrypt::mcrypt_init($td, $key, $iv) || (($loaded+=3) && return 0);
- print "ok $loaded\n"; $loaded++;
+ my $i = eval { Mcrypt::mcrypt_init($td, $key, $iv); };
+ ok($i && !$@, "initialized");
open(IN, "<$infile" ) || (($loaded+=2) && return 0);
open(OUT, ">$outfile") || (($loaded+=2) && return 0);
if($method eq "encrypt") {
while(<IN>) {
-# print "In: ".length($_);
$out = Mcrypt::mcrypt_encrypt($td, $_);
-# print " Out: ".length($out)."\n";
print OUT $out;
}
} else {
@@ -60,10 +47,8 @@
}
}
close(IN) && close(OUT);
- print "ok $loaded\n"; $loaded++;
- Mcrypt::mcrypt_end($td);
- print "ok $loaded\n"; $loaded++;
- return 1;
+ eval { Mcrypt::mcrypt_end($td); };
+ ok(!$@, "destroyed");
}
sub testam {
@@ -78,7 +63,7 @@
$file1 = <FILE>;
$/ = $oldis;
close(FILE);
- open(FILE, " 7;
@algs = qw (ARCFOUR);
@modes = qw (STREAM);
-$totaltests = 9*scalar(@algs)*scalar(@modes);
-
-BEGIN { $| = 1 }
-END {print "not ok 1\n" unless ($loaded > 1);}
-
-print "1..$totaltests\n";
-
use Mcrypt qw(:ALGORITHMS :MODES :FUNCS);
-$loaded = 1;
sub doit {
my($method, $alg, $mode, $infile, $outfile) = @_;
my($td) = Mcrypt::mcrypt_load( $alg, "", $mode, "");
- (($loaded+=4) && return 0) unless($td);
- print "ok $loaded\n"; $loaded++;
+ ok($td, "loaded $alg/$mode");
$keysize = Mcrypt::mcrypt_get_key_size($td);
$ivsize = Mcrypt::mcrypt_get_iv_size($td);
my($key) = "k" x $keysize;
my($iv) = "i" x $ivsize;
- Mcrypt::mcrypt_init($td, $key, $iv) || (($loaded+=3) && return 0);
- print "ok $loaded\n"; $loaded++;
+ my $i = eval { Mcrypt::mcrypt_init($td, $key, $iv); };
+ ok($i && !$@, "initialized");
open(IN, "<$infile" ) || (($loaded+=2) && return 0);
open(OUT, ">$outfile") || (($loaded+=2) && return 0);
if($method eq "encrypt") {
while(<IN>) {
-# print "In: ".length($_);
$out = Mcrypt::mcrypt_encrypt($td, $_);
-# print " Out: ".length($out)."\n";
print OUT $out;
}
} else {
@@ -42,10 +31,8 @@
}
}
close(IN) && close(OUT);
- print "ok $loaded\n"; $loaded++;
- Mcrypt::mcrypt_end($td);
- print "ok $loaded\n"; $loaded++;
- return 1;
+ eval { Mcrypt::mcrypt_end($td); };
+ ok(!$@, "destroyed");
}
sub testam {
@@ -60,7 +47,7 @@
$file1 = <FILE>;
$/ = $oldis;
close(FILE);
- open(FILE, " Mcrypt-2.5.7.0-type.diff ++++++
--- perl-Mcrypt/Mcrypt-2.4.8.3-type.diff 2007-02-15 11:55:37.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-Mcrypt/Mcrypt-2.5.7.0-type.diff 2007-12-13 16:23:54.000000000 +0100
@@ -1,6 +1,6 @@
--- Mcrypt.xs
+++ Mcrypt.xs
-@@ -267,7 +267,7 @@
+@@ -249,7 +249,7 @@
CR_ERROR(mcrypt)
MCRYPT mcrypt
CODE:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org