fix: [pgp] key status check fixed for certain edge cases

develop
iglocska 2024-10-16 10:50:50 +02:00
parent 0c78028c6a
commit 2eb6b1ae77
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ class CryptGpgExtended extends \Crypt_GPG
$this->engine->reset(); $this->engine->reset();
$this->engine->setInput($input); $this->engine->setInput($input);
$this->engine->setOutput($output); $this->engine->setOutput($output);
$this->engine->setOperation('--import', ['--import-options', 'show-only', '--with-colons']); $this->engine->setOperation('--import', ['--import-options', 'show-only', '--with-colons', '--no-default-keyring --no-auto-check-trustdb --trust-model pgp']);
$this->engine->run(); $this->engine->run();
$keys = []; $keys = [];

View File

@ -109,10 +109,10 @@ class EncryptionKeysTable extends AppTable
if (!$sortedKeys['valid']) { if (!$sortedKeys['valid']) {
$result[2] = 'The user\'s PGP key does not include a valid subkey that could be used for encryption.'; $result[2] = 'The user\'s PGP key does not include a valid subkey that could be used for encryption.';
if ($sortedKeys['expired']) { if ($sortedKeys['expired']) {
$result[2] .= ' ' . __n('Found %s subkey that have expired.', 'Found %s subkeys that have expired.', $sortedKeys['expired'], $sortedKeys['expired']); $result[2] .= ' ' . __n(__('Found 1 subkey that has expired.'), __('Found {0} subkeys that have expired.', $sortedKeys['expired']), $sortedKeys['expired']);
} }
if ($sortedKeys['noEncrypt']) { if ($sortedKeys['noEncrypt']) {
$result[2] .= ' ' . __n('Found %s subkey that is sign only.', 'Found %s subkeys that are sign only.', $sortedKeys['noEncrypt'], $sortedKeys['noEncrypt']); $result[2] .= ' ' . __n(__('Found 1 subkey that is sign only.'), __('Found {0} subkeys that are sign only.', $sortedKeys['noEncrypt']), $sortedKeys['noEncrypt']);
} }
} else { } else {
$result[0] = true; $result[0] = true;