Package: signing-party
Version: 0.4.13-1
Severity: important
Tags: patch

--- Please enter the report below this line. ---

When working with e.g. the keyserver onak 0.3.5-1 available in Debian,
keylookup fails importing any key because onak returns 40-nibble keyids
instead of the more usual 8-nibble keyids.
Note that other keyservers could return a 16-nibble keyid as it's also
a valid value for a keyid.

Here is a simple patch that solves the issue:
--- /usr/bin/keylookup  2007-06-17 11:42:21.000000000 +0200
+++ keylookup   2008-02-20 15:57:24.000000000 +0100
@@ -210,7 +210,7 @@

        my %unique;
        my @keys = grep { !$unique{$_}++ }
-               grep { /^[0-9A-Fa-f]{8}$/ }
+               grep { /^([0-9A-Fa-f]{8})+$/ }
                map { s/\s//g; $_ } <ERRFH>;
        wait;

@@ -296,7 +296,7 @@
        push @args,  '--recv-keys';
        for my $keyid (@$keyids) {
                # untaint keyids
-               my ($cleanid) = $keyid =~ /^([a-zA-Z0-9]{8})$/;
+               my ($cleanid) = $keyid =~ /^(([a-zA-Z0-9]{8})+)$/;
                warn ("keyid '$keyid' has unexpected format -
skipping\n"), next
                        unless defined $cleanid;
                push @args, $cleanid;

We could build a more complex regex such as
/^((([a-zA-Z0-9]{24})?[a-zA-Z0-9]{8})?[a-zA-Z0-9]{8})$/
to enforce 8, 16 & 40-nibble keyids but let's things remain readable ;-)

Phil

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.22-3-vserver-686

Debian Release: lenny/sid
  990 testing         ftp.kulnet.kuleuven.ac.be
  500 unstable        ftp.kulnet.kuleuven.ac.be

--- Package information. ---
Depends                      (Version) | Installed
======================================-+-===========
gnupg                                  | 1.4.6-2+b1
libgnupg-interface-perl                | 0.33-6
libtext-template-perl                  | 1.44-1.1
libmime-perl                           | 5.425-2
libmailtools-perl                      | 1.77-1




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to