1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-08 13:21:09 +01:00

Move EncryptionMechanismNegotiator into own interface, improve negotiation

This commit is contained in:
Paul Schaub 2025-05-25 16:27:49 +02:00
parent 65e2de8186
commit a575f46867
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 111 additions and 34 deletions

View file

@ -79,11 +79,15 @@ public class MechanismNegotiationTest {
.build()));
}
/**
* Here, we fall back to SEIPD1(AES128), as that is the policy fallback mechanism.
*/
@TestTemplate
@ExtendWith(TestAllImplementations.class)
public void testEncryptToV6SEIPD1CertAndV6SEIPD2Cert() throws IOException, PGPException {
testEncryptDecryptAndCheckExpectations(
MessageEncryptionMechanism.integrityProtected(SymmetricKeyAlgorithm.AES_192.getAlgorithmId()),
MessageEncryptionMechanism.integrityProtected(SymmetricKeyAlgorithm.AES_128.getAlgorithmId()),
new KeySpecification(OpenPGPKeyVersion.v6, AlgorithmSuite.emptyBuilder()
.overrideAeadAlgorithms(new AEADCipherMode(AEADAlgorithm.OCB, SymmetricKeyAlgorithm.AES_256))