[PYTHON-CRYPTO] M2Crypto upgrade problems.

Terry Kerr terry at BIZARSOFTWARE.COM.AU
Wed Jun 2 10:36:18 CEST 2004


I am new to this list, and pretty much an amature with M2Crypto.  We
have a product which used M2Crypto 0.08 with python 2.1.3 for SMIME
encryption of e-mails.  I am investigating the task of upgrading our
product to use python2.3.3 and the latest M2Crypto (0.13).
The product is built on Zope 2.7 with ZServerSSL, and the ZServerSSL
works fine, however, the SMIME encryption part of our product
doesn't...it Seg Faults!

Further investigation shows that demo/smime/test.py also doesn't work,
it also seg faults in the same way.

I am running on debian linux with:
- source install of python 2.3.3
- source install of openssl-0.9.7d
- source install of m2crypto-0.13
- debian package install of 1.3.21-5

The seg fault occurs on the actual s.encrypt(buf) call in test.py in the
encrypt/decrypt test which I have included for your convenience:

def ed():
     print 'test encrypt/decrypt...',
     buf = makebuf()
     s = SMIME.SMIME()

     # Load target cert to encrypt to.
     x509 = X509.load_cert('client.pem')
     sk = X509.X509_Stack()

     # Add a cipher.

     # Encrypt.
     p7 = s.encrypt(buf)

     # Load target's private key.

     # Decrypt.
     data = s.decrypt(p7)

     if data:
         print 'ok'
         print 'not ok'

The unit tests for M2Crypto run without errors.

I am lost for what to try to fix this.  Is something wrong with my
configuration of openssl or python? I am hoping somebody can point me in
the right direction because this is an absolute show stopper as far as
our planned upgrade goes ;-(


More information about the python-crypto mailing list