diff --git a/CHANGELOG b/CHANGELOG index c79c32945..7938f56ba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -74,6 +74,7 @@ CHANGELOG Roundcube Webmail - Fix redundant keep-alive/refresh after session error on compose page (#5500) - 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 ffb3cac3c..8632fd43a 100644 --- a/plugins/enigma/lib/enigma_driver_gnupg.php +++ b/plugins/enigma/lib/enigma_driver_gnupg.php @@ -437,17 +437,20 @@ class enigma_driver_gnupg extends enigma_driver */ 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; }