Keep trying on failure

This commit is contained in:
Stephen Paul Weber 2013-01-26 11:10:45 -05:00
parent 567b18c1b2
commit 47a7f6e25c
1 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,10 @@ class OpenPGP_Crypt_AES_TripleDES {
$mkMDC = hash("sha1", $prefix . $data . "\xD3\x14", true);
if($mkMDC !== $mdc) return false;
return OpenPGP_Message::parse($data);
try {
$msg = OpenPGP_Message::parse($data);
} catch (Exception $ex) { $msg = NULL; }
if($msg) return $msg; /* Otherwise keep trying */
} else {
// TODO (resync)
}
@ -54,6 +57,8 @@ class OpenPGP_Crypt_AES_TripleDES {
}
}
}
return NULL; /* If we get here, we failed */
}
public static function getEncryptedData($m) {