Skip to content

Commit

Permalink
Fix NPE when signing key is not found during signature verification
Browse files Browse the repository at this point in the history
  • Loading branch information
vanitasvitae committed Dec 16, 2020
1 parent 4870bda commit ff8c6d8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public static DecryptionStream create(@Nonnull InputStream inputStream,
pgpInputStream = inputStream;
for (PGPSignature signature : detachedSignatures) {
PGPPublicKey signingKey = factory.findSignatureVerificationKey(signature.getKeyID());
if (signingKey == null) {
continue;
}
signature.init(new BcPGPContentVerifierBuilderProvider(), signingKey);
factory.resultBuilder.addDetachedSignature(
new DetachedSignature(signature, new OpenPgpV4Fingerprint(signingKey)));
Expand Down

0 comments on commit ff8c6d8

Please sign in to comment.