Make sure fingerprint is defined.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 28 May 2009 12:51:43 +0000 (06:51 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 28 May 2009 12:59:59 +0000 (06:59 -0600)
imp/lib/Crypt/Pgp.php

index 6cb1299..885b1c9 100644 (file)
@@ -338,18 +338,18 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp
      */
     public function verifySignature($text, $address, $signature = '')
     {
-        $fingerprint = null;
-
-        /* Get fingerprint of key. */
         if (!empty($signature)) {
             $packet_info = $this->pgpPacketInformation($signature);
             if (isset($packet_info['fingerprint'])) {
                 $fingerprint = $packet_info['fingerprint'];
             }
-        } else {
+        }
+
+        if (!isset($fingerprint)) {
             $fingerprint = $this->getSignersKeyID($text);
         }
 
+        /* Get fingerprint of key. */
         $public_key = $this->getPublicKey($address, array('fingerprint' => $fingerprint));
 
         if (empty($signature)) {