-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Moving towards 1.1.0 #15
Conversation
* Set the protocol to the default protocol (it doesn't really matter) * Pass the home_dir to gpgme * Give the ability to override the gpg executable
(This is backward compatible with python 2)
for m in emails: | ||
assert m['X-Zeyple'] is not None | ||
payload = self.decrypt(m.get_payload()).strip() | ||
assert payload == six.b(content) |
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.
I think it'd be great to replace assert is_encrypted(...)
with assert self.decrypt(...) == plain_text_content
for all tests now that we have a way to decrypt messages. is_encrypted()
was to make sure the email was actually encrypted but if we could both check that it is encrypted and properly decryptable, it's even better. Thoughts?
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.
Right know, self.decrypt
doesn't play well with non-ascii characters, and I haven't tried to figure it out yet. This is why the test I wrote use ascii characters for now. But yeah, that sounds like the right way to go. I added it to the todolist of this pull request.
This is great @acatton! I left some nitpicking comments on the diff. I'll test your changes on my setup and let you know if everything works fine. |
Just like #2 (comment), plain text emails work fine but multipart emails can't be decrypted. Actual result:
I can decrypt
Expected result using PGP/MIME (expected by Thunderbird at least):
Basically, it looks like you need to wrap everything into a This is just my empirical findings. I haven't dug into the RFCs but I'll to it when I get a chance. |
By forcing binary data, we don't have to worry about encoding. Everything is just bytes.
@acatton I tested your latest commit https://github.com/acatton/zeyple/commit/1720c0249763fb5f90227f477eb230551cc5e4e2 with mixed success. Here are some test-files again: https://www.dropbox.com/sh/awbjoff0naycmv3/AAB3SLvtLbSO_7uGpl81T3hva/2nd?dl=0%3Flst (link is the same as last time). |
@Nithanim this is definitely not mergeable as is then. It supposed to work perfectly. Thank you for the feedback, i'll be fixing that when I have time :) . |
@acatton I don't know how useful it will be but I am trying to build a vagrant box to have a easy-to-setup test environment. It looks good so far. However it currently lacks the enigmail setup and the gpg keys. PS: Got my first external html mail and it was successfully encrypted by zeyple! Exactly like in my simple test. That is so awesome! |
Sorry for the delay @acatton. I tried https://github.com/acatton/zeyple/commit/1720c0249763fb5f90227f477eb230551cc5e4e2 and I'm experiencing the same issue described by @Nithanim. I compared it with properly encrypted plain text emails and if I understand that right, you need to convert the plain text into a MIME payload here - maybe with this or that? In other words,
Hope that makes sense. |
Regarding the 1.1.0 release @acatton:
|
Relevant parts of the RFCs about the encrypted payload: http://tools.ietf.org/html/rfc3156#section-6.1 & http://tools.ietf.org/html/rfc1847#section-2.2
This seems to apply to any /cc @acatton |
Alright, I updated the tests to reflect what is expected by the RFCs in this branch. There is one failing test. If we manage to make it pass without breaking other tests, it should encrypt everything properly 😃 |
I don't use this project, but I'll need to use in the future. And you seem to have a userbase.
This is my ongoing work to move towards 1.1.0.
os.environ
assert is_encrypted(...)
in the tests, useassert self.decrypt(encrypted_content) == content
--homedir
during the testsFix Use setuptools for easy install? #3See my comment on Use setuptools for easy install? #3I don't have a setup with zeyple, can someone test my fixes on their setup?