Enigma: Fix error message when trying to encrypt with a revoked private key (#6607)

pull/6841/head
Aleksander Machniak 6 years ago
parent 0c828a254e
commit f8afd18713

@ -3,6 +3,7 @@ CHANGELOG Roundcube Webmail
- Managesieve: Fix so "Create filter" option does not show up when Filters menu is disabled (#6723) - Managesieve: Fix so "Create filter" option does not show up when Filters menu is disabled (#6723)
- Enigma: Fix bug where revoked users/keys were not greyed out in key info - Enigma: Fix bug where revoked users/keys were not greyed out in key info
- Enigma: Fix error message when trying to encrypt with a revoked key (#6607)
- Fix bug where bmp images couldn't be displayed on some systems (#6728) - Fix bug where bmp images couldn't be displayed on some systems (#6728)
- Fix bug in parsing vCard data using PHP 7.3 due to an invalid regexp (#6744) - Fix bug in parsing vCard data using PHP 7.3 due to an invalid regexp (#6744)

@ -266,10 +266,6 @@ class enigma_engine
$recipients = array_merge($recipients, $mime->getRecipients()); $recipients = array_merge($recipients, $mime->getRecipients());
} }
if (empty($recipients)) {
return new enigma_error(enigma_error::KEYNOTFOUND);
}
$recipients = array_unique($recipients); $recipients = array_unique($recipients);
// find recipient public keys // find recipient public keys

@ -1100,11 +1100,15 @@ class enigma_ui
if ($mode && ($status instanceof enigma_error)) { if ($mode && ($status instanceof enigma_error)) {
$code = $status->getCode(); $code = $status->getCode();
if ($code == enigma_error::KEYNOTFOUND) { if ($code == enigma_error::KEYNOTFOUND) {
$vars = array('email' => $status->getData('missing')); if ($email = $status->getData('missing')) {
$vars = array('email' => $email);
$msg = 'enigma.' . $mode . 'nokey'; $msg = 'enigma.' . $mode . 'nokey';
} }
else {
$msg = 'enigma.' . ($encrypt_enable ? 'encryptnoprivkey' : 'signnokey');
}
}
else if ($code == enigma_error::BADPASS) { else if ($code == enigma_error::BADPASS) {
$this->password_prompt($status); $this->password_prompt($status);
} }

@ -112,6 +112,7 @@ $messages['signbadpass'] = 'Signing failed. Invalid password.';
$messages['signnopass'] = 'Signing failed. Key password required.'; $messages['signnopass'] = 'Signing failed. Key password required.';
$messages['encrypterror'] = 'Encryption failed.'; $messages['encrypterror'] = 'Encryption failed.';
$messages['encryptnokey'] = 'Encryption failed. Public key not found for $email.'; $messages['encryptnokey'] = 'Encryption failed. Public key not found for $email.';
$messages['encryptnoprivkey'] = 'Encryption failed. Private key not found.';
$messages['nokeysfound'] = 'No keys found'; $messages['nokeysfound'] = 'No keys found';
$messages['keynotfound'] = 'Key not found!'; $messages['keynotfound'] = 'Key not found!';
$messages['keyopenerror'] = 'Unable to get key information! Internal error.'; $messages['keyopenerror'] = 'Unable to get key information! Internal error.';

Loading…
Cancel
Save