summaryrefslogtreecommitdiff
path: root/src/share/keytrans
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2010-01-18 01:33:11 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2010-01-18 01:33:11 -0500
commit539d6e02d7aeb66e37b598cfbe78b689fdedb151 (patch)
tree9c9f37ea0ba61ebe85ce0f04e9729af61e51879b /src/share/keytrans
parent4665f8508b6bb2b20a424b7176768358d53c59df (diff)
fix stupid think-o that caused keytrans adduserid to misbehave if another key came in the input stream after the desired key was already found
Diffstat (limited to 'src/share/keytrans')
-rwxr-xr-xsrc/share/keytrans4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/share/keytrans b/src/share/keytrans
index 0f2ba41..255a271 100755
--- a/src/share/keytrans
+++ b/src/share/keytrans
@@ -722,6 +722,7 @@ sub findkey {
my $foundfprstr = Crypt::OpenSSL::Bignum->new_from_bin($foundfpr)->to_hex();
# left-pad with 0's to bring up to full 40-char (160-bit) fingerprint:
$foundfprstr = sprintf("%040s", $foundfprstr);
+ my $matched = 0;
# is this a match?
if ((!defined($data->{target}->{fpr})) ||
@@ -731,6 +732,7 @@ sub findkey {
}
$data->{key} = { 'rsa' => $pubkey,
'timestamp' => $key_timestamp };
+ $matched = 1;
}
if ($tag != $packet_types->{seckey} &&
@@ -740,7 +742,7 @@ sub findkey {
}
return;
}
- if (!defined($data->{key})) {
+ if (!$matched) {
# we don't think the public part of this key matches
if ($readbytes < $packetlen) {
read($instr, $dummy, $packetlen - $readbytes) or die "Could not skip past this packet.\n";