From: thialme-guest Date: Mon, 27 Jul 2009 17:53:39 +0000 (+0000) Subject: Added patch to support RIPEMD160 checksum in gpgsigs (Closes: #533747). X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=c5e550b90a628f8fd9a4540cc3c41d653799eff2;p=pgp-tools.git Added patch to support RIPEMD160 checksum in gpgsigs (Closes: #533747). git-svn-id: svn://svn.debian.org/pgp-tools/trunk@437 b513b33f-fedd-0310-b452-c3deb5f4c849 --- diff --git a/debian/changelog b/debian/changelog index 9543381..c99362b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ signing-party (1.1.1-2) UNRELEASED; urgency=low - * + [ Franck Joncourt ] + * gpgsigs: + + Added patch from Roland Rosenfeld to support RIPEMD160 checksum. + (Closes: #533747). + + Updated man page to mention support for SHA256 and RIPEMD160 checksum. -- Thijs Kinkhorst Fri, 12 Jun 2009 08:59:50 +0200 diff --git a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs index e27b336..5ba8c12 100755 --- a/gpgsigs/gpgsigs +++ b/gpgsigs/gpgsigs @@ -242,28 +242,37 @@ close MD; open MD, "gpg --with-colons --print-md sha256 $keytxt|" or warn "can't get gpg sha256\n"; my $SHA256 = ; close MD; +open MD, "gpg --with-colons --print-md ripemd160 $keytxt|" or warn "can't get gpg ripemd160\n"; +my $RIPEMD160 = ; +close MD; my @MD5 = split /:/, $MD5; my @SHA1 = split /:/, $SHA1; my @SHA256 = split /:/, $SHA256; +my @RIPEMD160 = split /:/, $RIPEMD160; $MD5 = $MD5[2]; $SHA1 = $SHA1[2]; $SHA256 = $SHA256[2]; +$RIPEMD160 = $RIPEMD160[2]; $MD5 =~ s/(.{16})/$1 /; $SHA1 =~ s/(.{20})/$1 /; $SHA256 =~ s/(.{32})/$1 /; +$RIPEMD160 =~ s/(.{20})/$1 /; $MD5 =~ s/([0-9A-Z]{2})/$1 /ig; $SHA1 =~ s/([0-9A-Z]{4})/$1 /ig; $SHA256 =~ s/([0-9A-Z]{4})/$1 /ig; +$RIPEMD160 =~ s/([0-9A-Z]{4})/$1 /ig; chomp $MD5; chomp $SHA1; chomp $SHA256; +chomp $RIPEMD160; my $metatxt = quotemeta($keytxt); $MD5 =~ s/^$metatxt:\s*//; $SHA1 =~ s/^$metatxt:\s*//; $SHA256 =~ s/^$metatxt:\s*//; +$RIPEMD160 =~ s/^$metatxt:\s*//; # write out result @@ -315,6 +324,9 @@ while () { if (/^SHA256 Checksum:/ && defined $SHA256) { s/[_[:xdigit:]][_ [:xdigit:]]+_/$SHA256/; } + if (/^RIPEMD160 Checksum:/ && defined $RIPEMD160) { + s/[_[:xdigit:]][_ [:xdigit:]]+_/$RIPEMD160/; + } if ( m/^pub +(?:\d+)[DR]\/([0-9A-F]{8}) [0-9]{4}-[0-9]{2}-[0-9]{2} *(.*)/ ) { $key = $1; $uid = $2; @@ -404,8 +416,9 @@ B [I] II<[>B<,>IB<,>I<...>I<]>>I<]> F B was written to assist the user in signing keys during a keysigning party. It takes as input a file containing keys in C format and prepends every line with a tag indicating if the user has already signed -that uid. When the file contains C or C lines -and placeholders (C<__ __>), the checksum is inserted. +that uid. When the file contains C lines and placeholders +(C<__ __>), the checksum is inserted. ALGO can be set to the following algorithms: +MD5 SHA1 SHA256 or RIPEMD160. =head1 OPTIONS