-
Notifications
You must be signed in to change notification settings - Fork 34
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
Cannot decrypt GnuPG message with "partial continue" structure #43
Comments
Can you please post the message, so that I can trace what it is doing in the code? |
Please pull |
This is the encrypted file, I hope it is helpful. |
Please give the latest master another try. |
@kaie Have the most recent updates fixed this? |
Hello Jason, sorry for the delay. It's not yet working for me, maybe I'm doing something wrong. I get an error: ./cli/OpenPGP decrypt-pka testmail-0227.private passphrase enc.pgp The key pair was generated using: The public key was copied to a different VM, imported into gpg, and a 5 K test message was sent encrypted-only from Thunderbird with Enigmail/GnuPG. Build flags were I built revision 80e5790 from Feb 25. |
File enc.pgp contains just the File testmail-0227.private contains the unmodified private key as generated by the above key generation command. |
Jason, if you point me to your private key, I can send you an equivalent test message. That way you'd be enabled to test it yourself. Thanks. |
You can use the Alicepub key:
|
encrypted-for-tests_testvectors_gpg_Alicepub.txt $ ./cli/OpenPGP decrypt-pka tests/testvectors/gpg/Alicepri test encrypted-for-tests_testvectors_gpg_Alicepub.txt Using this key results in a different error. |
I think I fixed it with 272e079. The main issues were:
Please let me know if you are still having issues. |
Thanks. I confirm the issue is fixed when using the message encrypted for the Alicepub key. However, it still fails to process the message that I had encrypted with the key I had generated. If you're interested to analyze further, feel free to generate a key for yourself with this command, and send me your public key: |
Trim CRLF from user input Added tests Fixed some OpenPGP::Message behavior Compressed data should always be treated as raw, not armored Renamed Packet::read to Packet::actual_read, and wrapped new function in new Packet::read Renamed some tests Added extract_decrypted function into tests to easily extract plaintext message packets
two octet lengths are different depending on version renamed *_octet_lengths functions to read_*_octet_lengths, and added format argument, most of which are not used Added static checks for whether or not packets are allowed to have partial body lengths
Apparently the error reading the key was caused by using the wrong formula to get a 2 octet length. |
Only strip trailing whitespace from ASCII Armored Messages - leading whitespace are errors Remove trailing whitespace in CleartextSignature::read Fixed bug with trim_whitespace using the wrong index when not finding whitespace Removed Partial Packets from TODO list
@kaie Am I able to close this issue? |
Jason, I confirm you've fixed the issue, I'm able to decrypt my test message, thanks a lot! |
I'm trying to decrypt a message with the command line tool, using the decrypt-pka command. It fails inside Message::meaningful. In Message::match p->get_tag() returns 254.
The message was sent using GnuPG. I've built with gpg-debug to enable compatibility.
"OpenPGP show" reports:
Old: Public-Key Encrypted Session Key (Tag 1)
Version: 3
KeyID: ...
Public Key Algorithm: RSA (Encrypt or Sign) (pka 1)
RSA me mod n (3072 bits): ...
Old: Public-Key Encrypted Session Key (Tag 1)
Version: 3
KeyID: ...
Public Key Algorithm: RSA (Encrypt or Sign) (pka 1)
RSA me mod n (4090 bits): ...
New: Symmetrically (Conventional) Encrypted Data (Tag 9) (partial start)
Encrypted Data (2048 octets): ...
Old: (partial end)
...
"pgpdump" reports:
Old: Public-Key Encrypted Session Key Packet(tag 1)(396 bytes)
New version(3)
Key ID - ...
Pub alg - RSA Encrypt or Sign(pub 1)
RSA m^e mod n(3072 bits) - ...
-> m = sym alg(1 byte) + checksum(2 bytes) + PKCS-1 block type 02
Old: Public-Key Encrypted Session Key Packet(tag 1)(524 bytes)
New version(3)
Key ID - ...
Pub alg - RSA Encrypt or Sign(pub 1)
RSA m^e mod n(4090 bits) - ...
-> m = sym alg(1 byte) + checksum(2 bytes) + PKCS-1 block type 02
New: Symmetrically Encrypted Data Packet(tag 9)(2048 bytes) partial start
Encrypted data [sym alg is specified in pub-key encrypted session key]
New: (1024 bytes) partial continue
New: (475 bytes) partial end
The text was updated successfully, but these errors were encountered: