473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

M2Crypto 0.18 - new version, same old build bugs.

Back in March, I posted this:
Hit that with OpenSSL. Red Hat took elliptical curve cryptography
out of Fedora 6 for patent reasons. With that missing, M2Crypto won't
build. It ought to; the implementor of M2Crypto thought of that, because
it's an optional feature. But M2Crypto uses SWIG. SWIG doesn't normally
process nested include files. OpenSSL had changed their configuration
approach to use nested include files. So SWIG didn't see the #define that
said to turn off elliptical curve crypto support. This resulted in
compile errors in the 24,000 lines of code that come out of SWIG.
That was for M2Crypto 0.17.

It's still broken in M2Crypto 0.18.

And there's no RPM or Windows binary.

Nobody actually uses this stuff, do they?

John Nagle
Sep 20 '07 #1
7 4220
On 20 Sep, 22:12, John Nagle <na...@animats.comwrote:
>
That was for M2Crypto 0.17.

It's still broken in M2Crypto 0.18.

And there's no RPM or Windows binary.

Nobody actually uses this stuff, do they?
I can find Ubuntu packages for 0.16 and 0.17:

http://packages.ubuntu.com/feisty/libs/python-m2crypto
http://packages.ubuntu.com/gutsy/libs/python-m2crypto

So, clearly some people are managing to build the library, even if it
isn't the absolute latest version. You might want to take a look at
the source packages and the patches the distribution people apply,
although it doesn't look like they are actually doing much patching.
The source packages suggest that they use SWIG 1.3.24 to build
M2Crypto - is that what you're using?

Paul

Sep 20 '07 #2
Paul Boddie wrote:
On 20 Sep, 22:12, John Nagle <na...@animats.comwrote:
> That was for M2Crypto 0.17.

It's still broken in M2Crypto 0.18.

And there's no RPM or Windows binary.

Nobody actually uses this stuff, do they?


I can find Ubuntu packages for 0.16 and 0.17:

http://packages.ubuntu.com/feisty/libs/python-m2crypto
http://packages.ubuntu.com/gutsy/libs/python-m2crypto

So, clearly some people are managing to build the library, even if it
isn't the absolute latest version. You might want to take a look at
the source packages and the patches the distribution people apply,
although it doesn't look like they are actually doing much patching.
The source packages suggest that they use SWIG 1.3.24 to build
M2Crypto - is that what you're using?

Paul
I have builds of 0.17 of M2Crypto for both Linux and Windows. I want
the new bug fixes. The 0.17 version mishandles SSL certs that specify
more than one domain name, and that's supposedly fixed in 0.18. But
there are enough changes that just copying over the relevant file
(Checker.py) isn't sufficient.

John Nagle
Sep 21 '07 #3
John Nagle wrote:
Back in March, I posted this:
> Hit that with OpenSSL. Red Hat took elliptical curve cryptography
out of Fedora 6 for patent reasons. With that missing, M2Crypto won't
build. It ought to; the implementor of M2Crypto thought of that, because
it's an optional feature. But M2Crypto uses SWIG. SWIG doesn't normally
process nested include files. OpenSSL had changed their configuration
approach to use nested include files. So SWIG didn't see the #define
that
said to turn off elliptical curve crypto support. This resulted in
compile errors in the 24,000 lines of code that come out of SWIG.

That was for M2Crypto 0.17.

It's still broken in M2Crypto 0.18.
This was reported as
https://bugzilla.osafoundation.org/show_bug.cgi?id=9404 and fixed, at
least according to the person who reported the bug. I'd be curious to
know why the fix does not work for you...

As an alternative, does it work if you add line 130 to setup.py:

'-DOPENSSL_NO_EC', # Uncomment if you have
trouble compiling without EC support

--
Heikki Toivonen
Sep 21 '07 #4
Heikki Toivonen wrote:
John Nagle wrote:
>>Back in March, I posted this:

>> Hit that with OpenSSL. Red Hat took elliptical curve cryptography
out of Fedora 6 for patent reasons. With that missing, M2Crypto won't
build. It ought to; the implementor of M2Crypto thought of that, because
it's an optional feature. But M2Crypto uses SWIG. SWIG doesn't normally
process nested include files. OpenSSL had changed their configuration
approach to use nested include files. So SWIG didn't see the #define
that
said to turn off elliptical curve crypto support. This resulted in
compile errors in the 24,000 lines of code that come out of SWIG.

That was for M2Crypto 0.17.

It's still broken in M2Crypto 0.18.


This was reported as
https://bugzilla.osafoundation.org/show_bug.cgi?id=9404 and fixed, at
least according to the person who reported the bug. I'd be curious to
know why the fix does not work for you...

As an alternative, does it work if you add line 130 to setup.py:

'-DOPENSSL_NO_EC', # Uncomment if you have
trouble compiling without EC support
OK, here's the build failing:

python setup.py build
running build
running build_py
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/local/include/python2.5 -I/usr/include -o
SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/openssl/opensslconf.h:27: Error: CPP #error ""This openssl-devel
package does not work your architecture?"". Use the -cpperraswarn option to
continue swig processing.
error: command 'swig' failed with exit status 1

OK, let's check the requirements, from
http://chandlerproject.org/bin/view/...ts/MeTooCrypto
M2Crypto 0.18:
* Python 2.3 or newer
o m2urllib2 requires Python 2.4 or newer
* OpenSSL 0.9.7 or newer
o Some optional new features will require OpenSSL 0.9.8 or newer
* SWIG 1.3.24 or newer

python --version
Python 2.5 [OK here, 2.5 >= 2.4]

swig -version
SWIG Version 1.3.31 [OK here; 1.3.31 >= 1.3.24]
Compiled with i386-redhat-linux-g++ [i386-redhat-linux-gnu]

openssl
OpenSSLversion
OpenSSL 0.9.8a 11 Oct 2005 [OK here; 0.9.8a =0.9.7.]

Tried the suggested patch to "setup.py":
diff setup.py.orig setup.py
130c130
< #'-D__i386__', # Uncomment for early OpenSSL
0.9.7 versions
---
'-D__i386__', # Uncomment for early OpenSSL
0.9.7 versions

No change in error message. That gets us

-bash-3.1$ python setup.py build
running build
running build_py
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/local/include/python2.5 -I/usr/include -o
SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/openssl/opensslconf.h:27: Error: CPP #error ""This openssl-devel
package does not work your architecture?"". Use the -cpperraswarn option to
continue swig processing.
error: command 'swig' failed with exit status 1

But notice that the -D entry didn't appear on the SWIG command line.
Neither did the "-includeall". The "swig_opts" values around line
129 aren't actually being used. I think that's left over from the code intended
to allow builds with Python 2.3 and earlier. The "self.swig_opts" up at
line 53 of "setup.py" seems to be controlling. The patch was to
the obsolete code.

This is on Fedora Core 5, x86, 32 bit.

John Nagle

Sep 24 '07 #5
John Nagle wrote:
But notice that the -D entry didn't appear on the SWIG command line.
Neither did the "-includeall". The "swig_opts" values around line
129 aren't actually being used. I think that's left over from the code
intended
to allow builds with Python 2.3 and earlier. The "self.swig_opts" up at
line 53 of "setup.py" seems to be controlling. The patch was to
the obsolete code.
Aha! Good find. I reopened
https://bugzilla.osafoundation.org/show_bug.cgi?id=9404 and attached a
patch that should address this for real this time. At least -includeall
appears in my Ubuntu Dapper Drake environment. Could you give it a go
and let me know how it works?

--
Heikki Toivonen
Sep 25 '07 #6
Heikki Toivonen wrote:
John Nagle wrote:
>>But notice that the -D entry didn't appear on the SWIG command line.
Neither did the "-includeall". The "swig_opts" values around line
129 aren't actually being used. I think that's left over from the code
intended
to allow builds with Python 2.3 and earlier. The "self.swig_opts" up at
line 53 of "setup.py" seems to be controlling. The patch was to
the obsolete code.


Aha! Good find. I reopened
https://bugzilla.osafoundation.org/show_bug.cgi?id=9404 and attached a
patch that should address this for real this time. At least -includeall
appears in my Ubuntu Dapper Drake environment. Could you give it a go
and let me know how it works?
That's progress, but the build still doesn't work:

$ python setup.py build
running build
running build_py
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/local/include/python2.5 -I/usr/include -includeall
-D__i386__ -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/openssl/opensslconf.h:13: Error: Unable to find 'opensslconf-i386.h'
error: command 'swig' failed with exit status 1

Now that SWIG is being invoked with "-includeall", it has to have
all the include paths defined. (Without "includeall", includes
are deferred until the C compile stage.) Note that the SWIG command line
specifies "/usr/include", but not "/usr/include/openssl".
Within M2Crypto's SWIG files, there's

_ec.i:%include <openssl/opensslconf.h>

which brings in "opensslconf.h" from /usr/include/openssl.
But that file has

#if defined(__i386__)
#include "opensslconf-i386.h"
#elif defined(__ia64__)
....

Since "opensslconf-i386.h" lives in /usr/include/openssl,
and that directory isn't mentioned on the SWIG command line,
the #include of "opensslconf-i386.h" fails.

And, no, adding

self.swig_opts.append('-DOPENSSL_NO_EC')
# Uncomment if you can't build with EC disabled

does not help.

As a test, I tried adding "-I/usr/include/openssl" to the SWIG command
line. Building then gets further, but during a C compile, we get

SWIG/_m2crypto_wrap.c:2529:18: error: _lib.h: No such file or directory

and the build goes downhill from there, with many compile errors in the
GCC phase. The gcc call

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -I/usr/local/include/python2.5 -c SWIG/_m2crypto_wrap.c -o
build/temp.linux-i686-2.5/SWIG/_m2crypto_wrap.o -DTHREADING

is in the directory below SWIG, and doesn't include SWIG, so it's clear
why gcc couldn't find the file.

So those fixes were not enough. Include file management in the M2Crypto build
clearly needs some work.

John Nagle
Sep 25 '07 #7
John Nagle wrote:
Heikki Toivonen wrote:
That's progress, but the build still doesn't work:
....
during a C compile, we get

SWIG/_m2crypto_wrap.c:2529:18: error: _lib.h: No such file or directory

and the build goes downhill from there, with many compile errors in the
GCC phase. The gcc call

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.5 -c SWIG/_m2crypto_wrap.c -o build/temp.linux-i686-2.5/SWIG/_m2crypto_wrap.o -DTHREADING

is in the directory below SWIG, and doesn't include SWIG, so it's clear
why gcc couldn't find the file.

Any sign of a fix yet?

John Nagle
Oct 3 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Carl Waldbieser | last post by:
I tried to adapt the instructions for building the M2Crypto module (http://sandbox.rulemaker.net/ngps/m2/INSTALL.html) to build a version compatible with Python2.3, but I've had some mixed results....
8
by: Sean | last post by:
System is Redhat 9.0, Python 2.2.3, Zope 2.6.2 built OpenSSL from source: 2791797 Sep 30 14:50:15 2003 openssl-0.9.7c.tar.gz used configure options to set for /usr/local and...
5
by: jsmilan | last post by:
Hi, all; I'm strictly an amateur developer who has dabbled in a half dozen languages on eight or nine systems over 20 years or so. I have never devoted the time or energy to thoroughly learn...
0
by: Thomas G. Apostolou | last post by:
Hello all. i am trying to make some win32 binaries of M2Crypto 0.15 What I use is: Python 2.3.3 openssl-0.9.7i swigwin 1.3.27
8
by: John Nagle | last post by:
Here's a wierd problem: I have a little test case for M2Crypto, which just opens up SSL connections to web servers and reads their certificates. This works fine. But if I execute ...
2
by: John Nagle | last post by:
A list of small problems and bugs in the current M2Crypto: I need to look at SSL certificates in some detail, so this is all about the access functions for certificates. Bugs: 1. Off by one...
8
by: John Nagle | last post by:
I've been running M2Crypto successfully using Python 2.4 on Windows 2000, and now I'm trying to get it to work on Python 2.3.4 on Linux. Attempting to initialize a context results in Traceback...
2
by: John Nagle | last post by:
Trying to build M2Crypto on a dedicated server running Red Hat Fedora Core 6. I'm trying to do this right, without manual patching. The error message I'm getting during build is: python...
0
by: Heikki Toivonen | last post by:
The 0.19.1 release fixes the build when OpenSSL has been configured without EC support, thanks to Miloslav Trmac. M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.