mirror of https://github.com/MISP/MISP
chg: [internal] Better exception description for PGP key validation
parent
5b9f8dd20a
commit
54efe760a4
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue