Cuckoo: Failling to downgrade m2crypto

Created on 14 Jan 2019  Â·  6Comments  Â·  Source: cuckoosandbox/cuckoo

Hello everyone!

Issue

I'm getting the error '_Failed to run the processing module "Static"_' in Cuckoo's log. After reading some information, it looks like this issue is solved by downgrading the m2crypto lib to 0.24.0. Currently I have installed the last version (0.31.0). I have already installed SWIG. When I try to downgrade the M2Crypto lib I get an error related to x86_64-linux-gnu-gcc. I've search about the _error: command 'x86_64-linux-gnu-gcc' failed with exit status 1_ error but no answer seems to work properlly. Do you know how can I solve this issue? Anyone has faced the same issue? BTW, I'm using Cuckoo 2.0.6.

Here are the logs if you need to check them. I would really preciated you support. If could please give me any clue on how to solve it?

Thank you very much for your time!!

Kind regards :)

Logs

root@cuckoo:/home/user/# pip install M2Crypto==0.24.0
Collecting M2Crypto==0.24.0
Using cached https://files.pythonhosted.org/packages/58/75/362faac80a1bc2742b4b696dc350518312043d568bfd2687a9270f18da88/M2Crypto-0.24.0.tar.gz
Building wheels for collected packages: M2Crypto
Running setup.py bdist_wheel for M2Crypto ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9SEnI_/M2Crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-Cupp2t --python-tag cp27:
running bdist_wheel
running build
running build_py
copying M2Crypto/BIO.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/Engine.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/BN.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/DH.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/AuthCookie.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/ftpslib.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/EC.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/EVP.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/util.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/ASN1.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/httpslib.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/Err.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/X509.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/Rand.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2urllib2.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/DSA.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/threading.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/callback.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/RSA.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2xmlrpclib.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/__init__.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/SMIME.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/RC4.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2urllib.py -> build/lib.linux-x86_64-2.7/M2Crypto
creating build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/cb.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Session.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/SSLServer.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/TwistedProtocolWrapper.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/timeout.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Cipher.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Context.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/ssl_dispatcher.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Checker.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Connection.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/__init__.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
creating build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/constants.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKey.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKeyRing.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/RSA.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/__init__.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/packet.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -D__x86_64__ -I/usr/include/python2.7 -I/usr/include -I/usr/include/x86_64-linux-gnu -includeall -modern -builtin -outdir build/lib.linux-x86_64-2.7/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/sys/cdefs.h:159: Warning 305: Bad constant value (ignored).
/usr/include/bits/wchar.h:38: Warning 490: Fragment 'SWIG_From_wchar_t' not found.
/usr/include/stdint.h:274: Warning 490: Fragment 'SWIG_From_wchar_t' not found.
SWIG/_bio.i:64: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_rand.i:21: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_evp.i:169: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_dh.i:36: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_rsa.i:43: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_dsa.i:31: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_ssl.i:241: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_ssl.i:242: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_x509.i:323: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_pkcs7.i:44: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_pkcs7.i:44: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_util.i:11: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_ec.i:111: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_engine.i:168: Warning 454: Setting a pointer/reference variable may leak memory.
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/SWIG
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -I/usr/include -I/usr/include/x86_64-linux-gnu -I/tmp/pip-install-9SEnI_/M2Crypto/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.linux-x86_64-2.7/SWIG/_m2crypto_wrap.o -DTHREADING
SWIG/_m2crypto_wrap.c:3992:35: error: ‘CRYPTO_NUM_LOCKS’ undeclared here (not in a function)
static PyThread_type_lock lock_cs[CRYPTO_NUM_LOCKS];
^~~~
SWIG/_m2crypto_wrap.c: In function ‘lib_init’:
SWIG/_m2crypto_wrap.c:4373:5: warning: implicit declaration of function ‘SSLeay_add_all_algorithms’ [-Wimplicit-function-declaration]
SSLeay_add_all_algorithms();
^~~~~~~
SWIG/_m2crypto_wrap.c: In function ‘bn_rand’:
SWIG/_m2crypto_wrap.c:4775:12: error: storage size of ‘rnd’ isn’t known
BIGNUM rnd;
^

SWIG/_m2crypto_wrap.c:4779:5: warning: implicit declaration of function ‘BN_init’ [-Wimplicit-function-declaration]
BN_init(&rnd);
^~~
SWIG/_m2crypto_wrap.c:4775:12: warning: unused variable ‘rnd’ [-Wunused-variable]
BIGNUM rnd;
^~~
SWIG/_m2crypto_wrap.c: In function ‘bn_rand_range’:
SWIG/_m2crypto_wrap.c:4804:12: error: storage size of ‘rnd’ isn’t known
BIGNUM rnd;
^~~
SWIG/_m2crypto_wrap.c:4804:12: warning: unused variable ‘rnd’ [-Wunused-variable]
SWIG/_m2crypto_wrap.c: In function ‘rand_pseudo_bytes’:
SWIG/_m2crypto_wrap.c:4935:5: warning: ‘RAND_pseudo_bytes’ is deprecated [-Wdeprecated-declarations]
ret = RAND_pseudo_bytes(blob, n);
^~~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/rand.h:47:1: note: declared here
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char buf, int num))
^
SWIG/_m2crypto_wrap.c: In function ‘digest_final’:
SWIG/_m2crypto_wrap.c:5053:34: error: dereferencing pointer to incomplete type ‘EVP_MD_CTX {aka struct evp_md_ctx_st}’
if (!(blob = PyMem_Malloc(ctx->digest->md_size))) {
^~
SWIG/_m2crypto_wrap.c: In function ‘hmac_ctx_new’:
SWIG/_m2crypto_wrap.c:5070:49: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
if (!(ctx = (HMAC_CTX *)PyMem_Malloc(sizeof(HMAC_CTX)))) {
^~~~
SWIG/_m2crypto_wrap.c:5074:5: warning: implicit declaration of function ‘HMAC_CTX_init’ [-Wimplicit-function-declaration]
HMAC_CTX_init(ctx);
^~~~~
SWIG/_m2crypto_wrap.c: In function ‘hmac_ctx_free’:
SWIG/_m2crypto_wrap.c:5079:5: warning: implicit declaration of function ‘HMAC_CTX_cleanup’ [-Wimplicit-function-declaration]
HMAC_CTX_cleanup(ctx);
^~~~
SWIG/_m2crypto_wrap.c: In function ‘hmac_init’:
SWIG/_m2crypto_wrap.c:5090:5: warning: ‘HMAC_Init’ is deprecated [-Wdeprecated-declarations]
if (!HMAC_Init(ctx, kbuf, klen, md)) {
^~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/hmac.h:28:1: note: declared here
DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
^
SWIG/_m2crypto_wrap.c: In function ‘hmac_final’:
SWIG/_m2crypto_wrap.c:5118:34: error: dereferencing pointer to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
if (!(blob = PyMem_Malloc(ctx->md->md_size))) {
^~
SWIG/_m2crypto_wrap.c: In function ‘cipher_ctx_new’:
SWIG/_m2crypto_wrap.c:5157:55: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
if (!(ctx = (EVP_CIPHER_CTX *)PyMem_Malloc(sizeof(EVP_CIPHER_CTX)))) {
^~~~
SWIG/_m2crypto_wrap.c: In function ‘cipher_final’:
SWIG/_m2crypto_wrap.c:5238:34: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
if (!(obuf = PyMem_Malloc(ctx->cipher->block_size))) {
^~
SWIG/_m2crypto_wrap.c: In function ‘pkey_get_modulus’:
SWIG/_m2crypto_wrap.c:5386:17: error: dereferencing pointer to incomplete type ‘EVP_PKEY {aka struct evp_pkey_st}’
switch (pkey->type) {
^~
SWIG/_m2crypto_wrap.c:5397:35: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’
if (!BN_print(bio, rsa->n)) {
^~
SWIG/_m2crypto_wrap.c:5422:35: error: dereferencing pointer to incomplete type ‘DSA {aka struct dsa_st}’
if (!BN_print(bio, dsa->pub_key)) {
^~
SWIG/_m2crypto_wrap.c: In function ‘dh_generate_parameters’:
SWIG/_m2crypto_wrap.c:5619:5: warning: ‘DH_generate_parameters’ is deprecated [-Wdeprecated-declarations]
dh = DH_generate_parameters(plen, g, gendh_callback, (void *)pyfunc);
^~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/dh.h:135:1: note: declared here
DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator,
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_p’:
SWIG/_m2crypto_wrap.c:5665:12: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
if (!dh->p) {
^~
SWIG/_m2crypto_wrap.c: In function ‘rsa_generate_key’:
SWIG/_m2crypto_wrap.c:6123:5: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
rsa = RSA_generate_key(bits, e, genrsa_callback, (void *)pyfunc);
^

In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/rsa.h:193:1: note: declared here
DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:6152:29: error: dereferencing pointer to incomplete type ‘DSA_SIG {aka struct DSA_SIG_st}’
return bn_to_mpi(dsa_sig->r);
^~
SWIG/_m2crypto_wrap.c: In function ‘dsa_generate_parameters’:
SWIG/_m2crypto_wrap.c:6182:5: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
dsa = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, genparam_callback, (void *)pyfunc);
^~~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/dsa.h:122:1: note: declared here
DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
^
SWIG/_m2crypto_wrap.c: In function ‘sk_ssl_cipher_value’:
SWIG/_m2crypto_wrap.c:7088:12: warning: return discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
return sk_SSL_CIPHER_value(stack, idx);
^~~~~~~
SWIG/_m2crypto_wrap.c: In function ‘x509_name_get_der’:
SWIG/_m2crypto_wrap.c:7267:43: error: dereferencing pointer to incomplete type ‘X509_NAME {aka struct X509_name_st}’
return PyString_FromStringAndSize(name->bytes->data, name->bytes->length);
^~
SWIG/_m2crypto_wrap.c: At top level:
SWIG/_m2crypto_wrap.c:7327:2: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
*x509v3_lhash() {
^~~~
SWIG/_m2crypto_wrap.c: In function ‘x509v3_lhash’:
SWIG/_m2crypto_wrap.c:7328:12: warning: return from incompatible pointer type [-Wincompatible-pointer-types]
return lh_new(NULL, NULL); /
Should probably be lh_CONF_VALUE_new but won't compile. /
^~
SWIG/_m2crypto_wrap.c: In function ‘make_stack_from_der_sequence’:
SWIG/_m2crypto_wrap.c:7444:13: warning: implicit declaration of function ‘ASN1_seq_unpack_X509’ [-Wimplicit-function-declaration]
certs = ASN1_seq_unpack_X509((unsigned char *)encoded_string, encoded_string_len, d2i_X509, X509_free );
^~~~~~
SWIG/_m2crypto_wrap.c:7444:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
certs = ASN1_seq_unpack_X509((unsigned char *)encoded_string, encoded_string_len, d2i_X509, X509_free );
^
SWIG/_m2crypto_wrap.c: In function ‘get_der_encoding_stack’:
SWIG/_m2crypto_wrap.c:7460:16: warning: implicit declaration of function ‘ASN1_seq_pack_X509’ [-Wimplicit-function-declaration]
encoding = ASN1_seq_pack_X509(stack, i2d_X509, NULL, &len);
^
~~~
SWIG/_m2crypto_wrap.c:7460:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
encoding = ASN1_seq_pack_X509(stack, i2d_X509, NULL, &len);
^
SWIG/_m2crypto_wrap.c: In function ‘ecdsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:7990:31: error: dereferencing pointer to incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
return bn_to_mpi(ecdsa_sig->r);
^~
SWIG/_m2crypto_wrap.c: In function ‘_wrap_sslv2_method’:
SWIG/_m2crypto_wrap.c:18027:26: warning: implicit declaration of function ‘SSLv2_method’ [-Wimplicit-function-declaration]
result = (SSL_METHOD *)SSLv2_method();
^~~~
SWIG/_m2crypto_wrap.c:18027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
result = (SSL_METHOD *)SSLv2_method();
^
SWIG/_m2crypto_wrap.c: In function ‘_wrap_tlsv1_method’:
SWIG/_m2crypto_wrap.c:18053:3: warning: ‘TLSv1_method’ is deprecated [-Wdeprecated-declarations]
result = (SSL_METHOD *)TLSv1_method();
^~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/ssl.h:1627:1: note: declared here
DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /
TLSv1.0 /
^
SWIG/_m2crypto_wrap.c: In function ‘_wrap_c2i_asn1_object’:
SWIG/_m2crypto_wrap.c:25487:27: warning: implicit declaration of function ‘c2i_ASN1_OBJECT’ [-Wimplicit-function-declaration]
result = (ASN1_OBJECT *)c2i_ASN1_OBJECT(arg1,(unsigned char const *
)arg2,arg3);
^~~~~
SWIG/_m2crypto_wrap.c:25487:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
result = (ASN1_OBJECT )c2i_ASN1_OBJECT(arg1,(unsigned char const *)arg2,arg3);
^
SWIG/_m2crypto_wrap.c: In function ‘init__m2crypto’:
SWIG/_m2crypto_wrap.c:31091:79: warning: implicit declaration of function ‘SWIG_From_wchar_t’ [-Wimplicit-function-declaration]
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
~~~~
SWIG/_m2crypto_wrap.c:31091:119: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31091:120: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31091:79: warning: passing argument 4 of ‘SWIG_Python_SetConstant’ makes pointer from integer without a cast [-Wint-conversion]
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
~~~~
SWIG/_m2crypto_wrap.c:1236:1: note: expected ‘PyObject * {aka struct _object *}’ but argument is of type ‘int’
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
^
~~~~
SWIG/_m2crypto_wrap.c:31092:113: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31092:114: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31140:111: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31140:112: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31141:117: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31141:118: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31141:77: warning: passing argument 4 of ‘SWIG_Python_SetConstant’ makes pointer from integer without a cast [-Wint-conversion]
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^~~~~
SWIG/_m2crypto_wrap.c:1236:1: note: expected ‘PyObject * {aka struct _object *}’ but argument is of type ‘int’
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
^~~~~~~
SWIG/_m2crypto_wrap.c:31198:112: error: ‘SSL_ST_INIT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_RENEGOTIATE",SWIG_From_int((int)((0x04|SSL_ST_INIT))));
^~~
SWIG/_m2crypto_wrap.c:31198:112: note: each undeclared identifier is reported only once for each function it appears in
SWIG/_m2crypto_wrap.c: In function ‘dh_get_p’:
SWIG/_m2crypto_wrap.c:5670:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_g’:
SWIG/_m2crypto_wrap.c:5678:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_pub’:
SWIG/_m2crypto_wrap.c:5686:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_priv’:
SWIG/_m2crypto_wrap.c:5694:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘rsa_get_e’:
SWIG/_m2crypto_wrap.c:5803:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘rsa_get_n’:
SWIG/_m2crypto_wrap.c:5811:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘rsa_check_pub_key’:
SWIG/_m2crypto_wrap.c:6138:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:6153:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_sig_get_s’:
SWIG/_m2crypto_wrap.c:6157:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_p’:
SWIG/_m2crypto_wrap.c:6195:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_q’:
SWIG/_m2crypto_wrap.c:6203:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_g’:
SWIG/_m2crypto_wrap.c:6211:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_pub’:
SWIG/_m2crypto_wrap.c:6219:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_priv’:
SWIG/_m2crypto_wrap.c:6227:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_check_key’:
SWIG/_m2crypto_wrap.c:6474:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_check_pub_key’:
SWIG/_m2crypto_wrap.c:6478:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_keylen’:
SWIG/_m2crypto_wrap.c:6482:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘x509_name_get_der’:
SWIG/_m2crypto_wrap.c:7268:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘ecdsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:7991:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘ecdsa_sig_get_s’:
SWIG/_m2crypto_wrap.c:7995:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
At top level:
SWIG/_m2crypto_wrap.c:3993:13: warning: ‘lock_count’ defined but not used [-Wunused-variable]
static long lock_count[CRYPTO_NUM_LOCKS];
^~~~
SWIG/_m2crypto_wrap.c:3992:27: warning: ‘lock_cs’ defined but not used [-Wunused-variable]
static PyThread_type_lock lock_cs[CRYPTO_NUM_LOCKS];
^
~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


Failed building wheel for M2Crypto
Running setup.py clean for M2Crypto
Failed to build M2Crypto
Installing collected packages: M2Crypto
Found existing installation: M2Crypto 0.31.0
Uninstalling M2Crypto-0.31.0:
Successfully uninstalled M2Crypto-0.31.0
Running setup.py install for M2Crypto ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9SEnI_/M2Crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-i_ZN_R/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/BIO.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/Engine.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/BN.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/DH.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/AuthCookie.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/ftpslib.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/EC.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/EVP.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/util.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/ASN1.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/httpslib.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/Err.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/X509.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/Rand.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2urllib2.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/DSA.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/threading.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/callback.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/RSA.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2xmlrpclib.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/__init__.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/SMIME.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/RC4.py -> build/lib.linux-x86_64-2.7/M2Crypto
copying M2Crypto/m2urllib.py -> build/lib.linux-x86_64-2.7/M2Crypto
creating build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/cb.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Session.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/SSLServer.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/TwistedProtocolWrapper.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/timeout.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Cipher.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Context.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/ssl_dispatcher.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Checker.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/Connection.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
copying M2Crypto/SSL/__init__.py -> build/lib.linux-x86_64-2.7/M2Crypto/SSL
creating build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/constants.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKey.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/PublicKeyRing.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/RSA.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/__init__.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
copying M2Crypto/PGP/packet.py -> build/lib.linux-x86_64-2.7/M2Crypto/PGP
running build_ext
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -D__x86_64__ -I/usr/include/python2.7 -I/usr/include -I/usr/include/x86_64-linux-gnu -includeall -modern -builtin -outdir build/lib.linux-x86_64-2.7/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
/usr/include/sys/cdefs.h:159: Warning 305: Bad constant value (ignored).
/usr/include/bits/wchar.h:38: Warning 490: Fragment 'SWIG_From_wchar_t' not found.
/usr/include/stdint.h:274: Warning 490: Fragment 'SWIG_From_wchar_t' not found.
SWIG/_bio.i:64: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_rand.i:21: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_evp.i:169: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_dh.i:36: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_rsa.i:43: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_dsa.i:31: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_ssl.i:241: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_ssl.i:242: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_x509.i:323: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_pkcs7.i:44: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_pkcs7.i:44: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_util.i:11: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_ec.i:111: Warning 454: Setting a pointer/reference variable may leak memory.
SWIG/_engine.i:168: Warning 454: Setting a pointer/reference variable may leak memory.
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/SWIG
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -I/usr/include -I/usr/include/x86_64-linux-gnu -I/tmp/pip-install-9SEnI_/M2Crypto/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.linux-x86_64-2.7/SWIG/_m2crypto_wrap.o -DTHREADING
SWIG/_m2crypto_wrap.c:3992:35: error: ‘CRYPTO_NUM_LOCKS’ undeclared here (not in a function)
static PyThread_type_lock lock_cs[CRYPTO_NUM_LOCKS];
^~~~
SWIG/_m2crypto_wrap.c: In function ‘lib_init’:
SWIG/_m2crypto_wrap.c:4373:5: warning: implicit declaration of function ‘SSLeay_add_all_algorithms’ [-Wimplicit-function-declaration]
SSLeay_add_all_algorithms();
^~~~~~~
SWIG/_m2crypto_wrap.c: In function ‘bn_rand’:
SWIG/_m2crypto_wrap.c:4775:12: error: storage size of ‘rnd’ isn’t known
BIGNUM rnd;
^

SWIG/_m2crypto_wrap.c:4779:5: warning: implicit declaration of function ‘BN_init’ [-Wimplicit-function-declaration]
BN_init(&rnd);
^~~
SWIG/_m2crypto_wrap.c:4775:12: warning: unused variable ‘rnd’ [-Wunused-variable]
BIGNUM rnd;
^~~
SWIG/_m2crypto_wrap.c: In function ‘bn_rand_range’:
SWIG/_m2crypto_wrap.c:4804:12: error: storage size of ‘rnd’ isn’t known
BIGNUM rnd;
^~~
SWIG/_m2crypto_wrap.c:4804:12: warning: unused variable ‘rnd’ [-Wunused-variable]
SWIG/_m2crypto_wrap.c: In function ‘rand_pseudo_bytes’:
SWIG/_m2crypto_wrap.c:4935:5: warning: ‘RAND_pseudo_bytes’ is deprecated [-Wdeprecated-declarations]
ret = RAND_pseudo_bytes(blob, n);
^~~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/rand.h:47:1: note: declared here
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char buf, int num))
^
SWIG/_m2crypto_wrap.c: In function ‘digest_final’:
SWIG/_m2crypto_wrap.c:5053:34: error: dereferencing pointer to incomplete type ‘EVP_MD_CTX {aka struct evp_md_ctx_st}’
if (!(blob = PyMem_Malloc(ctx->digest->md_size))) {
^~
SWIG/_m2crypto_wrap.c: In function ‘hmac_ctx_new’:
SWIG/_m2crypto_wrap.c:5070:49: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
if (!(ctx = (HMAC_CTX *)PyMem_Malloc(sizeof(HMAC_CTX)))) {
^~~~
SWIG/_m2crypto_wrap.c:5074:5: warning: implicit declaration of function ‘HMAC_CTX_init’ [-Wimplicit-function-declaration]
HMAC_CTX_init(ctx);
^~~~~
SWIG/_m2crypto_wrap.c: In function ‘hmac_ctx_free’:
SWIG/_m2crypto_wrap.c:5079:5: warning: implicit declaration of function ‘HMAC_CTX_cleanup’ [-Wimplicit-function-declaration]
HMAC_CTX_cleanup(ctx);
^~~~
SWIG/_m2crypto_wrap.c: In function ‘hmac_init’:
SWIG/_m2crypto_wrap.c:5090:5: warning: ‘HMAC_Init’ is deprecated [-Wdeprecated-declarations]
if (!HMAC_Init(ctx, kbuf, klen, md)) {
^~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/hmac.h:28:1: note: declared here
DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
^
SWIG/_m2crypto_wrap.c: In function ‘hmac_final’:
SWIG/_m2crypto_wrap.c:5118:34: error: dereferencing pointer to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
if (!(blob = PyMem_Malloc(ctx->md->md_size))) {
^~
SWIG/_m2crypto_wrap.c: In function ‘cipher_ctx_new’:
SWIG/_m2crypto_wrap.c:5157:55: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
if (!(ctx = (EVP_CIPHER_CTX *)PyMem_Malloc(sizeof(EVP_CIPHER_CTX)))) {
^~~~
SWIG/_m2crypto_wrap.c: In function ‘cipher_final’:
SWIG/_m2crypto_wrap.c:5238:34: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
if (!(obuf = PyMem_Malloc(ctx->cipher->block_size))) {
^~
SWIG/_m2crypto_wrap.c: In function ‘pkey_get_modulus’:
SWIG/_m2crypto_wrap.c:5386:17: error: dereferencing pointer to incomplete type ‘EVP_PKEY {aka struct evp_pkey_st}’
switch (pkey->type) {
^~
SWIG/_m2crypto_wrap.c:5397:35: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’
if (!BN_print(bio, rsa->n)) {
^~
SWIG/_m2crypto_wrap.c:5422:35: error: dereferencing pointer to incomplete type ‘DSA {aka struct dsa_st}’
if (!BN_print(bio, dsa->pub_key)) {
^~
SWIG/_m2crypto_wrap.c: In function ‘dh_generate_parameters’:
SWIG/_m2crypto_wrap.c:5619:5: warning: ‘DH_generate_parameters’ is deprecated [-Wdeprecated-declarations]
dh = DH_generate_parameters(plen, g, gendh_callback, (void *)pyfunc);
^~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/dh.h:135:1: note: declared here
DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator,
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_p’:
SWIG/_m2crypto_wrap.c:5665:12: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
if (!dh->p) {
^~
SWIG/_m2crypto_wrap.c: In function ‘rsa_generate_key’:
SWIG/_m2crypto_wrap.c:6123:5: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
rsa = RSA_generate_key(bits, e, genrsa_callback, (void *)pyfunc);
^

In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/rsa.h:193:1: note: declared here
DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:6152:29: error: dereferencing pointer to incomplete type ‘DSA_SIG {aka struct DSA_SIG_st}’
return bn_to_mpi(dsa_sig->r);
^~
SWIG/_m2crypto_wrap.c: In function ‘dsa_generate_parameters’:
SWIG/_m2crypto_wrap.c:6182:5: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
dsa = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, genparam_callback, (void *)pyfunc);
^~~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/dsa.h:122:1: note: declared here
DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
^
SWIG/_m2crypto_wrap.c: In function ‘sk_ssl_cipher_value’:
SWIG/_m2crypto_wrap.c:7088:12: warning: return discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
return sk_SSL_CIPHER_value(stack, idx);
^~~~~~~
SWIG/_m2crypto_wrap.c: In function ‘x509_name_get_der’:
SWIG/_m2crypto_wrap.c:7267:43: error: dereferencing pointer to incomplete type ‘X509_NAME {aka struct X509_name_st}’
return PyString_FromStringAndSize(name->bytes->data, name->bytes->length);
^~
SWIG/_m2crypto_wrap.c: At top level:
SWIG/_m2crypto_wrap.c:7327:2: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
*x509v3_lhash() {
^~~~
SWIG/_m2crypto_wrap.c: In function ‘x509v3_lhash’:
SWIG/_m2crypto_wrap.c:7328:12: warning: return from incompatible pointer type [-Wincompatible-pointer-types]
return lh_new(NULL, NULL); /
Should probably be lh_CONF_VALUE_new but won't compile. /
^~
SWIG/_m2crypto_wrap.c: In function ‘make_stack_from_der_sequence’:
SWIG/_m2crypto_wrap.c:7444:13: warning: implicit declaration of function ‘ASN1_seq_unpack_X509’ [-Wimplicit-function-declaration]
certs = ASN1_seq_unpack_X509((unsigned char *)encoded_string, encoded_string_len, d2i_X509, X509_free );
^~~~~~
SWIG/_m2crypto_wrap.c:7444:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
certs = ASN1_seq_unpack_X509((unsigned char *)encoded_string, encoded_string_len, d2i_X509, X509_free );
^
SWIG/_m2crypto_wrap.c: In function ‘get_der_encoding_stack’:
SWIG/_m2crypto_wrap.c:7460:16: warning: implicit declaration of function ‘ASN1_seq_pack_X509’ [-Wimplicit-function-declaration]
encoding = ASN1_seq_pack_X509(stack, i2d_X509, NULL, &len);
^
~~~
SWIG/_m2crypto_wrap.c:7460:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
encoding = ASN1_seq_pack_X509(stack, i2d_X509, NULL, &len);
^
SWIG/_m2crypto_wrap.c: In function ‘ecdsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:7990:31: error: dereferencing pointer to incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
return bn_to_mpi(ecdsa_sig->r);
^~
SWIG/_m2crypto_wrap.c: In function ‘_wrap_sslv2_method’:
SWIG/_m2crypto_wrap.c:18027:26: warning: implicit declaration of function ‘SSLv2_method’ [-Wimplicit-function-declaration]
result = (SSL_METHOD *)SSLv2_method();
^~~~
SWIG/_m2crypto_wrap.c:18027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
result = (SSL_METHOD *)SSLv2_method();
^
SWIG/_m2crypto_wrap.c: In function ‘_wrap_tlsv1_method’:
SWIG/_m2crypto_wrap.c:18053:3: warning: ‘TLSv1_method’ is deprecated [-Wdeprecated-declarations]
result = (SSL_METHOD *)TLSv1_method();
^~
In file included from /usr/include/openssl/e_os2.h:13:0,
from /usr/include/openssl/err.h:13,
from SWIG/_m2crypto_wrap.c:3635:
/usr/include/openssl/ssl.h:1627:1: note: declared here
DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /
TLSv1.0 /
^
SWIG/_m2crypto_wrap.c: In function ‘_wrap_c2i_asn1_object’:
SWIG/_m2crypto_wrap.c:25487:27: warning: implicit declaration of function ‘c2i_ASN1_OBJECT’ [-Wimplicit-function-declaration]
result = (ASN1_OBJECT *)c2i_ASN1_OBJECT(arg1,(unsigned char const *
)arg2,arg3);
^~~~~
SWIG/_m2crypto_wrap.c:25487:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
result = (ASN1_OBJECT )c2i_ASN1_OBJECT(arg1,(unsigned char const *)arg2,arg3);
^
SWIG/_m2crypto_wrap.c: In function ‘init__m2crypto’:
SWIG/_m2crypto_wrap.c:31091:79: warning: implicit declaration of function ‘SWIG_From_wchar_t’ [-Wimplicit-function-declaration]
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
~~~~
SWIG/_m2crypto_wrap.c:31091:119: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31091:120: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31091:79: warning: passing argument 4 of ‘SWIG_Python_SetConstant’ makes pointer from integer without a cast [-Wint-conversion]
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
~~~~
SWIG/_m2crypto_wrap.c:1236:1: note: expected ‘PyObject * {aka struct _object *}’ but argument is of type ‘int’
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
^
~~~~
SWIG/_m2crypto_wrap.c:31092:113: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31092:114: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "__WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31140:111: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31140:112: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MIN",SWIG_From_int((int)((-(0x7fffffff+\0) -1))));
^
SWIG/_m2crypto_wrap.c:31141:117: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31141:118: error: stray ‘\’ in program
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^
SWIG/_m2crypto_wrap.c:31141:77: warning: passing argument 4 of ‘SWIG_Python_SetConstant’ makes pointer from integer without a cast [-Wint-conversion]
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "WCHAR_MAX",SWIG_From_wchar_t((wchar_t)((0x7fffffff+\0))));
^~~~~
SWIG/_m2crypto_wrap.c:1236:1: note: expected ‘PyObject * {aka struct _object *}’ but argument is of type ‘int’
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
^~~~~~~
SWIG/_m2crypto_wrap.c:31198:112: error: ‘SSL_ST_INIT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_RENEGOTIATE",SWIG_From_int((int)((0x04|SSL_ST_INIT))));
^~~
SWIG/_m2crypto_wrap.c:31198:112: note: each undeclared identifier is reported only once for each function it appears in
SWIG/_m2crypto_wrap.c: In function ‘dh_get_p’:
SWIG/_m2crypto_wrap.c:5670:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_g’:
SWIG/_m2crypto_wrap.c:5678:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_pub’:
SWIG/_m2crypto_wrap.c:5686:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dh_get_priv’:
SWIG/_m2crypto_wrap.c:5694:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘rsa_get_e’:
SWIG/_m2crypto_wrap.c:5803:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘rsa_get_n’:
SWIG/_m2crypto_wrap.c:5811:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘rsa_check_pub_key’:
SWIG/_m2crypto_wrap.c:6138:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:6153:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_sig_get_s’:
SWIG/_m2crypto_wrap.c:6157:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_p’:
SWIG/_m2crypto_wrap.c:6195:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_q’:
SWIG/_m2crypto_wrap.c:6203:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_g’:
SWIG/_m2crypto_wrap.c:6211:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_pub’:
SWIG/_m2crypto_wrap.c:6219:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_get_priv’:
SWIG/_m2crypto_wrap.c:6227:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_check_key’:
SWIG/_m2crypto_wrap.c:6474:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_check_pub_key’:
SWIG/_m2crypto_wrap.c:6478:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘dsa_keylen’:
SWIG/_m2crypto_wrap.c:6482:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘x509_name_get_der’:
SWIG/_m2crypto_wrap.c:7268:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘ecdsa_sig_get_r’:
SWIG/_m2crypto_wrap.c:7991:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
SWIG/_m2crypto_wrap.c: In function ‘ecdsa_sig_get_s’:
SWIG/_m2crypto_wrap.c:7995:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
At top level:
SWIG/_m2crypto_wrap.c:3993:13: warning: ‘lock_count’ defined but not used [-Wunused-variable]
static long lock_count[CRYPTO_NUM_LOCKS];
^~~~
SWIG/_m2crypto_wrap.c:3992:27: warning: ‘lock_cs’ defined but not used [-Wunused-variable]
static PyThread_type_lock lock_cs[CRYPTO_NUM_LOCKS];
^
~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Rolling back uninstall of M2Crypto
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9SEnI_/M2Crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-i_ZN_R/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-9SEnI_/M2Crypto/

Most helpful comment

I've finally managed to work around this issue. As mentioned in #1421 there is a patched version of M2Crypto 0.24.0 in Debian repositories. You can use it to build your package in Ubuntu. Below I present the steps I've taken which worked for me on Ubuntu 18.04.1:

  1. Download original Source Package and Patch from Debian repo:
    wget http://deb.debian.org/debian/pool/main/m/m2crypto/m2crypto_0.24.0.orig.tar.xz
    wget http://deb.debian.org/debian/pool/main/m/m2crypto/m2crypto_0.24.0-1.1.debian.tar.xz
  2. Unpack and copy debian folder from the patch to source folder:
    tar xvf m2crypto_0.24.0.orig.tar.xz
    tar xvf m2crypto_0.24.0-1.1.debian.tar.xz
    cp debian/ M2Crypto-0.24.0/
    cd M2Crypto-0.24.0/
  3. Install quilt (tool to apply the patch)
    sudo apt install quilt

Add this line at the end of the .bashrc file:
export QUILT_PATCHES=debian/patches

Reload bashrc:
. ~/.bashrc

  1. Apply the patch (from within M2Crypto-0.24.0 folder):
    quilt push
  2. Prepare the package for pip:
    python setup.py sdist

This will create tar.gz archive in dist folder

cuckoo@cuckoo-Virtual-Machine:~/M2Crypto-0.24.0$ ls -l dist/ 
total 800 
-rw-rw-r-- 1 cuckoo cuckoo 624777 Feb 10 20:30 M2Crypto-0.24.0-py2.7-linux-x86_64.egg 
-rw-rw-r-- 1 cuckoo cuckoo 190488 Feb 11 09:04 M2Crypto-0.24.0.tar.gz 
  1. Install dependencies:
    sudo apt install swig
    sudo apt install libssl1.0-dev
  2. Finally install M2Crypto in your python's virtual environment:
    . venv/bin/activate
    pip install ~/M2Crypto-0.24.0/dist/M2Crypto-0.24.0.tar.gz

If all goes well you should have these folders created:

(venv) cuckoo@cuckoo-Virtual-Machine:~$ ls -l venv/lib/python2.7/site-packages/ | grep M2Crypto 
drwxrwxr-x  4 cuckoo cuckoo    4096 Feb 10 20:54 M2Crypto 
drwxrwxr-x  2 cuckoo cuckoo    4096 Feb 10 20:54 M2Crypto-0.24.0.dist-info 

(venv) cuckoo@cuckoo-Virtual-Machine:~$ pip list | grep M2Crypto 
M2Crypto          0.24.0 

And import in python shouldn't give you any errors:

(venv) cuckoo@cuckoo-Virtual-Machine:~$ python 
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import M2Crypto 
>>> exit() 

All 6 comments

I'm attempting the same thing with a Ubuntu 18.04 fresh install, following process outlined in Cuckoo's documentation, I'm getting the same error when I try to install M2Crypto. Anyone get past this error yet?

I've finally managed to work around this issue. As mentioned in #1421 there is a patched version of M2Crypto 0.24.0 in Debian repositories. You can use it to build your package in Ubuntu. Below I present the steps I've taken which worked for me on Ubuntu 18.04.1:

  1. Download original Source Package and Patch from Debian repo:
    wget http://deb.debian.org/debian/pool/main/m/m2crypto/m2crypto_0.24.0.orig.tar.xz
    wget http://deb.debian.org/debian/pool/main/m/m2crypto/m2crypto_0.24.0-1.1.debian.tar.xz
  2. Unpack and copy debian folder from the patch to source folder:
    tar xvf m2crypto_0.24.0.orig.tar.xz
    tar xvf m2crypto_0.24.0-1.1.debian.tar.xz
    cp debian/ M2Crypto-0.24.0/
    cd M2Crypto-0.24.0/
  3. Install quilt (tool to apply the patch)
    sudo apt install quilt

Add this line at the end of the .bashrc file:
export QUILT_PATCHES=debian/patches

Reload bashrc:
. ~/.bashrc

  1. Apply the patch (from within M2Crypto-0.24.0 folder):
    quilt push
  2. Prepare the package for pip:
    python setup.py sdist

This will create tar.gz archive in dist folder

cuckoo@cuckoo-Virtual-Machine:~/M2Crypto-0.24.0$ ls -l dist/ 
total 800 
-rw-rw-r-- 1 cuckoo cuckoo 624777 Feb 10 20:30 M2Crypto-0.24.0-py2.7-linux-x86_64.egg 
-rw-rw-r-- 1 cuckoo cuckoo 190488 Feb 11 09:04 M2Crypto-0.24.0.tar.gz 
  1. Install dependencies:
    sudo apt install swig
    sudo apt install libssl1.0-dev
  2. Finally install M2Crypto in your python's virtual environment:
    . venv/bin/activate
    pip install ~/M2Crypto-0.24.0/dist/M2Crypto-0.24.0.tar.gz

If all goes well you should have these folders created:

(venv) cuckoo@cuckoo-Virtual-Machine:~$ ls -l venv/lib/python2.7/site-packages/ | grep M2Crypto 
drwxrwxr-x  4 cuckoo cuckoo    4096 Feb 10 20:54 M2Crypto 
drwxrwxr-x  2 cuckoo cuckoo    4096 Feb 10 20:54 M2Crypto-0.24.0.dist-info 

(venv) cuckoo@cuckoo-Virtual-Machine:~$ pip list | grep M2Crypto 
M2Crypto          0.24.0 

And import in python shouldn't give you any errors:

(venv) cuckoo@cuckoo-Virtual-Machine:~$ python 
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import M2Crypto 
>>> exit() 

I have the same problem, in debian buster. Tried the @leniwiec16 tip but there is no libssl1.0-dev in Buster. What to do?

I have the same problem, in debian buster. Tried the @leniwiec16 tip but there is no libssl1.0-dev in Buster. What to do?

You can add deb http://security.debian.org/debian-security stretch/updates main in /etc/apt/sources.list.

I've tried on a docker debian:buster, and it worked well.

when running following from leniwiec16 c, i get an error: (am I missing another component?)
Step 7 Finally install M2Crypto in your python's virtual environment:
. venv/bin/activate

bash: venv/bin/activate: No such file or directory

did
pip install virtualenv
virtualenv venv
then run
. venv/bin/activate

@jt-hm virtualenv must be installed through your system package so run:

sudo apt-get install python-virtualenv python-setuptools

Was this page helpful?
0 / 5 - 0 ratings