X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=keylookup%2Fkeylookup;h=a69f888ec8857a0eea50a2f0e9c3c14abd194b80;hb=6ecb7df37a68f2c98b4f03adc6393ce0f6b22727;hp=a8754d3f48fffcc87c3e24679d4c3c044cffd819;hpb=3b453c959839c5a728a4a503524b232da4c86b33;p=pgp-tools.git diff --git a/keylookup/keylookup b/keylookup/keylookup index a8754d3..a69f888 100755 --- a/keylookup/keylookup +++ b/keylookup/keylookup @@ -210,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; $_ } ; wait; @@ -296,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;