views:

141

answers:

3

M2Crypto provides EC support for ECDSA/ECDH. I have installed OpenSSL 0.9.8i which contains support for EC. However when I run "from M2Crypto import EC,BIO" I get error saying EC_init() failed. So I added debug to print m2.OPENSSL_VERSION_TEXT value. It gets printed as "OpenSSL 0.9.7 19 Feb 2003". This version of OpenSSL doesnot support EC.

I tried "python setup.py build build_ext --openssl="new_path where OpenSSL 0.9.8i is installed". Though M2Crypto is built again "Python setup.py install" , I still see that it points to "Old version of OpenSSL".

Any Pointers on how to successfully get M2Crypto to use 0.9.8i will be useful.

A: 

Possibly its looking up shared libs libssl.so and libcrypto.so and finding the old ones in /usr/lib if you add the new_path to the top of /etc/ld.so.conf so it gets searched first it would work. But this might break other OpenSSL applications expecting old OpenSSL.

cartman
You could also try setting LD_LIBRARY_PATH=/path/to/new/library and is it C_LIBRARY_PATH= while compiling?
joeforker
A: 

Yes I tried with the new_path to /etc/ld.so.conf . Then ran "ldconfig". Its still pointing to older version.

Any suggestions ?

+1  A: 

Some Linux distros, for example Fedora and Redhat, disable EC due to patent concerns.

If you build OpenSSL yourself, there are a few options you may need to specify for build_ext in addition to --openssl: --library-dirs and --include-dirs. See for example the m2crypto Makefile in Chandler. Also the M2Crypto FAQ has an answer for this.

Heikki Toivonen