need to add libc depends and dh_strip now we're not arch-all anymore
[pgp-tools.git] / keylookup / keylookup
index e069289f670f75d6dce5d04783b11cc786331ff3..a69f888ec8857a0eea50a2f0e9c3c14abd194b80 100755 (executable)
@@ -99,6 +99,7 @@ sub getHits($) {
 
        while (<KID>) {
                chomp;
+               if ( $_ eq "" ) { next; }
                my ($type, undef) = split /:/;
                if ($type eq 'pub') {
                        my ($type, $keyid, $algo, $bits, $created, undef, $revoked) = split /:/;
@@ -209,7 +210,8 @@ sub callDialog {
        
        my %unique;
        my @keys = grep { !$unique{$_}++ }
-               grep { /^[0-9A-Fa-f]{8}$/ }
+               # get the keyID; can be 8, 16 or 40 nibbles
+               grep { /^((([a-zA-Z0-9]{24})?[a-zA-Z0-9]{8})?[a-zA-Z0-9]{8})$/ }
                map { s/\s//g; $_ } <ERRFH>;
        wait;
 
@@ -295,7 +297,7 @@ sub importKeys {
        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]{24})?[a-zA-Z0-9]{8})?[a-zA-Z0-9]{8})$/;
                warn ("keyid '$keyid' has unexpected format - skipping\n"), next
                        unless defined $cleanid;
                push @args, $cleanid;