1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-09 18:29:39 +02:00

EncryptionMechanismNegotiator: Allow producing AEADED/OED packets

This commit is contained in:
Paul Schaub 2025-06-03 11:49:59 +02:00
parent df136adfab
commit 24887e2521
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -67,6 +67,15 @@ fun interface EncryptionMechanismNegotiator {
return MessageEncryptionMechanism.aead( return MessageEncryptionMechanism.aead(
bestSupportedMode.ciphermode.algorithmId, bestSupportedMode.ciphermode.algorithmId,
bestSupportedMode.aeadAlgorithm.algorithmId) bestSupportedMode.aeadAlgorithm.algorithmId)
} else if (features.all { it.contains(Feature.LIBREPGP_OCB_ENCRYPTED_DATA) }) {
return MessageEncryptionMechanism.librePgp(
symmetricKeyAlgorithmNegotiator
.negotiate(
policy.messageEncryptionAlgorithmPolicy
.symmetricAlgorithmPolicy,
null,
symmetricAlgorithmPreferences)
.algorithmId)
} }
// If all support SEIPD1, negotiate SEIPD1 using symmetricKeyAlgorithmNegotiator // If all support SEIPD1, negotiate SEIPD1 using symmetricKeyAlgorithmNegotiator
else if (features.all { it.contains(Feature.MODIFICATION_DETECTION) }) { else if (features.all { it.contains(Feature.MODIFICATION_DETECTION) }) {