chg: [internal] Better exception description for PGP key validation

pull/6646/head
Jakub Onderka 2020-11-24 19:01:25 +01:00
parent 5b9f8dd20a
commit 54efe760a4
2 changed files with 2 additions and 3 deletions

View File

@ -134,6 +134,8 @@ class CryptGpgExtended extends Crypt_GPG
// add last key
if ($key !== null) {
$keys[] = $key;
} else {
throw new Crypt_GPG_Exception("Key data provided, but gpg process output could not be parsed: $output");
}
return $keys;

View File

@ -95,9 +95,6 @@ class GpgTool
throw new InvalidArgumentException("Valid CryptGpgExtended instance required.");
}
$fetchedKeyInfo = $this->gpg->keyInfo($keyData);
if (empty($fetchedKeyInfo)) {
throw new Exception("No key found");
}
if (count($fetchedKeyInfo) !== 1) {
throw new Exception("Multiple keys found");
}