diff --git a/CHANGELOG b/CHANGELOG index 4cff69da85d..370ce7cacb1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 ------------- diff --git a/plugins/enigma/lib/enigma_driver_gnupg.php b/plugins/enigma/lib/enigma_driver_gnupg.php index 07ca0032274..afa54ed2ea6 100644 --- a/plugins/enigma/lib/enigma_driver_gnupg.php +++ b/plugins/enigma/lib/enigma_driver_gnupg.php @@ -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; }