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:
parent
df136adfab
commit
24887e2521
1 changed files with 9 additions and 0 deletions
|
@ -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) }) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue