1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +01:00

Rename GNUPG features

This commit is contained in:
Paul Schaub 2023-05-22 14:37:02 +02:00
parent ec6fc810d4
commit 55058d6070
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 7 additions and 7 deletions

View file

@ -41,7 +41,7 @@ public enum Feature {
* @see <a href="https://openpgp-wg.gitlab.io/rfc4880bis/#name-aead-encrypted-data-packet-"> * @see <a href="https://openpgp-wg.gitlab.io/rfc4880bis/#name-aead-encrypted-data-packet-">
* AEAD Encrypted Data Packet</a> * AEAD Encrypted Data Packet</a>
*/ */
AEAD_ENCRYPTED_DATA(Features.FEATURE_AEAD_ENCRYPTED_DATA), GNUGP_AEAD_ENCRYPTED_DATA(Features.FEATURE_AEAD_ENCRYPTED_DATA),
/** /**
* If a key announces this feature, it is a version 5 public key. * If a key announces this feature, it is a version 5 public key.
@ -56,7 +56,7 @@ public enum Feature {
* @see <a href="https://openpgp-wg.gitlab.io/rfc4880bis/#name-public-key-packet-formats"> * @see <a href="https://openpgp-wg.gitlab.io/rfc4880bis/#name-public-key-packet-formats">
* Public-Key Packet Formats</a> * Public-Key Packet Formats</a>
*/ */
VERSION_5_PUBLIC_KEY(Features.FEATURE_VERSION_5_PUBLIC_KEY), GNUPG_VERSION_5_PUBLIC_KEY(Features.FEATURE_VERSION_5_PUBLIC_KEY),
/** /**
* Support for Symmetrically Encrypted Integrity Protected Data packet version 2. * Support for Symmetrically Encrypted Integrity Protected Data packet version 2.

View file

@ -140,7 +140,7 @@ public class SignatureSubpacketsUtilTest {
PGPSignatureGenerator generator = getSignatureGenerator(certKey, SignatureType.CASUAL_CERTIFICATION); PGPSignatureGenerator generator = getSignatureGenerator(certKey, SignatureType.CASUAL_CERTIFICATION);
PGPSignatureSubpacketGenerator hashed = new PGPSignatureSubpacketGenerator(); PGPSignatureSubpacketGenerator hashed = new PGPSignatureSubpacketGenerator();
hashed.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.AEAD_ENCRYPTED_DATA)); hashed.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.GNUGP_AEAD_ENCRYPTED_DATA));
generator.setHashedSubpackets(hashed.generate()); generator.setHashedSubpackets(hashed.generate());
PGPSignature signature = generator.generateCertification(secretKeys.getPublicKey()); PGPSignature signature = generator.generateCertification(secretKeys.getPublicKey());
@ -148,8 +148,8 @@ public class SignatureSubpacketsUtilTest {
assertNotNull(featureSet); assertNotNull(featureSet);
assertEquals(2, featureSet.size()); assertEquals(2, featureSet.size());
assertTrue(featureSet.contains(Feature.MODIFICATION_DETECTION)); assertTrue(featureSet.contains(Feature.MODIFICATION_DETECTION));
assertTrue(featureSet.contains(Feature.AEAD_ENCRYPTED_DATA)); assertTrue(featureSet.contains(Feature.GNUGP_AEAD_ENCRYPTED_DATA));
assertFalse(featureSet.contains(Feature.VERSION_5_PUBLIC_KEY)); assertFalse(featureSet.contains(Feature.GNUPG_VERSION_5_PUBLIC_KEY));
} }
@Test @Test

View file

@ -388,7 +388,7 @@ public class SignatureSubpacketsTest {
@Test @Test
public void testSetFeatures() { public void testSetFeatures() {
wrapper.setFeatures(Feature.MODIFICATION_DETECTION, Feature.AEAD_ENCRYPTED_DATA); wrapper.setFeatures(Feature.MODIFICATION_DETECTION, Feature.GNUGP_AEAD_ENCRYPTED_DATA);
PGPSignatureSubpacketVector vector = SignatureSubpacketsHelper.toVector(wrapper); PGPSignatureSubpacketVector vector = SignatureSubpacketsHelper.toVector(wrapper);
Features features = vector.getFeatures(); Features features = vector.getFeatures();
@ -476,7 +476,7 @@ public class SignatureSubpacketsTest {
subpackets.setKeyFlags(true, KeyFlag.toBitmask(KeyFlag.SIGN_DATA, KeyFlag.CERTIFY_OTHER)); subpackets.setKeyFlags(true, KeyFlag.toBitmask(KeyFlag.SIGN_DATA, KeyFlag.CERTIFY_OTHER));
subpackets.addSignerUserID(false, "alice@test.test"); subpackets.addSignerUserID(false, "alice@test.test");
subpackets.setRevocationReason(true, RevocationAttributes.Reason.KEY_RETIRED.code(), "Key was retired."); subpackets.setRevocationReason(true, RevocationAttributes.Reason.KEY_RETIRED.code(), "Key was retired.");
subpackets.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.AEAD_ENCRYPTED_DATA)); subpackets.setFeature(true, Feature.toBitmask(Feature.MODIFICATION_DETECTION, Feature.GNUGP_AEAD_ENCRYPTED_DATA));
byte[] hash = new byte[128]; byte[] hash = new byte[128];
new Random().nextBytes(hash); new Random().nextBytes(hash);
subpackets.setSignatureTarget(false, publicKeys.getPublicKey().getAlgorithm(), HashAlgorithm.SHA512.getAlgorithmId(), hash); subpackets.setSignatureTarget(false, publicKeys.getPublicKey().getAlgorithm(), HashAlgorithm.SHA512.getAlgorithmId(), hash);