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

Implement message decryption using SEIPDv2 and PKESKv6 packets #1768

Merged
merged 14 commits into from
Sep 11, 2024

Conversation

vanitasvitae
Copy link
Contributor

@vanitasvitae vanitasvitae commented Aug 6, 2024

This PR fixes decryption of messages which make use of version 6 Public-Key-Encrypted-Session-Key packets (PKESKv6) and version 2 Symmetrically-Encrypted-Integrity-Protected-Data packets (SEIPDv2).

Such packets are used for OpenPGP v6 style message encryption using AEAD.

This PR is currently based on #1752.

Debugging the decryption was a bit messy, so expect some more cleanup :)

@vanitasvitae vanitasvitae marked this pull request as draft August 6, 2024 14:31
@@ -68,7 +68,7 @@ static X9ECParameters getX9Parameters(ASN1ObjectIdentifier curveOID)
static HybridValueParameterSpec getHybridValueParameterSpecWithPrepend(byte[] ephmeralPublicKey, PublicKeyPacket pkp, String algorithmName)
throws IOException
{
return new HybridValueParameterSpec(Arrays.concatenate(ephmeralPublicKey, pkp.getEncoded()), true, new UserKeyingMaterialSpec(Strings.toByteArray("OpenPGP " + algorithmName)));
return new HybridValueParameterSpec(Arrays.concatenate(ephmeralPublicKey, pkp.getKey().getEncoded()), true, new UserKeyingMaterialSpec(Strings.toByteArray("OpenPGP " + algorithmName)));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finding this bugger was a pain! :D

@vanitasvitae
Copy link
Contributor Author

I will try to minimize the diff and then mark this PR as ready.

@vanitasvitae vanitasvitae force-pushed the decryptionv6 branch 4 times, most recently from c2d9314 to 463548d Compare August 7, 2024 13:38
@vanitasvitae vanitasvitae marked this pull request as ready for review August 7, 2024 14:25
Copy link

@D4954484 D4954484 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#39

hubot pushed a commit that referenced this pull request Sep 11, 2024
@hubot hubot merged commit 1232b9f into bcgit:main Sep 11, 2024
@vanitasvitae
Copy link
Contributor Author

Apparently this was merged and immediatelly reverted? Was that a mistake?

hubot pushed a commit that referenced this pull request Sep 13, 2024
#1768 Implement message decryption using SEIPDv2 and PKESKv6 packets

See merge request root/bc-java!25
@vanitasvitae
Copy link
Contributor Author

In main as 58713da

@vanitasvitae vanitasvitae deleted the decryptionv6 branch September 17, 2024 12:59
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.

3 participants