-
Notifications
You must be signed in to change notification settings - Fork 13
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
Automatic GPG / S/MIME detection #29
Comments
Cool, check whether the following commit works! |
Still the same issue:
|
Is it a testing key file, could you send it to me? (Or could you create a new one that fails the same way and send it) |
I think I know what was the issue. So I have generated a free cert from codegic.com, but it worked fine. The one that does not work, is from GEANT Personal CA 4 (CESNET) and the difference between those two was that the GEANT one has private key at the end of the PEM file while the one from codegic has it at the beginning. I moved the private key to the beginning of the file and now it works. Are you trying to read just the first cert/key the from the file? |
(Interesting! If that works for you, I'll investigate not earlier than in two weeks) |
I was desperately trying to repliate this. Would you help me again, please?
Under the hood, I am sending the file contents to the smime internal method
or that way:
it always works. I need you to try the following lines onto your private file and tell me whether it raises an issue: from M2Crypto import EVP
from pathlib import Path
PATH = "tests/smime/key-cert-together.pem" # your private file
EVP.load_key_string(Path(PATH).read_bytes()) |
For my future reference: def test_fix_29(self):
# Implicit GPG
e = (Envelope(MESSAGE).from_(IDENTITY_2).to(IDENTITY_2)
#.smime()
.signature(key=Path("tests/smime/key-cert-together.pem")))
print(self.check_lines(e, result=True))
print(str(e)) |
When I try this with
sign
being path to S/MIME key+cert:I get
IndexError: list index out of range
because it is trying to use it as GPG (sign = result.fingerprints[0] in _determine_gpg), but when I try this:The email is signed without any issues.
Documentation says:
"Note that if neither gpg nor smime is specified, we try to determine the method automatically."
The text was updated successfully, but these errors were encountered: