diff --git a/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketInputStream.java b/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketInputStream.java index 7f34ca073b..2fb99eb379 100644 --- a/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketInputStream.java +++ b/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketInputStream.java @@ -12,6 +12,7 @@ import org.bouncycastle.bcpg.sig.IssuerKeyID; import org.bouncycastle.bcpg.sig.KeyExpirationTime; import org.bouncycastle.bcpg.sig.KeyFlags; +import org.bouncycastle.bcpg.sig.LibrePGPPreferredEncryptionModes; import org.bouncycastle.bcpg.sig.NotationData; import org.bouncycastle.bcpg.sig.PolicyURI; import org.bouncycastle.bcpg.sig.PreferredAEADCiphersuites; @@ -150,6 +151,8 @@ else if (flags[StreamUtil.flag_partial]) case PREFERRED_HASH_ALGS: case PREFERRED_SYM_ALGS: return new PreferredAlgorithms(type, isCritical, isLongLength, data); + case LIBREPGP_PREFERRED_ENCRYPTION_MODES: + return new LibrePGPPreferredEncryptionModes(isCritical, isLongLength, data); case PREFERRED_AEAD_ALGORITHMS: return new PreferredAEADCiphersuites(isCritical, isLongLength, data); case KEY_FLAGS: diff --git a/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketTags.java b/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketTags.java index 73456727b4..03dbd71926 100644 --- a/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketTags.java +++ b/pg/src/main/java/org/bouncycastle/bcpg/SignatureSubpacketTags.java @@ -30,8 +30,8 @@ public interface SignatureSubpacketTags int SIGNATURE_TARGET = 31; // signature target int EMBEDDED_SIGNATURE = 32; // embedded signature int ISSUER_FINGERPRINT = 33; // issuer key fingerprint -// public static final int PREFERRED_AEAD_ALGORITHMS = 34; // RESERVED since crypto-refresh-05 -int INTENDED_RECIPIENT_FINGERPRINT = 35; // intended recipient fingerprint + int LIBREPGP_PREFERRED_ENCRYPTION_MODES = 34; + int INTENDED_RECIPIENT_FINGERPRINT = 35; // intended recipient fingerprint int ATTESTED_CERTIFICATIONS = 37; // attested certifications (RESERVED) int KEY_BLOCK = 38; // Key Block (RESERVED) int PREFERRED_AEAD_ALGORITHMS = 39; // preferred AEAD algorithms diff --git a/pg/src/main/java/org/bouncycastle/bcpg/sig/LibrePGPPreferredEncryptionModes.java b/pg/src/main/java/org/bouncycastle/bcpg/sig/LibrePGPPreferredEncryptionModes.java new file mode 100644 index 0000000000..bfc6c5e950 --- /dev/null +++ b/pg/src/main/java/org/bouncycastle/bcpg/sig/LibrePGPPreferredEncryptionModes.java @@ -0,0 +1,23 @@ +package org.bouncycastle.bcpg.sig; + +import org.bouncycastle.bcpg.SignatureSubpacketTags; + +/** + * This is a deprecated LibrePGP signature subpacket with encryption mode numbers to indicate which modes + * the key holder prefers to use with OCB Encrypted Data Packets ({@link org.bouncycastle.bcpg.AEADEncDataPacket}). + * Implementations SHOULD ignore this subpacket and assume {@link org.bouncycastle.bcpg.AEADAlgorithmTags#OCB}. + */ +public class LibrePGPPreferredEncryptionModes + extends PreferredAlgorithms +{ + + public LibrePGPPreferredEncryptionModes(boolean isCritical, int[] encryptionModes) + { + this(isCritical, false, intToByteArray(encryptionModes)); + } + + public LibrePGPPreferredEncryptionModes(boolean critical, boolean isLongLength, byte[] data) + { + super(SignatureSubpacketTags.LIBREPGP_PREFERRED_ENCRYPTION_MODES, critical, isLongLength, data); + } +} diff --git a/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAEADCiphersuites.java b/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAEADCiphersuites.java index 1ed5ae9001..679fcfc023 100644 --- a/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAEADCiphersuites.java +++ b/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAEADCiphersuites.java @@ -4,6 +4,9 @@ import org.bouncycastle.bcpg.SignatureSubpacketTags; import org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags; +import java.util.ArrayList; +import java.util.List; + public class PreferredAEADCiphersuites extends PreferredAlgorithms { @@ -144,6 +147,51 @@ private static byte[] requireEven(byte[] encodedCombinations) return encodedCombinations; } + /** + * Return a {@link Builder} for constructing a {@link PreferredAEADCiphersuites} packet. + * @param isCritical true if the packet is considered critical. + * @return builder + */ + public static Builder builder(boolean isCritical) + { + return new Builder(isCritical); + } + + public static final class Builder + { + + private final List combinations = new ArrayList<>(); + private final boolean isCritical; + + private Builder(boolean isCritical) + { + this.isCritical = isCritical; + } + + /** + * Add a combination of cipher- and AEAD algorithm to the list of supported ciphersuites. + * @see SymmetricKeyAlgorithmTags for cipher algorithms + * @see AEADAlgorithmTags for AEAD algorithms + * @param symmetricAlgorithmId symmetric cipher algorithm ID + * @param aeadAlgorithmId AEAD algorithm ID + * @return builder + */ + public Builder addCombination(int symmetricAlgorithmId, int aeadAlgorithmId) + { + combinations.add(new Combination(symmetricAlgorithmId, aeadAlgorithmId)); + return this; + } + + /** + * Build a {@link PreferredAEADCiphersuites} from this builder. + * @return finished packet + */ + public PreferredAEADCiphersuites build() + { + return new PreferredAEADCiphersuites(isCritical, combinations.toArray(new Combination[0])); + } + } + /** * Algorithm combination of a {@link SymmetricKeyAlgorithmTags} and a {@link AEADAlgorithmTags}. */ diff --git a/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAlgorithms.java b/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAlgorithms.java index 16072bae79..ddf6493afe 100644 --- a/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAlgorithms.java +++ b/pg/src/main/java/org/bouncycastle/bcpg/sig/PreferredAlgorithms.java @@ -8,7 +8,7 @@ public class PreferredAlgorithms extends SignatureSubpacket { - private static byte[] intToByteArray( + protected static byte[] intToByteArray( int[] v) { byte[] data = new byte[v.length]; diff --git a/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketGenerator.java b/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketGenerator.java index 5d81b17980..178f323d65 100644 --- a/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketGenerator.java +++ b/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketGenerator.java @@ -15,8 +15,10 @@ import org.bouncycastle.bcpg.sig.IssuerKeyID; import org.bouncycastle.bcpg.sig.KeyExpirationTime; import org.bouncycastle.bcpg.sig.KeyFlags; +import org.bouncycastle.bcpg.sig.LibrePGPPreferredEncryptionModes; import org.bouncycastle.bcpg.sig.NotationData; import org.bouncycastle.bcpg.sig.PolicyURI; +import org.bouncycastle.bcpg.sig.PreferredAEADCiphersuites; import org.bouncycastle.bcpg.sig.PreferredAlgorithms; import org.bouncycastle.bcpg.sig.PrimaryUserID; import org.bouncycastle.bcpg.sig.RegularExpression; @@ -191,17 +193,69 @@ public void setPreferredCompressionAlgorithms(boolean isCritical, int[] algorith } /** + * This method is BROKEN! * Specify the preferred AEAD algorithms of this key. * * @param isCritical true if should be treated as critical, false otherwise. * @param algorithms array of algorithms in descending preference + * @deprecated use {@link #setPreferredAEADCiphersuites(boolean, PreferredAEADCiphersuites.Combination[])} + * or {@link #setPreferredLibrePgpEncryptionModes(boolean, int[])} instead. */ + @Deprecated public void setPreferredAEADAlgorithms(boolean isCritical, int[] algorithms) { packets.add(new PreferredAlgorithms(SignatureSubpacketTags.PREFERRED_AEAD_ALGORITHMS, isCritical, algorithms)); } + /** + * Specify the preferred OpenPGP AEAD ciphersuites of this key. + * + * @see + * RFC9580: Preferred AEAD Ciphersuites + * + * @param isCritical true, if this packet should be treated as critical, false otherwise. + * @param algorithms array of algorithms in descending preference + */ + public void setPreferredAEADCiphersuites(boolean isCritical, PreferredAEADCiphersuites.Combination[] algorithms) + { + packets.add(new PreferredAEADCiphersuites(isCritical, algorithms)); + } + + /** + * Specify the preferred OpenPGP AEAD ciphersuites of this key. + * + * @see + * RFC9580: Preferred AEAD Ciphersuites + * + * @param builder builder to build the ciphersuites packet from + */ + public void setPreferredAEADCiphersuites(PreferredAEADCiphersuites.Builder builder) + { + packets.add(builder.build()); + } + + /** + * Set the preferred encryption modes for LibrePGP keys. + * Note: LibrePGP is not OpenPGP. An application strictly compliant to only the OpenPGP standard will not + * know how to handle LibrePGP encryption modes. + * The LibrePGP spec states that this subpacket shall be ignored and the application shall instead assume + * {@link org.bouncycastle.bcpg.AEADAlgorithmTags#OCB}. + * + * @see + * LibrePGP: Preferred Encryption Modes + * @see org.bouncycastle.bcpg.AEADAlgorithmTags for possible algorithms + * + * @param isCritical whether the packet is critical + * @param algorithms list of algorithms + * @deprecated the use of this subpacket is deprecated in LibrePGP + */ + @Deprecated + public void setPreferredLibrePgpEncryptionModes(boolean isCritical, int[] algorithms) + { + packets.add(new LibrePGPPreferredEncryptionModes(isCritical, algorithms)); + } + public void addPolicyURI(boolean isCritical, String policyUri) { packets.add(new PolicyURI(isCritical, policyUri)); diff --git a/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketVector.java b/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketVector.java index 01a507aae4..05a3163ca2 100644 --- a/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketVector.java +++ b/pg/src/main/java/org/bouncycastle/openpgp/PGPSignatureSubpacketVector.java @@ -16,8 +16,10 @@ import org.bouncycastle.bcpg.sig.IssuerKeyID; import org.bouncycastle.bcpg.sig.KeyExpirationTime; import org.bouncycastle.bcpg.sig.KeyFlags; +import org.bouncycastle.bcpg.sig.LibrePGPPreferredEncryptionModes; import org.bouncycastle.bcpg.sig.NotationData; import org.bouncycastle.bcpg.sig.PolicyURI; +import org.bouncycastle.bcpg.sig.PreferredAEADCiphersuites; import org.bouncycastle.bcpg.sig.PreferredAlgorithms; import org.bouncycastle.bcpg.sig.PrimaryUserID; import org.bouncycastle.bcpg.sig.RegularExpression; @@ -285,6 +287,13 @@ public int[] getPreferredCompressionAlgorithms() return ((PreferredAlgorithms)p).getPreferences(); } + /** + * This method is BROKEN! + * @deprecated use {@link #getPreferredAEADCiphersuites()} or {@link #getPreferredLibrePgpEncryptionModes()} + * instead. + * @return preferred AEAD Algorithms + */ + @Deprecated public int[] getPreferredAEADAlgorithms() { SignatureSubpacket p = this.getSubpacket(SignatureSubpacketTags.PREFERRED_AEAD_ALGORITHMS); @@ -297,6 +306,40 @@ public int[] getPreferredAEADAlgorithms() return ((PreferredAlgorithms)p).getPreferences(); } + /** + * Return the preferred AEAD ciphersuites denoted in the signature. + * + * @return OpenPGP AEAD ciphersuites + */ + public PreferredAEADCiphersuites getPreferredAEADCiphersuites() + { + SignatureSubpacket p = this.getSubpacket(SignatureSubpacketTags.PREFERRED_AEAD_ALGORITHMS); + + if (p == null) + { + return null; + } + return (PreferredAEADCiphersuites) p; + } + + /** + * Return the preferred LibrePGP encryption modes denoted in the signature. + * Note: The LibrePGP spec states that this subpacket shall be ignored and the application + * shall instead assume {@link org.bouncycastle.bcpg.AEADAlgorithmTags#OCB}. + * + * @return LibrePGP encryption modes + */ + public int[] getPreferredLibrePgpEncryptionModes() + { + SignatureSubpacket p = this.getSubpacket(SignatureSubpacketTags.PREFERRED_AEAD_ALGORITHMS); + + if (p == null) + { + return null; + } + return ((LibrePGPPreferredEncryptionModes) p).getPreferences(); + } + public int getKeyFlags() { SignatureSubpacket p = this.getSubpacket(SignatureSubpacketTags.KEY_FLAGS); diff --git a/pg/src/test/java/org/bouncycastle/bcpg/test/SignatureSubpacketsTest.java b/pg/src/test/java/org/bouncycastle/bcpg/test/SignatureSubpacketsTest.java new file mode 100644 index 0000000000..05df687b77 --- /dev/null +++ b/pg/src/test/java/org/bouncycastle/bcpg/test/SignatureSubpacketsTest.java @@ -0,0 +1,54 @@ +package org.bouncycastle.bcpg.test; + +import org.bouncycastle.bcpg.AEADAlgorithmTags; +import org.bouncycastle.bcpg.SignatureSubpacketTags; +import org.bouncycastle.bcpg.sig.LibrePGPPreferredEncryptionModes; +import org.bouncycastle.util.Arrays; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +public class SignatureSubpacketsTest + extends AbstractPacketTest +{ + @Override + public String getName() + { + return "SignatureSubpacketsTest"; + } + + @Override + public void performTest() + throws Exception + { + testLibrePGPPreferredEncryptionModesSubpacket(); + } + + private void testLibrePGPPreferredEncryptionModesSubpacket() + throws IOException + { + int[] algorithms = new int[] {AEADAlgorithmTags.EAX, AEADAlgorithmTags.OCB}; + LibrePGPPreferredEncryptionModes encModes = new LibrePGPPreferredEncryptionModes( + false, algorithms); + + isTrue("Encryption Modes encoding mismatch", + Arrays.areEqual(algorithms, encModes.getPreferences())); + isFalse("Mismatch in critical flag", encModes.isCritical()); + + // encode to byte array and check correctness + ByteArrayOutputStream bOut = new ByteArrayOutputStream(); + encModes.encode(bOut); + + isEncodingEqual("Packet encoding mismatch", new byte[]{ + 3, // length + SignatureSubpacketTags.LIBREPGP_PREFERRED_ENCRYPTION_MODES, + AEADAlgorithmTags.EAX, + AEADAlgorithmTags.OCB + }, bOut.toByteArray()); + } + + public static void main(String[] args) + { + runTest(new SignatureSubpacketsTest()); + } +} diff --git a/pg/src/test/java/org/bouncycastle/openpgp/test/PGPGeneralTest.java b/pg/src/test/java/org/bouncycastle/openpgp/test/PGPGeneralTest.java index 9714f78eb1..bc03498760 100644 --- a/pg/src/test/java/org/bouncycastle/openpgp/test/PGPGeneralTest.java +++ b/pg/src/test/java/org/bouncycastle/openpgp/test/PGPGeneralTest.java @@ -35,6 +35,7 @@ import org.bouncycastle.bcpg.sig.KeyFlags; import org.bouncycastle.bcpg.sig.NotationData; import org.bouncycastle.bcpg.sig.PolicyURI; +import org.bouncycastle.bcpg.sig.PreferredAEADCiphersuites; import org.bouncycastle.bcpg.sig.RegularExpression; import org.bouncycastle.bcpg.sig.RevocationKey; import org.bouncycastle.bcpg.sig.RevocationKeyTags; @@ -104,7 +105,7 @@ import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder; import org.bouncycastle.openpgp.operator.jcajce.JcePublicKeyDataDecryptorFactoryBuilder; -import org.bouncycastle.util.Arrays; +import org.bouncycastle.util.Objects; import org.bouncycastle.util.Strings; import org.bouncycastle.util.encoders.Base64; import org.bouncycastle.util.test.SimpleTest; @@ -1007,6 +1008,7 @@ public void performTest() // Tests for PGPSignatureSubpacketVector sigsubpacketTest(); + sigsubpacketTest2(); testParsingFromSignature(); testPGPSignatureSubpacketVector(); @@ -1927,9 +1929,12 @@ private void sigsubpacketTest() PGPSignatureSubpacketGenerator svg = new PGPSignatureSubpacketGenerator(); - int[] aeadAlgs = new int[]{AEADAlgorithmTags.EAX, - AEADAlgorithmTags.OCB, AEADAlgorithmTags.GCM, AEADAlgorithmTags.GCM}; - svg.setPreferredAEADAlgorithms(true, aeadAlgs); + PreferredAEADCiphersuites.Builder builder = PreferredAEADCiphersuites.builder(true); + builder.addCombination(SymmetricKeyAlgorithmTags.AES_256, AEADAlgorithmTags.EAX) + .addCombination(SymmetricKeyAlgorithmTags.AES_256, AEADAlgorithmTags.OCB) + .addCombination(SymmetricKeyAlgorithmTags.AES_256, AEADAlgorithmTags.GCM) + .addCombination(SymmetricKeyAlgorithmTags.AES_128, AEADAlgorithmTags.GCM); + svg.setPreferredAEADCiphersuites(builder); svg.setFeature(true, Features.FEATURE_MODIFICATION_DETECTION); svg.setKeyFlags(true, KeyFlags.CERTIFY_OTHER + KeyFlags.SIGN_DATA); PGPSignatureSubpacketVector hashedPcks = svg.generate(); @@ -1961,7 +1966,71 @@ sgnKeyPair, identity, new BcPGPDigestCalculatorProvider().get(HashAlgorithmTags. { PGPSignature sig = (PGPSignature)sit.next(); PGPSignatureSubpacketVector v = sig.getHashedSubPackets(); - if (!Arrays.areEqual(v.getPreferredAEADAlgorithms(), aeadAlgs)) + if (!Objects.areEqual(v.getPreferredAEADCiphersuites(), builder.build())) + { + fail("preferred aead algs don't match"); + } + } + } + } + } + + private void sigsubpacketTest2() + throws Exception + { + char[] passPhrase = "test".toCharArray(); + String identity = "TEST "; + Date date = new Date(); + + RSAKeyPairGenerator kpg = new RSAKeyPairGenerator(); + kpg.init(new RSAKeyGenerationParameters(BigInteger.valueOf(0x11), new SecureRandom(), 2048, 25)); + AsymmetricCipherKeyPair kpSgn = kpg.generateKeyPair(); + AsymmetricCipherKeyPair kpEnc = kpg.generateKeyPair(); + + PGPKeyPair sgnKeyPair = new BcPGPKeyPair(PGPPublicKey.RSA_SIGN, kpSgn, date); + PGPKeyPair encKeyPair = new BcPGPKeyPair(PGPPublicKey.RSA_GENERAL, kpEnc, date); + + PGPSignatureSubpacketGenerator svg = new PGPSignatureSubpacketGenerator(); + + PreferredAEADCiphersuites.Combination[] combinations = new PreferredAEADCiphersuites.Combination[]{ + new PreferredAEADCiphersuites.Combination(SymmetricKeyAlgorithmTags.AES_256, AEADAlgorithmTags.EAX), + new PreferredAEADCiphersuites.Combination(SymmetricKeyAlgorithmTags.AES_256, AEADAlgorithmTags.OCB), + new PreferredAEADCiphersuites.Combination(SymmetricKeyAlgorithmTags.AES_256, AEADAlgorithmTags.GCM), + new PreferredAEADCiphersuites.Combination(SymmetricKeyAlgorithmTags.AES_128, AEADAlgorithmTags.GCM) + }; + svg.setPreferredAEADCiphersuites(true, combinations); + svg.setFeature(true, Features.FEATURE_MODIFICATION_DETECTION); + svg.setKeyFlags(true, KeyFlags.CERTIFY_OTHER + KeyFlags.SIGN_DATA); + PGPSignatureSubpacketVector hashedPcks = svg.generate(); + + PGPKeyRingGenerator keyRingGen = new PGPKeyRingGenerator(PGPSignature.POSITIVE_CERTIFICATION, + sgnKeyPair, identity, new BcPGPDigestCalculatorProvider().get(HashAlgorithmTags.SHA1), + hashedPcks, null, new BcPGPContentSignerBuilder(PGPPublicKey.RSA_GENERAL, HashAlgorithmTags.SHA1), new BcPBESecretKeyEncryptorBuilder(PGPEncryptedData.AES_256).build(passPhrase)); + + svg = new PGPSignatureSubpacketGenerator(); + svg.setKeyExpirationTime(true, 2L); + svg.setKeyFlags(true, KeyFlags.ENCRYPT_COMMS + KeyFlags.ENCRYPT_STORAGE); + svg.setPrimaryUserID(true, false); + svg.setFeature(true, Features.FEATURE_MODIFICATION_DETECTION); + hashedPcks = svg.generate(); + + keyRingGen.addSubKey(encKeyPair, hashedPcks, null); + + byte[] encodedKeyRing = keyRingGen.generatePublicKeyRing().getEncoded(); + + PGPPublicKeyRing keyRing = new PGPPublicKeyRing(encodedKeyRing, new BcKeyFingerprintCalculator()); + + for (Iterator it = keyRing.getPublicKeys(); it.hasNext(); ) + { + PGPPublicKey pKey = (PGPPublicKey)it.next(); + + if (!pKey.isEncryptionKey()) + { + for (Iterator sit = pKey.getSignatures(); sit.hasNext(); ) + { + PGPSignature sig = (PGPSignature)sit.next(); + PGPSignatureSubpacketVector v = sig.getHashedSubPackets(); + if (!Objects.areEqual(v.getPreferredAEADCiphersuites(), new PreferredAEADCiphersuites(true, combinations))) { fail("preferred aead algs don't match"); } @@ -2055,6 +2124,7 @@ public void testPGPSignatureSubpacketVector() isTrue("RevocationReason should be null", hashedPcks.getRevocationReason() == null); isTrue("Trust should be null", hashedPcks.getTrust() == null); isTrue(hashedPcks.getIntendedRecipientFingerprint().getKeyVersion() == publicKey.getVersion()); + isTrue(hashedPcks.getPreferredLibrePgpEncryptionModes() == null); String regexString = "example.org"; RegularExpression regex = new RegularExpression(false, regexString); @@ -2130,9 +2200,9 @@ public void testPGPSignatureSubpacketVector() isTrue("isPrimaryUserID should be true", hashedPcks.isPrimaryUserID()); - PGPSignatureSubpacketVector hashedPcks2 = PGPSignatureSubpacketVector.fromSubpackets((SignatureSubpacket[]) null); + PGPSignatureSubpacketVector hashedPcks2 = PGPSignatureSubpacketVector.fromSubpackets((SignatureSubpacket[])null); isTrue("Empty PGPSignatureSubpacketVector", hashedPcks2.size() == 0); - hashedPcks2 = PGPSignatureSubpacketVector.fromSubpackets((Collection) null); + hashedPcks2 = PGPSignatureSubpacketVector.fromSubpackets((Collection)null); isTrue("Empty PGPSignatureSubpacketVector", hashedPcks2.size() == 0); hashedGen = new PGPSignatureSubpacketGenerator(); diff --git a/pg/src/test/java/org/bouncycastle/openpgp/test/RegressionTest.java b/pg/src/test/java/org/bouncycastle/openpgp/test/RegressionTest.java index 6c5ea8dd24..a2b832ff88 100644 --- a/pg/src/test/java/org/bouncycastle/openpgp/test/RegressionTest.java +++ b/pg/src/test/java/org/bouncycastle/openpgp/test/RegressionTest.java @@ -2,6 +2,7 @@ import java.security.Security; +import org.bouncycastle.bcpg.test.SignatureSubpacketsTest; import org.bouncycastle.util.test.SimpleTest; import org.bouncycastle.util.test.Test; @@ -63,6 +64,7 @@ public class RegressionTest new OperatorJcajceTest(), new OpenPGPTest(), new OperatorBcTest(), + new SignatureSubpacketsTest(), new DedicatedEd25519KeyPairTest(), new DedicatedEd448KeyPairTest(),