[PYTHON-CRYPTO] m2crypto-0.13 problem
G Dang
gdang1 at GMAIL.COM
Tue Dec 7 21:33:12 CET 2004
Hi,
Don't know if you've resolved your issue yet...
I've ran into a similar problem, with the SMIME.smime_load_pkcs* routimes.
Drove me nuts for awhile. The problem was within the OpenSSL code, but
the darn SystemError wasn't being very helpful. A simple patch for the
2 routines:
-p7_ptr, bio_ptr = m2.smime_read_pkcs7(bio)
+try:
+ p7_ptr = None
+ bio_ptr = None
+ p7_ptr, bio_ptr = m2.smime_read_pkcs7(bio) # or (p7_bio.ptr())
+except SystemError, e:
+ pass
will let the Err.get_error() handler does its job in backtracking where
the problem could be. In my case, it turns out to be somewhere in the
OpenSSL \crypto\pkcs7 modules -- someone merged broken codes into the
ver 97d. I had to go through the change logs and CVS to grab back
revision I needed.
BTW, your .eml file still generated errors, something to do with the
base64 decoding, the SMIME_read_PKCS7 calls tries to read and return
a BIO, along the the P7 pointer. The SMIME.smime_load_pkcs() call
did not return a BIO (None). Your encoded message could be bad? (or
outstanding issue with OpenSSL?)
GD
More information about the python-crypto
mailing list