Fix decryption support for non-standard, legacy AEAD-encrypted messages and keys that used experimentalGCM from OpenPGP.js v5#1811
Merged
larabr merged 3 commits intoopenpgpjs:mainfrom Nov 22, 2024
Conversation
ec72798 to
8138f63
Compare
twiss
reviewed
Nov 21, 2024
8138f63 to
81958b2
Compare
… deprecated `experimentalGCM` should not be used anymore, as a different a different algorithm ID was standardized for GCM, and using the experimental value could give interoperability issues with e.g. SEIPDv2 and AEAD-encrypted keys.
…s that used `experimentalGCM` This adds back support for decrypting password-protected messages which were encrypted in OpenPGP.js v5 with custom config settings `config.aeadProtect = true` together with `config.preferredAEADAlgorithm = openpgp.enums.aead.experimentalGCM`. Public-key-encrypted messages are affected if they were encrypted using the same config, while also providing `encryptionKeys` that declared `experimentalGCM` in their AEAD prefs. Such keys could be generated in OpenPGP.js v5 by setting the aforementioned config values.
81958b2 to
41e952e
Compare
twiss
approved these changes
Nov 22, 2024
The `enums.aead.gcm` ID standardized by RFC9580 should be used instead.
41e952e to
6c3b028
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change affects only keys or messages generated using features marked as "experimental" in OpenPGP.js v5.
Messages and keys encrypted with OpenPGP.js v6 are not affected since there was a bug that prevented using the
experimentalGCMalgo; the bug is also fixed in this MR, to e.g. allow decrypting existing entities.See commits for details.