~ubuntu-branches/ubuntu/intrepid/signing-party/intrepid

« back to all changes in this revision

Viewing changes to keylookup/keylookup

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2008-05-20 12:23:52 UTC
  • mfrom: (1.1.12 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080520122352-ifxepk04h8ktfr5p
Tags: 1.0-2
* gpg-mailkeys: Fix parameter escaping of printf, thanks
  Olivier Tetard (Closes: #478151).
* springgraph: clarify help text (Closes: 474351).
* Switch dependency libmime-perl to libmime-tools-perl (renamed).
* Put springgraph and sig2dot in section graphics.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Copyright (c) 2000, 2002 Christian Kurz <shorty@debian.org>,
4
4
# Copyright (c) 2000, 2002, 2005 Peter Palfrader <peter@palfrader.org>
5
5
#
6
 
# $Id: keylookup 264 2006-02-28 17:42:48Z kink-guest $
 
6
# $Id: keylookup 362 2008-02-27 10:24:38Z thijs $
7
7
#
8
8
#   This program is free software; you can redistribute it and/or modify
9
9
#   it under the terms of the GNU General Public License as published by
33
33
use IPC::Open3;
34
34
use Getopt::Long;
35
35
 
36
 
my $version = '3.0 ($Id: keylookup 264 2006-02-28 17:42:48Z kink-guest $)';
 
36
my $version = '3.0 ($Id: keylookup 362 2008-02-27 10:24:38Z thijs $)';
37
37
 
38
38
# Strings to use in the dialog|whiptail frontend
39
39
my $TITLE = 'Import Keys';
40
 
my $BACKTITLE = 'KeyLookup $Revision: 264 $';
 
40
my $BACKTITLE = 'KeyLookup $Revision: 362 $';
41
41
my $INSTRUCTION = 'Select keys to import:';
42
42
#
43
43
my @TPUTCOL=('tput', 'cols');
99
99
 
100
100
        while (<KID>) {
101
101
                chomp;
 
102
                if ( $_ eq "" ) { next; }
102
103
                my ($type, undef) = split /:/;
103
104
                if ($type eq 'pub') {
104
105
                        my ($type, $keyid, $algo, $bits, $created, undef, $revoked) = split /:/;
209
210
        
210
211
        my %unique;
211
212
        my @keys = grep { !$unique{$_}++ }
212
 
                grep { /^[0-9A-Fa-f]{8}$/ }
 
213
                # get the keyID; can be 8, 16 or 40 nibbles
 
214
                grep { /^((([a-zA-Z0-9]{24})?[a-zA-Z0-9]{8})?[a-zA-Z0-9]{8})$/ }
213
215
                map { s/\s//g; $_ } <ERRFH>;
214
216
        wait;
215
217
 
295
297
        push @args,  '--recv-keys';
296
298
        for my $keyid (@$keyids) {
297
299
                # untaint keyids
298
 
                my ($cleanid) = $keyid =~ /^([a-zA-Z0-9]{8})$/;
 
300
                my ($cleanid) = $keyid =~ /^((([a-zA-Z0-9]{24})?[a-zA-Z0-9]{8})?[a-zA-Z0-9]{8})$/;
299
301
                warn ("keyid '$keyid' has unexpected format - skipping\n"), next
300
302
                        unless defined $cleanid;
301
303
                push @args, $cleanid;