1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 22:32:07 +01:00

Fix NPE when signing key is not found during signature verification

This commit is contained in:
Paul Schaub 2020-12-16 17:29:12 +01:00
parent 4870bda4f2
commit ff8c6d8b6d

View file

@ -95,6 +95,9 @@ public final class DecryptionStreamFactory {
pgpInputStream = inputStream; pgpInputStream = inputStream;
for (PGPSignature signature : detachedSignatures) { for (PGPSignature signature : detachedSignatures) {
PGPPublicKey signingKey = factory.findSignatureVerificationKey(signature.getKeyID()); PGPPublicKey signingKey = factory.findSignatureVerificationKey(signature.getKeyID());
if (signingKey == null) {
continue;
}
signature.init(new BcPGPContentVerifierBuilderProvider(), signingKey); signature.init(new BcPGPContentVerifierBuilderProvider(), signingKey);
factory.resultBuilder.addDetachedSignature( factory.resultBuilder.addDetachedSignature(
new DetachedSignature(signature, new OpenPgpV4Fingerprint(signingKey))); new DetachedSignature(signature, new OpenPgpV4Fingerprint(signingKey)));