tags:

views:

64

answers:

2

I am trying to install the Crypt::OpenPGP module via Perl CPAN with no luck. The errors I am receiving are:

Failed Test   Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/07-digest.t    1   256    15    1   6.67%  15
Failed 1/14 test scripts, 92.86% okay. 1/273 subtests failed, 99.63% okay.
make: *** [test_dynamic] Error 255
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force

I am running a fresh install of CentOS release 5.5 (Final), I installed Perl via 'yum install perl', then went into CPAN ('perl -MCPAN -eshell'), and worked through the list of modules required by the script I am trying to run. I got as far as Crypt::OpenPGP before hitting this error.

I am probably missing something hugely obvious, but can anyone point me in the right direction?

The full log of my install attempt:

cpan> install Crypt::OpenPGP
Running install for module Crypt::OpenPGP
Running make for B/BT/BTROTT/Crypt-OpenPGP-1.04.tar.gz
  Is already unwrapped into directory /root/.cpan/build/Crypt-OpenPGP-1.04

  CPAN.pm: Going to build B/BT/BTROTT/Crypt-OpenPGP-1.04.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Crypt::OpenPGP
cp lib/Crypt/OpenPGP/Words.pm blib/lib/Crypt/OpenPGP/Words.pm
cp lib/Crypt/OpenPGP/Digest.pm blib/lib/Crypt/OpenPGP/Digest.pm
cp lib/Crypt/OpenPGP/Key.pm blib/lib/Crypt/OpenPGP/Key.pm
cp lib/Crypt/OpenPGP/KeyRing.pm blib/lib/Crypt/OpenPGP/KeyRing.pm
cp lib/Crypt/OpenPGP/Cipher.pm blib/lib/Crypt/OpenPGP/Cipher.pm
cp lib/Crypt/OpenPGP/S2k.pm blib/lib/Crypt/OpenPGP/S2k.pm
cp lib/Crypt/OpenPGP/Armour.pm blib/lib/Crypt/OpenPGP/Armour.pm
cp lib/Crypt/OpenPGP/Certificate.pm blib/lib/Crypt/OpenPGP/Certificate.pm
cp lib/Crypt/OpenPGP/Compressed.pm blib/lib/Crypt/OpenPGP/Compressed.pm
cp lib/Crypt/OpenPGP/Message.pm blib/lib/Crypt/OpenPGP/Message.pm
cp lib/Crypt/OpenPGP/Util.pm blib/lib/Crypt/OpenPGP/Util.pm
cp lib/Crypt/OpenPGP/OnePassSig.pm blib/lib/Crypt/OpenPGP/OnePassSig.pm
cp lib/Crypt/OpenPGP/Signature/SubPacket.pm blib/lib/Crypt/OpenPGP/Signature/SubPacket.pm
cp lib/Crypt/OpenPGP/Key/Public.pm blib/lib/Crypt/OpenPGP/Key/Public.pm
cp lib/Crypt/OpenPGP.pm blib/lib/Crypt/OpenPGP.pm
cp lib/Crypt/OpenPGP/SKSessionKey.pm blib/lib/Crypt/OpenPGP/SKSessionKey.pm
cp lib/Crypt/OpenPGP/MDC.pm blib/lib/Crypt/OpenPGP/MDC.pm
cp lib/Crypt/OpenPGP/CFB.pm blib/lib/Crypt/OpenPGP/CFB.pm
cp lib/Crypt/OpenPGP/PacketFactory.pm blib/lib/Crypt/OpenPGP/PacketFactory.pm
cp lib/Crypt/OpenPGP/Key/Public/RSA.pm blib/lib/Crypt/OpenPGP/Key/Public/RSA.pm
cp lib/Crypt/OpenPGP/Signature.pm blib/lib/Crypt/OpenPGP/Signature.pm
cp lib/Crypt/OpenPGP/Key/Secret/DSA.pm blib/lib/Crypt/OpenPGP/Key/Secret/DSA.pm
cp lib/Crypt/OpenPGP/Marker.pm blib/lib/Crypt/OpenPGP/Marker.pm
cp lib/Crypt/OpenPGP/Key/Public/DSA.pm blib/lib/Crypt/OpenPGP/Key/Public/DSA.pm
cp lib/Crypt/OpenPGP/Buffer.pm blib/lib/Crypt/OpenPGP/Buffer.pm
cp lib/Crypt/OpenPGP/KeyBlock.pm blib/lib/Crypt/OpenPGP/KeyBlock.pm
cp lib/Crypt/OpenPGP/ErrorHandler.pm blib/lib/Crypt/OpenPGP/ErrorHandler.pm
cp lib/Crypt/OpenPGP/Key/Secret.pm blib/lib/Crypt/OpenPGP/Key/Secret.pm
cp lib/Crypt/OpenPGP/Key/Secret/RSA.pm blib/lib/Crypt/OpenPGP/Key/Secret/RSA.pm
cp lib/Crypt/OpenPGP/KeyServer.pm blib/lib/Crypt/OpenPGP/KeyServer.pm
cp lib/Crypt/OpenPGP/Config.pm blib/lib/Crypt/OpenPGP/Config.pm
cp lib/Crypt/OpenPGP/Key/Public/ElGamal.pm blib/lib/Crypt/OpenPGP/Key/Public/ElGamal.pm
cp lib/Crypt/OpenPGP/SessionKey.pm blib/lib/Crypt/OpenPGP/SessionKey.pm
cp lib/Crypt/OpenPGP/Key/Secret/ElGamal.pm blib/lib/Crypt/OpenPGP/Key/Secret/ElGamal.pm
cp lib/Crypt/OpenPGP/Constants.pm blib/lib/Crypt/OpenPGP/Constants.pm
cp lib/Crypt/OpenPGP/Trust.pm blib/lib/Crypt/OpenPGP/Trust.pm
cp lib/Crypt/OpenPGP/UserID.pm blib/lib/Crypt/OpenPGP/UserID.pm
cp lib/Crypt/OpenPGP/Plaintext.pm blib/lib/Crypt/OpenPGP/Plaintext.pm
cp lib/Crypt/OpenPGP/Ciphertext.pm blib/lib/Crypt/OpenPGP/Ciphertext.pm
Manifying blib/man3/Crypt::OpenPGP::Words.3pm
Manifying blib/man3/Crypt::OpenPGP::Digest.3pm
Manifying blib/man3/Crypt::OpenPGP::Buffer.3pm
Manifying blib/man3/Crypt::OpenPGP::Key.3pm
Manifying blib/man3/Crypt::OpenPGP::KeyRing.3pm
Manifying blib/man3/Crypt::OpenPGP::Cipher.3pm
Manifying blib/man3/Crypt::OpenPGP::KeyBlock.3pm
Manifying blib/man3/Crypt::OpenPGP::ErrorHandler.3pm
Manifying blib/man3/Crypt::OpenPGP::S2k.3pm
Manifying blib/man3/Crypt::OpenPGP::Certificate.3pm
Manifying blib/man3/Crypt::OpenPGP::Armour.3pm
Manifying blib/man3/Crypt::OpenPGP::KeyServer.3pm
Manifying blib/man3/Crypt::OpenPGP::Message.3pm
Manifying blib/man3/Crypt::OpenPGP::Compressed.3pm
Manifying blib/man3/Crypt::OpenPGP::OnePassSig.3pm
Manifying blib/man3/Crypt::OpenPGP::Util.3pm
Manifying blib/man3/Crypt::OpenPGP::SessionKey.3pm
Manifying blib/man3/Crypt::OpenPGP.3pm
Manifying blib/man3/Crypt::OpenPGP::SKSessionKey.3pm
Manifying blib/man3/Crypt::OpenPGP::Constants.3pm
Manifying blib/man3/Crypt::OpenPGP::MDC.3pm
Manifying blib/man3/Crypt::OpenPGP::PacketFactory.3pm
Manifying blib/man3/Crypt::OpenPGP::CFB.3pm
Manifying blib/man3/Crypt::OpenPGP::Trust.3pm
Manifying blib/man3/Crypt::OpenPGP::UserID.3pm
Manifying blib/man3/Crypt::OpenPGP::Signature.3pm
Manifying blib/man3/Crypt::OpenPGP::Marker.3pm
Manifying blib/man3/Crypt::OpenPGP::Plaintext.3pm
Manifying blib/man3/Crypt::OpenPGP::Ciphertext.3pm
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t
t/00-compile.....ok                                                          
t/01-util........ok                                                          
t/02-buffer......ok                                                          
t/03-3des........ok                                                          
t/04-armour......ok                                                          
t/05-packets.....ok                                                          
t/06-cipher......# CAST5
t/06-cipher......ok 1/56# Rijndael                                           
# Rijndael256
# DES3
# Rijndael192
# IDEA
# Blowfish
# Twofish
t/06-cipher......ok                                                          
t/07-digest......# MD5
t/07-digest......ok 1/15# SHA1                                               
# RIPEMD160

t/07-digest......NOK 15#   Failed test 'digest data matches'                 
#   at t/07-digest.t line 49.
#          got: '����b�1�"X��6 �'
#     expected: '��;�z&?���XLR߮�IL�'
# Looks like you failed 1 test of 15.
t/07-digest......dubious                                                     
    Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 15
    Failed 1/15 tests, 93.33% okay
t/08-compress....ok                                                          
t/09-config......# GnuPG config
t/09-config......ok 1/20# pgp2 config                                        
t/09-config......ok                                                          
t/10-keyring.....ok                                                          
t/11-encrypt.....ok                                                          
t/12-sign........ok 1/12# armoured sig                                       
t/12-sign........ok 2/12# detached sig                                       
# unarmoured sig
# clear-text sig
# sig generated using explicit Key
t/12-sign........ok                                                          
t/13-keygen......# RSA
t/13-keygen......ok 1/28# DSA                                                
t/13-keygen......ok                                                          
Failed Test   Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/07-digest.t    1   256    15    1   6.67%  15
Failed 1/14 test scripts, 92.86% okay. 1/273 subtests failed, 99.63% okay.
make: *** [test_dynamic] Error 255
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force

cpan> 

Output from installing Crypt::RIPEMD160:

cpan> force install Crypt::RIPEMD160
Running install for module Crypt::RIPEMD160
Running make for C/CH/CHGEUER/Crypt-RIPEMD160-0.04.tar.gz
Checksum for /root/.cpan/sources/authors/id/C/CH/CHGEUER/Crypt-RIPEMD160-0.04.tar.gz ok
Crypt-RIPEMD160-0.04/
Crypt-RIPEMD160-0.04/CHGEUER.asc
Crypt-RIPEMD160-0.04/Makefile.PL
Crypt-RIPEMD160-0.04/MANIFEST
Crypt-RIPEMD160-0.04/misc/
Crypt-RIPEMD160-0.04/misc/rfc2104.txt
Crypt-RIPEMD160-0.04/misc/rfc2286.txt
Crypt-RIPEMD160-0.04/misc/ripemd160_driver.pl
Crypt-RIPEMD160-0.04/misc/speedtest.pl
Crypt-RIPEMD160-0.04/README
Crypt-RIPEMD160-0.04/RIPEMD160/
Crypt-RIPEMD160-0.04/RIPEMD160/MAC.pm
Crypt-RIPEMD160-0.04/RIPEMD160.pm
Crypt-RIPEMD160-0.04/RIPEMD160.xs
Crypt-RIPEMD160-0.04/rmd160/
Crypt-RIPEMD160-0.04/rmd160/doc/
Crypt-RIPEMD160-0.04/rmd160/doc/README
Crypt-RIPEMD160-0.04/rmd160/doc/ripemd160.html
Crypt-RIPEMD160-0.04/rmd160/hash/
Crypt-RIPEMD160-0.04/rmd160/hash/hashtest.c
Crypt-RIPEMD160-0.04/rmd160/hash/rmd128.c
Crypt-RIPEMD160-0.04/rmd160/hash/rmd128.h
Crypt-RIPEMD160-0.04/rmd160/hash/rmd160.c
Crypt-RIPEMD160-0.04/rmd160/hash/rmd160.h
Crypt-RIPEMD160-0.04/rmd160/mac/
Crypt-RIPEMD160-0.04/rmd160/mac/mactest.c
Crypt-RIPEMD160-0.04/rmd160/mac/rmd128mc.c
Crypt-RIPEMD160-0.04/rmd160/mac/rmd128mc.h
Crypt-RIPEMD160-0.04/rmd160/mac/rmd160mc.c
Crypt-RIPEMD160-0.04/rmd160/mac/rmd160mc.h
Crypt-RIPEMD160-0.04/rmd160.c
Crypt-RIPEMD160-0.04/rmd160.h
Crypt-RIPEMD160-0.04/test.pl
Crypt-RIPEMD160-0.04/typemap
Crypt-RIPEMD160-0.04/wrap_160.c
Crypt-RIPEMD160-0.04/wrap_160.h
Removing previously used /root/.cpan/build/Crypt-RIPEMD160-0.04

  CPAN.pm: Going to build C/CH/CHGEUER/Crypt-RIPEMD160-0.04.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Crypt::RIPEMD160
cp RIPEMD160/MAC.pm blib/lib/Crypt/RIPEMD160/MAC.pm
cp RIPEMD160.pm blib/lib/Crypt/RIPEMD160.pm
AutoSplitting blib/lib/Crypt/RIPEMD160.pm (blib/lib/auto/Crypt/RIPEMD160)
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap  RIPEMD160.xs > RIPEMD160.xsc && mv RIPEMD160.xsc RIPEMD160.c
gcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"  -DPERL_BYTEORDER=12345678 RIPEMD160.c
RIPEMD160.xs: In function ‘XS_Crypt__RIPEMD160_add’:
RIPEMD160.xs:55: warning: unused variable ‘svdata’
RIPEMD160.xs: In function ‘XS_Crypt__RIPEMD160_digest’:
RIPEMD160.xs:96: warning: pointer targets in passing argument 2 of ‘Perl_newSVpv’ differ in signedness
RIPEMD160.c:147: warning: unused variable ‘RETVAL’
gcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"  -DPERL_BYTEORDER=12345678 rmd160.c
gcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"  -DPERL_BYTEORDER=12345678 wrap_160.c
wrap_160.c: In function ‘RIPEMD160_final’:
wrap_160.c:75: warning: implicit declaration of function ‘printf’
wrap_160.c:75: warning: incompatible implicit declaration of built-in function ‘printf’
wrap_160.c:75: warning: unknown conversion type character 0xa in format
Running Mkbootstrap for Crypt::RIPEMD160 ()
chmod 644 RIPEMD160.bs
rm -f blib/arch/auto/Crypt/RIPEMD160/RIPEMD160.so
gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic RIPEMD160.o rmd160.o wrap_160.o  -o blib/arch/auto/Crypt/RIPEMD160/RIPEMD160.so    \
            \

chmod 755 blib/arch/auto/Crypt/RIPEMD160/RIPEMD160.so
cp RIPEMD160.bs blib/arch/auto/Crypt/RIPEMD160/RIPEMD160.bs
chmod 644 blib/arch/auto/Crypt/RIPEMD160/RIPEMD160.bs
Manifying blib/man3/Crypt::RIPEMD160::MAC.3pm
Manifying blib/man3/Crypt::RIPEMD160.3pm
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..25
ok 1  (use Crypt::RIPEMD160;)
ok 2  (new)
not ok 3  (std-test-vectors)
not ok 4  (A...Za...z0...9)
e526f520264924744a76aa2a73e1325ac45083f0: not ok 5  (8 x "1234567890")
3254f6d3d21de8b33df8e39b11988618a745d969: not ok 6  (1e6 x "a")
ok 7  (Various flavours of file-handle to addfile)
ok 8  (Fully qualified with ' operator)
ok 9  (Fully qualified with :: operator)
ok 10 (Type glob)
ok 11 (Type glob reference (the prefered mechanism))
ok 12 (File-handle passed by name (really the same as 9))
ok 13 (Other ways of reading the data -- line at a time)
ok 14 (Input lines as a list to add())
ok 15 (Random chunks up to 128 bytes)
ok 16 (All the data at once)
ok 17 (Using static member function)
not ok 18 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
not ok 19 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
not ok 20 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
not ok 21 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
not ok 22 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
not ok 23 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
not ok 24 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
not ok 25 (Crypt::RIPEMD160::MAC std-test-vector from RFC2286)
  /usr/bin/make test -- OK
Running make install
Manifying blib/man3/Crypt::RIPEMD160::MAC.3pm
Manifying blib/man3/Crypt::RIPEMD160.3pm
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
  /usr/bin/make install  -- OK
+3  A: 

It's a bug in Crypt::RIPEMD160, which doesn't work properly on 64-bit systems, as detailed in RT#53323 and RT#19138. You can install the distroprefs file linked from RT#19138 and then use CPAN to reinstall Crypt::RIPEMD160, and Crypt::OpenPGP should install and work without problems.

hobbs
Ah ok, thanks. How do I install a distroprefs file? Sorry, I've never used CPAN before...
Valorin
Download it and put it into your `prefs_dir` (usually ~/.cpan/prefs, but you can make sure by writing `o conf prefs_dir` at the CPAN shell)
hobbs
Sorry to be really annoying, but I can't work out how to actually make this work. When I type "o conf prefs_dir" I get UNDEFINED, and I've tried "o conf prefs_dir /root/.cpan/prefs", but it doesn't appear to do anything. Also, how do I reinstall Crypt::RIPEMD160, I can't find a remove/reinstall option...
Valorin
distroprefs need a newer version of CPAN.pm than was in 5.8.8; you could upgrade it or see my answer
ysth
Count on RedHat to be 5 years out of date when it comes to Perl bits ;)
hobbs
+2  A: 

To fix Crypt::RIPEMD160 by doing what the distroprefs file someone else suggested would have done:

cpan
look Crypt::RIPEMD160
curl -sL http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/patches/Crypt-RIPEMD160-0.04-Andrew_Ruthven-01.patch.gz | zcat | patch -p0
perl Makefile.PL
make all test install
ysth
Thanks for that, although I've still got failing tests. Crypt::OpenPGP fails the same as above, and Crypt::RIPEMD160 has a couple of "not ok" tests. I'll post output above. Any other ideas?
Valorin
@Valorin: I think from your posted output that CPAN is blowing away the directory with the patched source and starting fresh, something that newer CPANs don't do (even when you want them too, grr). Try doing the look command, applying the patch, and (still in the look shell) doing `make all test`?
ysth
@Valorin: or it might be easier to update CPAN and use the distroprefs.
ysth
Bingo, the 'make all test' thing produces a full list of 'ok' results.
Valorin
@Valorin: I should have mentioned make install, too, but maybe you figured that out :)
ysth
I was about to try and guess it :) It all appears to be working now, with no problems in the tests. Thank you!
Valorin