-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Improve OpenPGP #89
Comments
I remember a discussion back on RainLoop Git. If I recall correctly the keys (so also your private key!) are stored server side. In my case, I'm the server admin so I kind of trust this. But I would not trust anyone else with my private key. Even if I used my own server, I would not trust it if it was a VPS or some other shared service. So if this is currently broken, I would consider this a good candidate to shrink the SnappyMail code :) |
No, private keys are in your browser localStorage (which also sucks). RoundCube: uses gnupg There are only 2 cases where we need private keys:
Public keys is no issue and we can still use for:
Solving the public keys issue would be the first step to solve. |
Plaît-il ? Maybe you receive the message in this form when the user force encryption to a recipient who don't have a public key known or discoverable via WKD? |
Just my two cents: in the RainLoop issue feed, there is a lot of questions about PGP implementation, e.g. the use of WKD to discover keys, the opportunistic encryption, and a few things more. Today, I think it's important to reach a core-base PGP encryption (encrypt, sign, verify) without getting too much pressure about the remaining (trust model, key discover, etc.). As we can see with Thunderbird, since they have dropped the Enigmail support, their implementation is suffering too. |
@GregThib oh yes, i've added OpenPGP.js 5.0.1 for comparison and development. But still, i should look at GnuPG as well |
Working on this issue revealed that RainLoop never correctly verified signed messages. |
Oo |
Now it does not fetch the PGP signature, because validation was broken anyway. Instead it validates multipart/signed according to RFC 3156 section 5 and returns details for the signed part: * BodyPartId * SigPartId * MicAlg So in the future several implementations (GnuPG, OpenPGP.js, etc.) can use the correct data for verification.
This part fetches the required message parts for pgp verification.
Bugfix SnappyMail\PGP\Keyservers Renamed DoPgpVerify to DoMessagePgpVerify
Yep, but as you can see all the commits, there is work in progress :) For now it uses GnuPG to verify PGP messages.
Still todo regarding "verify":
Todo after that:
|
Update: latest changes now properly load keyrings of:
Composer window is revamped and has no PopupsComposeOpenPgp.
SignOnly enabled when chosen identity (from) has a private key. EncryptOnly enabled when all recipients (to, cc, bcc) have a public key. The system is still defunct and does not Sign nor Encrypt yet. |
Impressive! I wanted to congratulate you very much for your work on this tool. I am impressed by the speed and efficiency with which you deal with this problem, and thank you for the attention given to your users. Gratefully! |
@GregThib thank you! Working on this, i noticed many problems that have to be dealt with:
So basically it is a PITA to sign/encrypt properly. Looking at the Enigma source of RoundCube it seems that it also should have issues with it. |
Dropped support for PEAR Crypt_GPG because it is missing features. Also it can't generate ECC keys. So i'm building a new gpg.php class that shall solve it using gnupg and Crypt_GPG as examples. |
Hello ! Note : My English is not very good, sorry for that. I'm having a problem on my docker installation, based on @kouinkouin image ( #44 ). Very simply, I can't decipher the encrypted emails. Whether with OpenPGP or GnuPG, the decryption is done well (I have the message "Message encrypted by OpenPGP" after decryption), but the encrypted message is not replaced in the interface. I note an interesting point, with GnuPG, when I look at the Ajax requests and I launch the decryption, the response contains the decrypted message, but the JSON does not seem correct ( See the screenshots ). Note that I don't know if this is a problem specific to the Docker image, or if the problem also exists in the context of a classic installation. Is this issue known / related to this issue? Thanks in advance ! After click on "Decrypt" button : Reponse of request when use GnuPG ( Response is decrypted, I can read message ) : |
@luluwebmaster Who encrypted the message? Looking at it, it is quoted-printable encoded HTML and that is wrong. There are 2 types of PGP encryption:
|
The message received has been encrypted by Thunderbird. Could this be a problem with Thunderbird ? |
Force Thunderbird to use PGP/MIME and try again |
Does that mean that all my correspondents must activate this option .. ? It's not possible to "fix" this on Snappy interface ? |
If we make a workaround, how would other people with different applications see the broken Thunderbird?
|
Ok, not problem, I wait your feedback ! |
Hello, After update of docker image ( 2.26.1 ), now that works correctly ! Thank you. |
@the-djmaze FWIW, I seem to have the same problem that @luluwebmaster was describing. But the message was encrypted using mailvalope instead of thunderbird. |
Describe the bug
The RainLoop OpenPGP implementation is incorrect.
Some limitations are caused by the current implementation in JavaScript.
Either the whole message body should be rendered as-is in JavaScript or handled in PHP with https://php.net/gnupg or others.
Reported issues at RainLoop:
https://github.com/RainLoop/rainloop-webmail/issues?q=is%3Aissue+is%3Aopen+pgp
I made a Wiki page that explains the rules.
https://github.com/the-djmaze/snappymail/wiki/OpenPGP
TODO:
Keys
Import public/private keys
Note: as of v2.34 you can search public key servers to find them, and import all keys from server into OpenPGP.js
View public/private keys
Delete public/private keys
Allow private keys without password
Decrypt / Sign when multiple keys exist
Received messages
PGP/Inline (cleartext)
Decrypt
Verify signature
Decrypt then verify signature
PGP/MIME (multipart)
Decrypt
Verify signature
Decrypt then verify signature
Sending messages
PGP/Inline (cleartext)
❌ no, everything is PGP/MIME
PGP/MIME (multipart)
Encrypt message text
Encrypt attachments
Sign
Sign then Encrypt
Autocrypt
As requested in issue #342 for https://autocrypt.org/
NOTE
Although we properly support PGP/MIME
I've discovered some systems don't, including Mailvelope:
roundcube/roundcubemail#8417 (comment)
Also there's the crypto refresh https://datatracker.ietf.org/doc/draft-ietf-openpgp-crypto-refresh/
And see https://fosdem.org/2024/schedule/event/fosdem-2024-2669--security-modernizing-email-encryption-the-crypto-refresh-of-openpgp/
The text was updated successfully, but these errors were encountered: