[v6] Add config.parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older#1672
Merged
larabr merged 2 commits intoopenpgpjs:v6from Jan 12, 2024
Conversation
config.forceParsingAEADEncryptedV4KeyAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or olderconfig. parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older
config. parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or olderconfig.parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older
d1f82de to
b91c53d
Compare
76a8511 to
7881b85
Compare
…ed v4 keys from OpenPGP.js v5 or older
b91c53d to
b161987
Compare
1 task
twiss
approved these changes
Jan 12, 2024
Co-authored-by: Daniel Huigens <d.huigens@protonmail.com>
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 commit adds the config flag
parseAEADEncryptedV4KeysAsLegacy.When reading private keys which were encrypted by OpenPGP.js v5 (or older) using
config.aeadProtect = trueandconfig.v5Keys = false, this option must be set, otherwise key parsing and/or key decryption will fail.OpenPGP.js up to v5 used to support encrypting v4 keys using AEAD as specified by draft RFC4880bis (https://www.ietf.org/archive/id/draft-ietf-openpgp-rfc4880bis-10.html#section-5.5.3-3.5).
The config option to do so was not initially marked as "experimental", so there is a risk that some apps have been using it in production.
This legacy format is incompatible, but fundamentally indistinguishable, from that of the crypto-refresh for v4 keys, merged in #1630 . If a key is parsed based on the wrong format, the parsing may still succeed, but key decryption will always fail.
Thus, we rely on the caller to instruct us to process the key as legacy, via the new config flag.