-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
@@ -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))); |
There was a problem hiding this comment.
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
I will try to minimize the diff and then mark this PR as ready. |
c2d9314
to
463548d
Compare
db923cf
to
88d4816
Compare
TODO: Revert once bcgit#1752 is merged
88d4816
to
f68f0d2
Compare
Thanks to @twiss for the test vector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this was merged and immediatelly reverted? Was that a mistake? |
#1768 Implement message decryption using SEIPDv2 and PKESKv6 packets See merge request root/bc-java!25
In main as 58713da |
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 :)