mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-03-30 15:08:32 +00:00
Use preferred AEAD mode for secret key encryption (#1776)
When config.aeadProtect is enabled, use config.preferredAEADAlgorithm to decide the AEAD mode when encrypting secret keys.
This commit is contained in:
parent
42938c871a
commit
00e147f5c1
@ -392,7 +392,7 @@ class SecretKeyPacket extends PublicKeyPacket {
|
||||
|
||||
if (config.aeadProtect) {
|
||||
this.s2kUsage = 253;
|
||||
this.aead = enums.aead.eax;
|
||||
this.aead = config.preferredAEADAlgorithm;
|
||||
const mode = crypto.getAEADMode(this.aead);
|
||||
this.isLegacyAEAD = this.version === 5; // v4 is always re-encrypted with standard format instead.
|
||||
this.usedModernAEAD = !this.isLegacyAEAD; // legacy AEAD does not guarantee integrity of public key material
|
||||
|
Loading…
x
Reference in New Issue
Block a user