From 03dbd2f03f1c39dfd2ed5228f33d7e8a187fd4d3 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 8 Jun 2023 13:54:20 +0200 Subject: [PATCH] Fix faulty bit-strength policy check for signing subkeys --- .../java/org/pgpainless/encryption_signing/SigningOptions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/SigningOptions.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/SigningOptions.java index 0af07fc9..e481f490 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/SigningOptions.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/SigningOptions.java @@ -379,7 +379,7 @@ public final class SigningOptions { SubkeyIdentifier signingKeyIdentifier = new SubkeyIdentifier(secretKey, signingSubkey.getKeyID()); PGPSecretKey signingSecretKey = secretKey.getSecretKey(signingSubkey.getKeyID()); PublicKeyAlgorithm publicKeyAlgorithm = PublicKeyAlgorithm.requireFromId(signingSecretKey.getPublicKey().getAlgorithm()); - int bitStrength = secretKey.getPublicKey().getBitStrength(); + int bitStrength = signingSecretKey.getPublicKey().getBitStrength(); if (!PGPainless.getPolicy().getPublicKeyAlgorithmPolicy().isAcceptable(publicKeyAlgorithm, bitStrength)) { throw new KeyException.UnacceptableSigningKeyException( new KeyException.PublicKeyAlgorithmPolicyException(