8000 [v6] Add `config.parseAEADEncryptedV4KeysAsLegacy ` to support AEAD-encrypted v4 keys from OpenPGP.js v5 or older by larabr · Pull Request #1672 · openpgpjs/openpgpjs · GitHub
[go: up one dir, main page]

Skip to content

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
@larabr larabr force-pushed the support-legacy-v4-key-aead branch from d1f82de to b91c53d Compare September 11, 2023 16:45
@larabr larabr force-pushed the v6 branch 3 times, most recently from 76a8511 to 7881b85 Compare October 25, 2023 10:56
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.

2 participants
0