properly match fingerprints with leading 0 bytes (https://labs.riseup.net/code/issues...
[monkeysphere.git] / src / share / keytrans
index 516f2da8714948e8e0d06cdde25868b7cc852a09..c47ccdc792d6cdfd98cf6fdb591ee9dae13e3969 100755 (executable)
@@ -690,6 +690,8 @@ sub openpgp2ssh {
          my $foundfpr = fingerprint($pubkey, $timestamp);
 
          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);
 
          # is this a match?
          if ((!defined($fpr)) ||