mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-22 19:08:00 +01:00
SignatureValidator: Prevent NPE when no EmbeddedSignature subpacket is found
This commit is contained in:
parent
005b9d477a
commit
88de47490b
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
package org.pgpainless.signature.consumer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -115,6 +116,12 @@ public abstract class SignatureValidator {
|
|||
|
||||
try {
|
||||
PGPSignatureList embeddedSignatures = SignatureSubpacketsUtil.getEmbeddedSignature(signature);
|
||||
if (embeddedSignatures == null) {
|
||||
throw new SignatureValidationException(
|
||||
"Missing primary key binding signature on signing capable subkey " +
|
||||
Long.toHexString(subkey.getKeyID()), Collections.emptyMap());
|
||||
}
|
||||
|
||||
boolean hasValidPrimaryKeyBinding = false;
|
||||
Map<PGPSignature, Exception> rejectedEmbeddedSigs = new ConcurrentHashMap<>();
|
||||
for (PGPSignature embedded : embeddedSignatures) {
|
||||
|
|
Loading…
Reference in a new issue