1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-10 14:21:09 +01:00

Add test to ensure PGPainless will refuse to decrypt message with incapable key

This commit is contained in:
Paul Schaub 2021-12-13 12:43:08 +01:00
parent 80e12db8b6
commit 5108b81252
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 204 additions and 2 deletions

View file

@ -407,9 +407,9 @@ public final class DecryptionStreamFactory {
if (secretKey == null) {
LOGGER.debug("Key " + Long.toHexString(keyId) + " is not valid or not capable for decryption.");
} else {
privateKey = tryPublicKeyDecryption(secretKeys, secretKey, publicKeyEncryptedData, postponedDueToMissingPassphrase, true);
}
privateKey = tryPublicKeyDecryption(secretKeys, secretKey, publicKeyEncryptedData, postponedDueToMissingPassphrase, true);
}
if (privateKey == null) {
continue;