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

Fix faulty bit-strength policy check for signing subkeys

This commit is contained in:
Paul Schaub 2023-06-08 13:54:20 +02:00
parent a0a3d59cec
commit 0ad5df76f8
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -379,7 +379,7 @@ public final class SigningOptions {
SubkeyIdentifier signingKeyIdentifier = new SubkeyIdentifier(secretKey, signingSubkey.getKeyID()); SubkeyIdentifier signingKeyIdentifier = new SubkeyIdentifier(secretKey, signingSubkey.getKeyID());
PGPSecretKey signingSecretKey = secretKey.getSecretKey(signingSubkey.getKeyID()); PGPSecretKey signingSecretKey = secretKey.getSecretKey(signingSubkey.getKeyID());
PublicKeyAlgorithm publicKeyAlgorithm = PublicKeyAlgorithm.requireFromId(signingSecretKey.getPublicKey().getAlgorithm()); PublicKeyAlgorithm publicKeyAlgorithm = PublicKeyAlgorithm.requireFromId(signingSecretKey.getPublicKey().getAlgorithm());
int bitStrength = secretKey.getPublicKey().getBitStrength(); int bitStrength = signingSecretKey.getPublicKey().getBitStrength();
if (!PGPainless.getPolicy().getPublicKeyAlgorithmPolicy().isAcceptable(publicKeyAlgorithm, bitStrength)) { if (!PGPainless.getPolicy().getPublicKeyAlgorithmPolicy().isAcceptable(publicKeyAlgorithm, bitStrength)) {
throw new KeyException.UnacceptableSigningKeyException( throw new KeyException.UnacceptableSigningKeyException(
new KeyException.PublicKeyAlgorithmPolicyException( new KeyException.PublicKeyAlgorithmPolicyException(