|
|
@ -374,17 +374,15 @@ class enigma_engine
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// @TODO: Handle big bodies using (temp) files
|
|
|
|
// @TODO: Handle big bodies using (temp) files
|
|
|
|
// @TODO: caching of verification result
|
|
|
|
// @TODO: caching of verification result
|
|
|
|
|
|
|
|
|
|
|
|
$sig = $this->pgp_driver->verify($msg_body, $sig_body);
|
|
|
|
$sig = $this->pgp_driver->verify($msg_body, $sig_body);
|
|
|
|
|
|
|
|
|
|
|
|
if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND)
|
|
|
|
if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND)
|
|
|
|
rcube::raise_error(array(
|
|
|
|
rcube::raise_error(array(
|
|
|
|
'code' => 600, 'type' => 'php',
|
|
|
|
'code' => 600, 'type' => 'php',
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'message' => "Enigma plugin: " . $error->getMessage()
|
|
|
|
'message' => "Enigma plugin: " . $sig->getMessage()
|
|
|
|
), true, false);
|
|
|
|
), true, false);
|
|
|
|
|
|
|
|
|
|
|
|
//print_r($sig);
|
|
|
|
|
|
|
|
return $sig;
|
|
|
|
return $sig;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -399,11 +397,9 @@ class enigma_engine
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// @TODO: Handle big bodies using (temp) files
|
|
|
|
// @TODO: Handle big bodies using (temp) files
|
|
|
|
// @TODO: caching of verification result
|
|
|
|
// @TODO: caching of verification result
|
|
|
|
|
|
|
|
$key = ''; $pass = ''; // @TODO
|
|
|
|
$result = $this->pgp_driver->decrypt($msg_body, $key, $pass);
|
|
|
|
$result = $this->pgp_driver->decrypt($msg_body, $key, $pass);
|
|
|
|
|
|
|
|
|
|
|
|
//print_r($result);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($result instanceof enigma_error) {
|
|
|
|
if ($result instanceof enigma_error) {
|
|
|
|
$err_code = $result->getCode();
|
|
|
|
$err_code = $result->getCode();
|
|
|
|
if (!in_array($err_code, array(enigma_error::E_KEYNOTFOUND, enigma_error::E_BADPASS)))
|
|
|
|
if (!in_array($err_code, array(enigma_error::E_KEYNOTFOUND, enigma_error::E_BADPASS)))
|
|
|
|