Skip to content

Commit

Permalink
Enigma: Fix PHP fatal error when decrypting a message with invalid si…
Browse files Browse the repository at this point in the history
…gnature (#5555)
  • Loading branch information
alecpl committed Dec 9, 2016
1 parent 79613c1 commit 69189ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CHANGELOG Roundcube Webmail

- Managesieve: Fix handling of scripts with nested rules (#5540)
- Fix variable substitution in ldap host for some use-cases, e.g. new_user_identity (#5544)
- Enigma: Fix PHP fatal error when decrypting a message with invalid signature (#5555)

RELEASE 1.2.3
-------------
Expand Down
13 changes: 8 additions & 5 deletions plugins/enigma/lib/enigma_driver_gnupg.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,20 @@ protected function get_error_from_exception($e)
*/
protected function parse_signature($sig)
{
$user = $sig->getUserId();

$data = new enigma_signature();

$data->id = $sig->getId();
$data->valid = $sig->isValid();
$data->fingerprint = $sig->getKeyFingerprint();
$data->created = $sig->getCreationDate();
$data->expires = $sig->getExpirationDate();
$data->name = $user->getName();
$data->comment = $user->getComment();
$data->email = $user->getEmail();

// In case of ERRSIG user may not be set
if ($user = $sig->getUserId()) {
$data->name = $user->getName();
$data->comment = $user->getComment();
$data->email = $user->getEmail();
}

return $data;
}
Expand Down

0 comments on commit 69189ed

Please sign in to comment.