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

Fix LibrePGP OCBEncryptedData packet decryption using SKESKv5 and PKESKv3 #1809

Closed
wants to merge 9 commits into from

Conversation

vanitasvitae
Copy link
Contributor

@vanitasvitae vanitasvitae commented Sep 2, 2024

This PR incorporates and obsoletes #1793 and #1795

Decryption of symmetrically encrypted LibrePGP messages which make used of AEAD (SKESKv5 and OCBEDv1) was failing due to erroneous parsing of the SKESKv5 packet (which does omit some counter octets introduced in v6), plus decryption of the session key from the SKESKv5 packet omits a HKDF step also introduced with v6.

Decryption of asymmetrically encrypted LibrePGP messages using AEAD (PKESKv3 and OCBEDv1 using an ECDH (legacy X25519) was also failing (which took me 3 days or so to get to the bottom of the bug), because it turns out that during the ECDH handshake, the "UserKeyingMaterial" which contains the fingerprint of the recipient key would only get updated with 20 of the 32 fingerprint octets of a v5 key (https://www.ietf.org/archive/id/draft-koch-librepgp-01.html#section-13.5-4.5).

These issues have been fixed and are now covered by test cases.

@vanitasvitae
Copy link
Contributor Author

In main as c005424

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.

1 participant