From c253732ad96159a99710e8165c6a8e701013c1ab Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 9 Nov 2022 15:30:29 +0100 Subject: [PATCH] Do not reject bnacksig signatures when they predate subkey binding date Fixes #334 --- .../org/pgpainless/signature/consumer/SignatureValidator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java b/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java index 56614f4f..af245235 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/consumer/SignatureValidator.java @@ -375,7 +375,9 @@ public abstract class SignatureValidator { public void verify(PGPSignature signature) throws SignatureValidationException { signatureHasHashedCreationTime().verify(signature); signatureDoesNotPredateSigningKey(creator).verify(signature); - signatureDoesNotPredateSigningKeyBindingDate(creator).verify(signature); + if (signature.getSignatureType() != SignatureType.PRIMARYKEY_BINDING.getCode()) { + signatureDoesNotPredateSigningKeyBindingDate(creator).verify(signature); + } } }; }