Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v6] Add config.parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older #1672

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

larabr
Copy link
Collaborator

@larabr larabr commented Sep 4, 2023

This commit adds the config flag parseAEADEncryptedV4KeysAsLegacy .
When reading private keys which were encrypted by OpenPGP.js v5 (or older) using config.aeadProtect = true and config.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.

@larabr larabr changed the title [v6] Add config.forceParsingAEADEncryptedV4KeyAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older [v6] Add config. parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older Sep 5, 2023
@larabr larabr changed the title [v6] Add config. parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older [v6] Add config.parseAEADEncryptedV4KeysAsLegacy to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older Sep 5, 2023
@larabr larabr requested a review from twiss September 7, 2023 15:32
src/config/config.js Outdated Show resolved Hide resolved
Co-authored-by: Daniel Huigens <d.huigens@protonmail.com>
@larabr larabr merged commit f77da9c into openpgpjs:v6 Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants