From 726ad0bda960ff354b5464efc05fa6f112761b5b Mon Sep 17 00:00:00 2001 From: weasel Date: Fri, 15 Jul 2005 17:01:25 +0000 Subject: [PATCH] Use --with-colons for --print-md git-svn-id: svn://svn.debian.org/pgp-tools/trunk@129 b513b33f-fedd-0310-b452-c3deb5f4c849 --- gpgsigs/gpgsigs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs index ba139f7..7678c19 100755 --- a/gpgsigs/gpgsigs +++ b/gpgsigs/gpgsigs @@ -208,13 +208,23 @@ for my $k ( keys %{$sigs} ) { # read checksums -open MD, "gpg --print-md md5 $keytxt|" or warn "can't get gpg md5\n"; +open MD, "gpg --with-colons --print-md md5 $keytxt|" or warn "can't get gpg md5\n"; my $MD5 = ; close MD; -open MD, "gpg --print-md sha1 $keytxt|" or warn "can't get gpg sha1\n"; +open MD, "gpg --with-colons --print-md sha1 $keytxt|" or warn "can't get gpg sha1\n"; my $SHA1 = ; close MD; +my @MD5 = split /:/, $MD5; +my @SHA1 = split /:/, $SHA1; +$MD5 = $MD5[2]; +$SHA1 = $SHA1[2]; + +$MD5 =~ s/(.{16})/$1 /; +$SHA1 =~ s/(.{20})/$1 /; +$MD5 =~ s/([0-9A-Z]{2})/$1 /ig; +$SHA1 =~ s/([0-9A-Z]{4})/$1 /ig; + chomp $MD5; chomp $SHA1; my $metatxt = quotemeta($keytxt); -- 2.39.5