Python bindings for the XML Security Library.
A documentation for xmlsec
can be found at xmlsec.readthedocs.io.
Check the examples section in the documentation to see various examples of signing and verifying using the library.
libxml2 >= 2.9.1
libxmlsec1 >= 1.2.33
xmlsec
is available on PyPI:
pip install xmlsec
Depending on your OS, you may need to install the required native libraries first:
apt-get install pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
Note: There is no required version of LibXML2 for Ubuntu Precise, so you need to download and install it manually.
wget http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz
tar -xvf libxml2-2.9.1.tar.gz
cd libxml2-2.9.1
./configure && make && make install
yum install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel
dnf install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel
brew install libxml2 libxmlsec1 pkg-config
apk add build-base libressl libffi-dev libressl-dev libxslt-dev libxml2-dev xmlsec-dev xmlsec
If you get any fatal errors about missing .h
files, update your
C_INCLUDE_PATH
environment variable to include the appropriate
files from the libxml2
and libxmlsec1
libraries.
Starting with 1.3.7, prebuilt wheels are available for Windows,
so running pip install xmlsec
should suffice. If you want
to build from source:
Configure build environment, see wiki.python.org for more details.
Install from source dist:
pip install xmlsec --no-binary=xmlsec
Clone the
xmlsec
source code repository to your local computer.git clone https://github.com/xmlsec/python-xmlsec.git
Change into the
python-xmlsec
root directory.cd /path/to/xmlsec
Install the project and all its dependencies using
pip
.pip install .
Follow steps 1 and 2 of the manual installation instructions.
Initialize a virtual environment to develop in. This is done so as to ensure every contributor is working with close-to-identicial versions of packages.
mkvirtualenv xmlsec
The
mkvirtualenv
command is available fromvirtualenvwrapper
package which can be installed by following link.Activate the created virtual environment:
workon xmlsec
Install
xmlsec
in development mode with testing enabled. This will download all dependencies required for running the unit tests.pip install -r requirements-test.txt pip install -e "."
Run the unit tests.
pytest tests
Tests configuration
Env variable
PYXMLSEC_TEST_ITERATIONS
specifies number of test iterations to detect memory leaks.
Please attach the output of following information:
version of
xmlsec
version of
libxmlsec1
version of
libxml2
output from the command
pkg-config --cflags xmlsec1
Unless otherwise noted, all files contained within this project are licensed under the MIT opensource license. See the included
LICENSE
file or visit opensource.org for more information.python-xmlsec's People
Forkers
bigtonylewis jgiannuzzi orcasgit andreitognolo anastasiia-skliar devsisters say5 aop voipir vidyarani-dg johann2357 melinath nad2000 pedroburon sayan801 cjwarren technolink sindrig alexhermida mintel plasticav nhtha mause zhang123cnn sahir dcondeurra shoulddabeenawhalebiologist peterebden cgdeboer tevansuk tdlukulu paulskinau keombre lovegandhi vitug marcio-belarmino fbouliane talebi1 caleb15 hoefling asettouf roman513 fareharbor visuman singulret paymentworks ch3pjw graingert jackton1 anodino-dev aserkash namboodiri cied jtalir shadchin crowdjustice vpol johnnoone katiakweb abdealiloko chrismacnaughton cdw-diataal diataal-bv trellixvulnteam nosnilmot tdivis redrenar coolleng2525 danielvlla gain620 deronnax semgrep rockdrilla thinhhuynh neruson chrisnovakovic mdgreenwald eljeffeg wiriyaarmz ayakael mgomezleon simonandres182 wolfi-chainguard-demo brennanneoh teknolog2000 jonathangreen ebadanin hireanesquire xu20160924 chainguard-wolfi-bites-back hroncok giscepython-xmlsec's Issues
pip install xmlsec crashes on Debian
I’m on Debian 7.7
Linux *.com 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
user@host:~$ dpkg --get-selections | grep libxml2 libxml2:amd64 install libxml2-dev:amd64 install user@host:~$ dpkg --get-selections | grep libxmlsec1 libxmlsec1 install libxmlsec1-dev install libxmlsec1-gcrypt install libxmlsec1-gnutls install libxmlsec1-nss install libxmlsec1-openssl install user@host:~$ dpkg --get-selections | grep python-dev python-dev install
Running
pip install xmlsec
fails to build with following message:creating build/temp.linux-x86_64-2.7/src/xmlsec gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_GOST=1 -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -I/usr/local/lib/python2.7/dist-packages/lxml -I/usr/local/lib/python2.7/dist-packages/lxml/includes -Isrc -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/constants.c -o build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 gcc: error: src/xmlsec/constants.c: No such file or directory gcc: fatal error: no input files compilation terminated. error: command 'gcc' failed with exit status 4
What am I doing wrong?
Build error on Python 3.4 on CentOS 7
For Python 3 on CentOS 7, the default on CentOS 7 is Python 3.4 and attempting to build will result in this error below:
# python3 setup.py build running build running build_ext Traceback (most recent call last): File "setup.py", line 60, in <module> 'Topic :: Text Processing :: Markup :: XML' File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/lib64/python3.4/distutils/command/build.py", line 126, in run self.run_command(cmd_name) File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command cmd_obj.run() File "setup.py", line 11, in run self.patch_options() File "setup.py", line 16, in patch_options ext.define_macros.extend(xmlsec_setupinfo.define_macros()) File "/root/python-xmlsec/xmlsec_setupinfo.py", line 48, in define_macros macros.extend(xmlsec_config()['define_macros']) File "/root/python-xmlsec/xmlsec_setupinfo.py", line 111, in xmlsec_config __XMLSEC_CONFIG = load_xmlsec1_config() File "/root/python-xmlsec/xmlsec_setupinfo.py", line 178, in load_xmlsec1_config macros[i] = ('XMLSEC_CRYPTO', '"{0}"'.format(v[1])) TypeError: 'set' object does not support item assignment
I tried the same build process with Python 3.6 instead and it built successfully.
import xmlsec causes error
I installed python-xmlsec 1.0.5 with pip. (imported by python3-saml).
import xmlsec
causes below error.Python 3.5.2 (default, Mar 7 2017, 17:22:35) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import xmlsec func=xmlSecCryptoDLLoadLibrary:file=dl.c:line=445:obj=unknown:subj=crypto != NULL:error=100:assertion: Traceback (most recent call last): File "<stdin>", line 1, in <module> SystemError: null argument to internal routine
OS: Amazon Linux 2016.09
python 3.5.2.
installed package is below.$ yum list | grep libxml libxml2.x86_64 2.9.1-6.3.49.amzn1 installed libxml2-devel.x86_64 2.9.1-6.3.49.amzn1 @amzn-main libxml2-python27.x86_64 2.9.1-6.3.49.amzn1 installed libxml++.i686 2.30.0-1.el6 epel libxml++.x86_64 2.30.0-1.el6 epel libxml++-devel.i686 2.30.0-1.el6 epel libxml++-devel.x86_64 2.30.0-1.el6 epel libxml2.i686 2.9.1-6.3.49.amzn1 amzn-main libxml2-python26.x86_64 2.9.1-6.3.49.amzn1 amzn-main libxml2-static.x86_64 2.9.1-6.3.49.amzn1 amzn-main nodejs-libxmljs.x86_64 0.8.1-3.el6 epel perl-libxml-perl.noarch 0.08-19.8.amzn1 amzn-main
$ yum list | grep xmlsec xmlsec1.x86_64 1.2.20-5.2.amzn1 @amzn-updates xmlsec1-devel.x86_64 1.2.20-5.2.amzn1 @amzn-updates xmlsec1-gcrypt.x86_64 1.2.20-5.2.amzn1 @amzn-updates xmlsec1-gcrypt-devel.x86_64 1.2.20-5.2.amzn1 @amzn-updates xmlsec1-gnutls.x86_64 1.2.20-5.2.amzn1 @amzn-updates xmlsec1-gnutls-devel.x86_64 1.2.20-5.2.amzn1 @amzn-updates xmlsec1-openssl.x86_64 1.2.20-5.2.amzn1 @amzn-updates xmlsec1-openssl-devel.x86_64 1.2.20-5.2.amzn1 @amzn-updates php-robrichards-xmlseclibs.noarch 2.0.1-1.el6 epel php-robrichards-xmlseclibs1.noarch 1.4.2-1.el6 epel php-xmlseclibs.noarch 1.3.1-3.el6 epel pyxmlsec.x86_64 0.3.0-6.el6 epel xmlsec1.i686 1.2.20-5.2.amzn1 amzn-updates xmlsec1-gcrypt.i686 1.2.20-5.2.amzn1 amzn-updates xmlsec1-gnutls.i686 1.2.20-5.2.amzn1 amzn-updates xmlsec1-nss.i686 1.2.20-5.2.amzn1 amzn-updates xmlsec1-nss.x86_64 1.2.20-5.2.amzn1 amzn-updates xmlsec1-nss-devel.x86_64 1.2.20-5.2.amzn1 amzn-updates xmlsec1-openssl.i686 1.2.20-5.2.amzn1 amzn-updates
ImportError: No module named 'xmlsec_setupinfo'
We're receiving the following error when attempting to pip install xmlsec 1.3.2.
09:54:23 Downloading xmlsec-1.3.2.tar.gz 09:54:23 Complete output from command python setup.py egg_info: 09:54:23 Traceback (most recent call last): 09:54:23 File "<string>", line 1, in <module> 09:54:23 File "/tmp/pip-build-asinjmj6/xmlsec/setup.py", line 5, in <module> 09:54:23 import xmlsec_setupinfo 09:54:23 ImportError: No module named 'xmlsec_setupinfo'
Looks like xmlsec_setupinfo.py isn't getting packaged up in the tar: https://pypi.python.org/packages/57/2e/fd42a79472c19b7c01ead43ab3c2120554234441848ac790f9839993443e/xmlsec-1.3.2.tar.gz#md5=37b14968a0ef150455a4e9d2dd4149fe
ImportError: No module named pkgconfig
I can't install the latest version (1.0.1):
% mkvirtualenv test New python executable in /media/projects/.virtualenvs/test/bin/python Installing setuptools, pip, wheel...done. (test) % which python /media/projects/.virtualenvs/test/bin/python (test) % python -V Python 2.7.12 (test) % pip install xmlsec Collecting xmlsec Downloading xmlsec-1.0.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-42z6jD/xmlsec/setup.py", line 5, in <module> import pkgconfig ImportError: No module named pkgconfig ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-42z6jD/xmlsec/
xmlsec ImportError: constants.cpython-34m.so: undefined symbol: xmlSecNodeKeyInfo
We experienced an issue in python-xmlsec while using python3-saml. When we first tried to install xmlsec using pip on Amazon Linux, it failed with the error:
src/xmlsec.h:1:27: fatal error: xmlsec/xmlsec.h: No such file or directory #include <xmlsec/xmlsec.h>
I then updated C_INCLUDE_PATH to include /usr/local/include/xmlsec1/
pip install --upgrade --force-reinstall xmlsec
Installs xmlsec fine but I see these error on importing xmlsec in an ipython shell.
In [2]: import xmlsec ImportError Traceback (most recent call last) <ipython-input-2-b2e75c9f386b> in <module>() ----> 1 import xmlsec /var/www/venv-34/lib/python3.4/site-packages/xmlsec/__init__.py in <module>() 3 import atexit 4 from .meta import version as __version__, description as __doc__ ----> 5 from .constants import * 6 from .utils import * 7 from .key import * ImportError: /var/www/venv-34/lib/python3.4/site-packages/xmlsec/constants.cpython-34m.so: undefined symbol: xmlSecNodeKeyInfo
These are the versions in my venv :
Python 3.4.2
pip 8.1.2 from /var/www/venv/lib/python3.4/site-packages (python 3.4)
xmlsec 0.6.0
lxml 3.6.0
I could not find any Amazon linux yum package for xmlsec and hence I built xmlsec1 from source - https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.18.tar.gz
This is my xmlsec1-config:
xmlsec1-config: 1.2.18xmlsec1-config --cflags --libs
-D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_DL_LIBLTDL=1, -I/usr/local/include/xmlsec1 -I/usr/include/libxml2 -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_CRYPTO=\"openssl\" -L/usr/local/lib -L/usr/lib64 -lltdl -lxmlsec1 -lxslt -lxml2 -lz -ldl -lm
However, these issues do not occur on my dev ubuntu machine. I exactly have the same versions of Python3, pip, xmlsec1, python-xmlsec and python3-saml on my ubuntu and it works totally fine.
Pip install dev dependencies fails on python 2.7
When running
pip install -e ".[test]"
$ pip install -e ".[test]" Obtaining file:///home/myuser/python-xmlsec Running setup.py egg_info for package from file:///home/myuser/python-xmlsec Installing extra requirements: 'test' Requirement already satisfied (use --upgrade to upgrade): lxml>=3.0 in ./env/lib/python2.7/site-packages (from xmlsec==0.3.1) Requirement already satisfied (use --upgrade to upgrade): pytest in ./env/lib/python2.7/site-packages (from xmlsec==0.3.1) Installing collected packages: xmlsec Running setup.py develop for xmlsec skipping 'src/xmlsec/constants.c' Cython extension (up-to-date) building 'xmlsec.constants' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_GOST=1 -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -Isrc -I/home/myuser/python-xmlsec/env/local/lib/python2.7/site-packages/lxml/includes -I/home/myuser/python-xmlsec/env/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/constants.c -o build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 src/xmlsec/constants.c: In function ‘initconstants’: src/xmlsec/constants.c:2468:61: error: ‘xmlSecTransformEcdsaSha1Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha1Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) ^ src/xmlsec/constants.c:2468:61: note: each undeclared identifier is reported only once for each function it appears in src/xmlsec/constants.c:2480:61: error: ‘xmlSecTransformEcdsaSha224Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha224Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) ^ src/xmlsec/constants.c:2492:61: error: ‘xmlSecTransformEcdsaSha256Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha256Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) ^ src/xmlsec/constants.c:2504:61: error: ‘xmlSecTransformEcdsaSha384Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha384Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) ^ src/xmlsec/constants.c:2516:61: error: ‘xmlSecTransformEcdsaSha512Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha512Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Complete output from command /home/myuser/python-xmlsec/env/bin/python -c "import setuptools, tokenize; __file__='/home/myuser/python-xmlsec/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps: running develop running egg_info writing dependency_links to xmlsec.egg-info/dependency_links.txt writing requirements to xmlsec.egg-info/requires.txt writing xmlsec.egg-info/PKG-INFO writing top-level names to xmlsec.egg-info/top_level.txt warning: manifest_maker: standard file '-c' not found reading manifest file 'xmlsec.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'xmlsec.egg-info/SOURCES.txt' running build_ext skipping 'src/xmlsec/constants.c' Cython extension (up-to-date) building 'xmlsec.constants' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_GOST=1 -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -Isrc -I/home/myuser/python-xmlsec/env/local/lib/python2.7/site-packages/lxml/includes -I/home/myuser/python-xmlsec/env/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/constants.c -o build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 src/xmlsec/constants.c: In function ‘initconstants’: src/xmlsec/constants.c:2468:61: error: ‘xmlSecTransformEcdsaSha1Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha1Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) ^ src/xmlsec/constants.c:2468:61: note: each undeclared identifier is reported only once for each function it appears in src/xmlsec/constants.c:2480:61: error: ‘xmlSecTransformEcdsaSha224Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha224Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) ^ src/xmlsec/constants.c:2492:61: error: ‘xmlSecTransformEcdsaSha256Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha256Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) ^ src/xmlsec/constants.c:2504:61: error: ‘xmlSecTransformEcdsaSha384Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha384Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) ^ src/xmlsec/constants.c:2516:61: error: ‘xmlSecTransformEcdsaSha512Id’ undeclared (first use in this function) __pyx_t_2 = ((PyObject *)__pyx_f_6xmlsec_9constants__mkti(xmlSecTransformEcdsaSha512Id)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Cleaning up... Command /home/myuser/python-xmlsec/env/bin/python -c "import setuptools, tokenize; __file__='/home/myuser/python-xmlsec/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps failed with error code 1 in /home/myuser/python-xmlsec Traceback (most recent call last): File "/home/myuser/python-xmlsec/env/bin/pip", line 11, in <module> sys.exit(main()) File "/home/myuser/python-xmlsec/env/local/lib/python2.7/site-packages/pip/__init__.py", line 185, in main return command.main(cmd_args) File "/home/myuser/python-xmlsec/env/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 40: ordinal not in range(128)
I'm running Linux Mint 17.2 64-bit, compiling with gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
Create documentation
Need to build documentation for library.
The documentation should be gathered from doc strings automatically, it may be required updating doc-strings for some of methods.
The documentation should be in RST format and it should publish on each release to
http://pythonhosted.org/xmlsecCan you test if the builds/tests fail now on Travis?
At python3-saml I experienced that Travis fails with
python 2.7.12, 3.3.5, 3.3.6, 3.4.3, 3.5.0home/travis/build.sh: line 45: 6316 Segmentation fault (core dumped)
I wonder if you can run travis and see if you experience a similar issue on python-xmlsec.
PIP install raises error with python 3.4
first error here:
creating build/temp.macosx-10.6-intel-3.4/src /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DMODULE_DOC=Python bindings for the XML Security Library -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.0.1 -I/Users/musecom/bspotted/lib/python3.4/site-packages/lxml/includes -I/Users/musecom/bspotted/lib/python3.4/site-packages/lxml/includes/__pycache__ -I/Users/musecom/bspotted/lib/python3.4/site-packages/lxml -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c ./src/constants.c -o build/temp.macosx-10.6-intel-3.4/./src/constants.o -g -std=c99 -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os In file included from ./src/constants.c:11: In file included from ./src/constants.h:13: ./src/platform.h:15:10: fatal error: 'xmlsec/version.h' file not found #include <xmlsec/version.h>
second error
bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mq/s81xm_kn23n4_kk79z5f25gr0000gq/T/pip-rms9723j-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/mq/s81xm_kn23n4_kk79z5f25gr0000gq/T/pip-siiwo1qp-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/musecom/bspotted/bin/../include/site/python3.4/xmlsec" failed with error code 1 in /private/var/folders/mq/s81xm_kn23n4_kk79z5f25gr0000gq/T/pip-rms9723j-build/
`Failure to build on lucid: XMLSEC_ENC_RETURN_REPLACED_NODE undeclared
Dockerfile to reproduce
FROM ubuntu:lucid RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ python-software-properties && \ apt-get clean && \ add-apt-repository ppa:fkrull/deadsnakes && \ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ gcc \ pkg-config \ python2.7-dev \ libxmlsec1-dev \ libxml2-dev \ libxslt1-dev \ python-pip && \ apt-get clean RUN pip install virtualenv pip --upgrade CMD [ \ "bash", \ "-c", \ "virtualenv venv -ppython2.7 && ./venv/bin/pip install -v xmlsec" \ ]
Output:
Running virtualenv with interpreter /usr/bin/python2.7 New python executable in /venv/bin/python2.7 Also creating executable in /venv/bin/python Installing setuptools, pip, wheel...done. Collecting xmlsec 1 location(s) to search for versions of xmlsec: * https://pypi.python.org/simple/xmlsec/ Getting page https://pypi.python.org/simple/xmlsec/ Looking up "https://pypi.python.org/simple/xmlsec/" in the cache No cache entry available Starting new HTTPS connection (1): pypi.python.org /venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. SNIMissingWarning /venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning "GET /simple/xmlsec/ HTTP/1.1" 200 440 Updating cache with response from "https://pypi.python.org/simple/xmlsec/" Caching b/c date exists and max-age > 0 Analyzing links from page https://pypi.python.org/simple/xmlsec/ Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.1.0.tar.gz#md5=a8f66b814c83a1d847967650a3ff0b0c (from https://pypi.python.org/simple/xmlsec/), version: 0.1.0 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.1.1.tar.gz#md5=0ab41c08669825bd8410d16a0084fde6 (from https://pypi.python.org/simple/xmlsec/), version: 0.1.1 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.1.2.tar.gz#md5=d17020d8d869281bcb54ab6ffbf3004a (from https://pypi.python.org/simple/xmlsec/), version: 0.1.2 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.2.0.tar.gz#md5=02b05c4263a1dff71710822e8caec76f (from https://pypi.python.org/simple/xmlsec/), version: 0.2.0 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.3.0.tar.gz#md5=8cbc5eeccbc90a2b54ac3ec356056f4f (from https://pypi.python.org/simple/xmlsec/), version: 0.3.0 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.3.1.tar.gz#md5=d902ef20492361525816a7d796b14cbd (from https://pypi.python.org/simple/xmlsec/), version: 0.3.1 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.3.3.tar.gz#md5=1183591266277fe0e415dd802fb0f96b (from https://pypi.python.org/simple/xmlsec/), version: 0.3.3 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.4.0.tar.gz#md5=3054e08effe376f03a0370222c2d8c10 (from https://pypi.python.org/simple/xmlsec/), version: 0.4.0 Found link https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.5.0.tar.gz#md5=9f82e9d76ad8b2dfa8e87f104a0a6bda (from https://pypi.python.org/simple/xmlsec/), version: 0.5.0 Using version 0.5.0 (newest of versions: 0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.3.0, 0.3.1, 0.3.3, 0.4.0, 0.5.0) Looking up "https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.5.0.tar.gz" in the cache No cache entry available "GET /packages/source/x/xmlsec/xmlsec-0.5.0.tar.gz HTTP/1.1" 200 14730 Downloading xmlsec-0.5.0.tar.gz Downloading from URL https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.5.0.tar.gz#md5=9f82e9d76ad8b2dfa8e87f104a0a6bda (from https://pypi.python.org/simple/xmlsec/) Updating cache with response from "https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.5.0.tar.gz" Caching due to etag Running setup.py (path:/tmp/pip-build-FIvbHb/xmlsec/setup.py) egg_info for package xmlsec Running command python setup.py egg_info Source in /tmp/pip-build-FIvbHb/xmlsec has version 0.5.0, which satisfies requirement xmlsec from https://pypi.python.org/packages/source/x/xmlsec/xmlsec-0.5.0.tar.gz#md5=9f82e9d76ad8b2dfa8e87f104a0a6bda Collecting lxml>=3.0 (from xmlsec) 1 location(s) to search for versions of lxml: * https://pypi.python.org/simple/lxml/ Getting page https://pypi.python.org/simple/lxml/ Looking up "https://pypi.python.org/simple/lxml/" in the cache No cache entry available Resetting dropped connection: pypi.python.org /venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning "GET /simple/lxml/ HTTP/1.1" 200 17312 Updating cache with response from "https://pypi.python.org/simple/lxml/" Caching b/c date exists and max-age > 0 Analyzing links from page https://pypi.python.org/simple/lxml/ [[ SNIP: lxml version spam ]] Using version 3.5.0 (newest of versions: 3.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1, 3.1.2, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.5.0) Looking up "https://pypi.python.org/packages/source/l/lxml/lxml-3.5.0.tar.gz" in the cache No cache entry available "GET /packages/source/l/lxml/lxml-3.5.0.tar.gz HTTP/1.1" 200 3810202 Downloading lxml-3.5.0.tar.gz (3.8MB) Downloading from URL https://pypi.python.org/packages/source/l/lxml/lxml-3.5.0.tar.gz#md5=9f0c5f1eb43ff44d5455dab4b4efbe73 (from https://pypi.python.org/simple/lxml/) 99% |############################### | 3.8MB 15.9MB/s eta 0:00:01 Updating cache with response from "https://pypi.python.org/packages/source/l/lxml/lxml-3.5.0.tar.gz" Caching due to etag 100% |################################| 3.8MB 132kB/s Running setup.py (path:/tmp/pip-build-FIvbHb/lxml/setup.py) egg_info for package lxml Running command python setup.py egg_info Source in /tmp/pip-build-FIvbHb/lxml has version 3.5.0, which satisfies requirement lxml>=3.0 from https://pypi.python.org/packages/source/l/lxml/lxml-3.5.0.tar.gz#md5=9f0c5f1eb43ff44d5455dab4b4efbe73 (from xmlsec) Building wheels for collected packages: xmlsec, lxml Running setup.py bdist_wheel for xmlsec ... Destination directory: /tmp/tmpJozaRqpip-wheel- Running command /venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpJozaRqpip-wheel- --python-tag cp27 error Complete output from command /venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpJozaRqpip-wheel- --python-tag cp27: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/xmlsec copying src/xmlsec/__init__.py -> build/lib.linux-x86_64-2.7/xmlsec copying src/xmlsec/error.py -> build/lib.linux-x86_64-2.7/xmlsec copying src/xmlsec/meta.py -> build/lib.linux-x86_64-2.7/xmlsec running build_ext cythoning src/xmlsec/constants.pyx to src/xmlsec/constants.c building 'xmlsec.constants' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src creating build/temp.linux-x86_64-2.7/src/xmlsec gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml/includes -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/constants.c -o build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/constants.c: In function 'initconstants': src/xmlsec/constants.c:2164: warning: implicit declaration of function 'xmlSecTransformInclC14N11GetKlass' src/xmlsec/constants.c:2164: warning: passing argument 1 of '__pyx_f_6xmlsec_9constants__mkti' makes pointer from integer without a cast src/xmlsec/constants.c:1032: note: expected 'xmlSecTransformId' but argument is of type 'int' src/xmlsec/constants.c:2176: warning: implicit declaration of function 'xmlSecTransformInclC14N11WithCommentsGetKlass' src/xmlsec/constants.c:2176: warning: passing argument 1 of '__pyx_f_6xmlsec_9constants__mkti' makes pointer from integer without a cast src/xmlsec/constants.c:1032: note: expected 'xmlSecTransformId' but argument is of type 'int' gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/constants.so cythoning src/xmlsec/utils.pyx to src/xmlsec/utils.c building 'xmlsec.utils' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml/includes -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/utils.c -o build/temp.linux-x86_64-2.7/src/xmlsec/utils.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/utils.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/utils.so cythoning src/xmlsec/tree.pyx to src/xmlsec/tree.c building 'xmlsec.tree' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml/includes -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/tree.c -o build/temp.linux-x86_64-2.7/src/xmlsec/tree.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/tree.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/tree.so cythoning src/xmlsec/key.pyx to src/xmlsec/key.c building 'xmlsec.key' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml/includes -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/key.c -o build/temp.linux-x86_64-2.7/src/xmlsec/key.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/key.c: In function 'initkey': src/xmlsec/key.c:5888: warning: implicit declaration of function 'xmlSecOpenSSLKeyDataX509GetKlass' src/xmlsec/key.c:5888: warning: passing argument 1 of '__pyx_f_6xmlsec_3key__mkkdi' makes pointer from integer without a cast src/xmlsec/key.c:1113: note: expected 'xmlSecKeyDataId' but argument is of type 'int' src/xmlsec/key.c:5901: warning: implicit declaration of function 'xmlSecOpenSSLKeyDataRawX509CertGetKlass' src/xmlsec/key.c:5901: warning: passing argument 1 of '__pyx_f_6xmlsec_3key__mkkdi' makes pointer from integer without a cast src/xmlsec/key.c:1113: note: expected 'xmlSecKeyDataId' but argument is of type 'int' gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/key.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/key.so cythoning src/xmlsec/ds.pyx to src/xmlsec/ds.c building 'xmlsec.ds' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml/includes -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/ds.c -o build/temp.linux-x86_64-2.7/src/xmlsec/ds.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/ds.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/ds.so cythoning src/xmlsec/enc.pyx to src/xmlsec/enc.c building 'xmlsec.enc' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml/includes -I/tmp/pip-build-FIvbHb/xmlsec/.eggs/lxml-3.5.0-py2.7-linux-x86_64.egg/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/enc.c -o build/temp.linux-x86_64-2.7/src/xmlsec/enc.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/enc.c: In function '__pyx_pf_6xmlsec_3enc_17EncryptionContext_6encrypt_xml': src/xmlsec/enc.c:1984: error: 'XMLSEC_ENC_RETURN_REPLACED_NODE' undeclared (first use in this function) src/xmlsec/enc.c:1984: error: (Each undeclared identifier is reported only once src/xmlsec/enc.c:1984: error: for each function it appears in.) src/xmlsec/enc.c:2035: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' src/xmlsec/enc.c:2087: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' src/xmlsec/enc.c: In function '__pyx_pf_6xmlsec_3enc_17EncryptionContext_10decrypt': src/xmlsec/enc.c:2681: error: 'XMLSEC_ENC_RETURN_REPLACED_NODE' undeclared (first use in this function) src/xmlsec/enc.c:2732: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' src/xmlsec/enc.c:2784: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' error: command 'gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for xmlsec Running setup.py clean for xmlsec Running command /venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all Running setup.py bdist_wheel for lxml ... Destination directory: /tmp/tmpk2ZOfApip-wheel- Running command /venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpk2ZOfApip-wheel- --python-tag cp27 done Stored in directory: /.cache/pip/wheels/2d/f6/d6/158b79cc088e551305968e312953c9767855a36f39d4e16054 Removing source in /tmp/pip-build-FIvbHb/lxml Successfully built lxml Failed to build xmlsec Installing collected packages: lxml, xmlsec Running setup.py install for xmlsec ... Running command /venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ce3lag-record/install-record.txt --single-version-externally-managed --compile --install-headers /venv/include/site/python2.7/xmlsec error Complete output from command /venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ce3lag-record/install-record.txt --single-version-externally-managed --compile --install-headers /venv/include/site/python2.7/xmlsec: 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/xmlsec copying src/xmlsec/__init__.py -> build/lib.linux-x86_64-2.7/xmlsec copying src/xmlsec/error.py -> build/lib.linux-x86_64-2.7/xmlsec copying src/xmlsec/meta.py -> build/lib.linux-x86_64-2.7/xmlsec running build_ext skipping 'src/xmlsec/constants.c' Cython extension (up-to-date) building 'xmlsec.constants' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src creating build/temp.linux-x86_64-2.7/src/xmlsec gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/venv/local/lib/python2.7/site-packages/lxml/includes -I/venv/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/constants.c -o build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/constants.c: In function 'initconstants': src/xmlsec/constants.c:2164: warning: implicit declaration of function 'xmlSecTransformInclC14N11GetKlass' src/xmlsec/constants.c:2164: warning: passing argument 1 of '__pyx_f_6xmlsec_9constants__mkti' makes pointer from integer without a cast src/xmlsec/constants.c:1032: note: expected 'xmlSecTransformId' but argument is of type 'int' src/xmlsec/constants.c:2176: warning: implicit declaration of function 'xmlSecTransformInclC14N11WithCommentsGetKlass' src/xmlsec/constants.c:2176: warning: passing argument 1 of '__pyx_f_6xmlsec_9constants__mkti' makes pointer from integer without a cast src/xmlsec/constants.c:1032: note: expected 'xmlSecTransformId' but argument is of type 'int' gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/constants.so skipping 'src/xmlsec/utils.c' Cython extension (up-to-date) building 'xmlsec.utils' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/venv/local/lib/python2.7/site-packages/lxml/includes -I/venv/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/utils.c -o build/temp.linux-x86_64-2.7/src/xmlsec/utils.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/utils.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/utils.so skipping 'src/xmlsec/tree.c' Cython extension (up-to-date) building 'xmlsec.tree' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/venv/local/lib/python2.7/site-packages/lxml/includes -I/venv/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/tree.c -o build/temp.linux-x86_64-2.7/src/xmlsec/tree.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/tree.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/tree.so skipping 'src/xmlsec/key.c' Cython extension (up-to-date) building 'xmlsec.key' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/venv/local/lib/python2.7/site-packages/lxml/includes -I/venv/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/key.c -o build/temp.linux-x86_64-2.7/src/xmlsec/key.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/key.c: In function 'initkey': src/xmlsec/key.c:5888: warning: implicit declaration of function 'xmlSecOpenSSLKeyDataX509GetKlass' src/xmlsec/key.c:5888: warning: passing argument 1 of '__pyx_f_6xmlsec_3key__mkkdi' makes pointer from integer without a cast src/xmlsec/key.c:1113: note: expected 'xmlSecKeyDataId' but argument is of type 'int' src/xmlsec/key.c:5901: warning: implicit declaration of function 'xmlSecOpenSSLKeyDataRawX509CertGetKlass' src/xmlsec/key.c:5901: warning: passing argument 1 of '__pyx_f_6xmlsec_3key__mkkdi' makes pointer from integer without a cast src/xmlsec/key.c:1113: note: expected 'xmlSecKeyDataId' but argument is of type 'int' gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/key.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/key.so skipping 'src/xmlsec/ds.c' Cython extension (up-to-date) building 'xmlsec.ds' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/venv/local/lib/python2.7/site-packages/lxml/includes -I/venv/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/ds.c -o build/temp.linux-x86_64-2.7/src/xmlsec/ds.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/src/xmlsec/ds.o -lxmlsec1 -lssl -lxslt -lxml2 -lcrypto -lxmlsec1-openssl -o build/lib.linux-x86_64-2.7/xmlsec/ds.so skipping 'src/xmlsec/enc.c' Cython extension (up-to-date) building 'xmlsec.enc' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_OPENSSL_098=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -Isrc -I/venv/local/lib/python2.7/site-packages/lxml/includes -I/venv/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python2.7 -c src/xmlsec/enc.c -o build/temp.linux-x86_64-2.7/src/xmlsec/enc.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/enc.c: In function '__pyx_pf_6xmlsec_3enc_17EncryptionContext_6encrypt_xml': src/xmlsec/enc.c:1984: error: 'XMLSEC_ENC_RETURN_REPLACED_NODE' undeclared (first use in this function) src/xmlsec/enc.c:1984: error: (Each undeclared identifier is reported only once src/xmlsec/enc.c:1984: error: for each function it appears in.) src/xmlsec/enc.c:2035: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' src/xmlsec/enc.c:2087: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' src/xmlsec/enc.c: In function '__pyx_pf_6xmlsec_3enc_17EncryptionContext_10decrypt': src/xmlsec/enc.c:2681: error: 'XMLSEC_ENC_RETURN_REPLACED_NODE' undeclared (first use in this function) src/xmlsec/enc.c:2732: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' src/xmlsec/enc.c:2784: error: 'struct _xmlSecEncCtx' has no member named 'replacedNodeList' error: command 'gcc' failed with exit status 1 ---------------------------------------- Cleaning up... Removing source in /tmp/pip-build-FIvbHb/xmlsec Command "/venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ce3lag-record/install-record.txt --single-version-externally-managed --compile --install-headers /venv/include/site/python2.7/xmlsec" failed with error code 1 in /tmp/pip-build-FIvbHb/xmlsec Exception information: Traceback (most recent call last): File "/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main status = self.run(options, args) File "/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run prefix=options.prefix_path, File "/venv/local/lib/python2.7/site-packages/pip/req/req_set.py", line 731, in install **kwargs File "/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 890, in install spinner=spinner, File "/venv/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 687, in call_subprocess % (command_desc, proc.returncode, cwd)) InstallationError: Command "/venv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-FIvbHb/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ce3lag-record/install-record.txt --single-version-externally-managed --compile --install-headers /venv/include/site/python2.7/xmlsec" failed with error code 1 in /tmp/pip-build-FIvbHb/xmlsec
Segmentation fault on decryption in 0.6.1 and Python3.5
We experienced an issue very similar to #23 in python3-saml (which has a requirement of xmlsec>=0.6.0) -- calls into xmlsec caused segmentation faults after the upgrade to 0.6.1, and a downgrade to 0.6.0 made the issue go away.
I think this may be a regression of that same issue that was closed in 0.6.0, though unfortunately I don't have any stacktraces showing the exact line of code in xmlsec where the segfault occurred.
Docker build just started failing
For months, we've had a docker image that uses xmlsec that worked flawlessly. This morning, a few developers tried rebuilding and started receiving the following error:
Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-7q8jv7dq/xmlsec/setup.py", line 123, in <module> make_extension('xmlsec.template'), File "/usr/local/lib/python3.4/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.4/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.4/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/usr/local/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 195, in run self.find_sources() File "/usr/local/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 222, in find_sources mm.run() File "/usr/local/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 306, in run self.add_defaults() File "/usr/local/lib/python3.4/site-packages/setuptools/command/egg_info.py", line 335, in add_defaults sdist.add_defaults(self) File "/usr/local/lib/python3.4/site-packages/setuptools/command/sdist.py", line 171, in add_defaults build_ext = self.get_finalized_command('build_ext') File "/usr/local/lib/python3.4/distutils/cmd.py", line 299, in get_finalized_command cmd_obj.ensure_finalized() File "/usr/local/lib/python3.4/distutils/cmd.py", line 107, in ensure_finalized self.finalize_options() File "/tmp/pip-build-7q8jv7dq/xmlsec/.eggs/Cython-0.25a0-py3.4-linux-x86_64.egg/Cython/Distutils/build_ext.py", line 19, in finalize_options self.distribution.ext_modules) File "/tmp/pip-build-7q8jv7dq/xmlsec/.eggs/Cython-0.25a0-py3.4-linux-x86_64.egg/Cython/Build/Dependencies.py", line 809, in cythonize aliases=aliases) File "/tmp/pip-build-7q8jv7dq/xmlsec/.eggs/Cython-0.25a0-py3.4-linux-x86_64.egg/Cython/Build/Dependencies.py", line 752, in create_extension_list **kwds)) TypeError: __init__() got an unexpected keyword argument 'sources' src/xmlsec/constants.pyx: cannot find cimported module '.utils' src/xmlsec/constants.pyx: cannot find cimported module '.constants' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7q8jv7dq/xmlsec/ Traceback (most recent call last): File "/usr/local/bin/pip-sync", line 11, in <module> sys.exit(cli()) File "/usr/local/lib/python3.4/site-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.4/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.4/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.4/site-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.4/site-packages/piptools/scripts/sync.py", line 72, in cli install_flags=install_flags)) File "/usr/local/lib/python3.4/site-packages/piptools/sync.py", line 157, in sync check_call([pip, 'install'] + pip_flags + install_flags + sorted(to_install)) File "/usr/local/lib/python3.4/subprocess.py", line 561, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/usr/local/bin/pip', 'install', 'Jinja2==2.8', 'Mako==1.0.4', 'MarkupSafe==0.23', 'Pygments==2.1.3', 'SQLAlchemy==1.0.14', 'WebOb==1.6.1', 'alabaster==0.7.9', 'alembic==0.8.7', 'argparse==1.4.0', 'babel==2.3.4', 'beautifulsoup4==4.5.0', 'boto3==1.3.1', 'botocore==1.4.40', 'cffi==1.7.0', 'cryptography==1.4', 'cython==0.24.1', 'decorator==4.0.10', 'defusedxml==0.4.1', 'docutils==0.12', 'dogpile.cache==0.6.1', 'ecdsa==0.13', 'et-xmlfile==1.0.1', 'extras==1.0.0', 'falcon==1.0.0', 'fixtures==3.0.0', 'future==0.15.2', 'gunicorn==19.6.0', 'hg+https://bitbucket.org/jurko/suds#egg=suds-jurko', 'hypothesis==3.4.2', 'idna==2.1', 'imagesize==0.7.1', 'isodate==0.5.4', 'jdcal==1.2', 'jmespath==0.9.0', 'linecache2==1.0.0', 'lxml==3.6.1', 'marshmallow==2.9.1', 'mox3==0.17.0', 'multipart==0.1', 'openpyxl==2.3.5', 'paramiko==2.0.2', 'paste==2.0.3', 'pbr==1.10.0', 'pillow==3.3.0', 'psycopg2==2.6.2', 'py==1.4.31', 'pyOpenSSL==16.0.0', 'pyasn1==0.1.9', 'pycountry==1.20', 'pycparser==2.14', 'pycrypto==2.6.1', 'pyfakefs==2.7', 'pylibmc==1.5.1', 'pymssql==2.1.3', 'pymysql==0.7.5', 'pyodbc==3.0.10', 'pysaml2==4.0.1', 'pytest==2.9.2', 'python-dateutil==2.5.3', 'python-editor==1.0.1', 'python-jose==1.1.0', 'python-magic==0.4.12', 'python-mimeparse==1.5.2', 'python3-saml==1.1.4', 'pytz==2016.6.1', 'repoze.who==2.3', 'requests==2.10.0', 'simplejson==3.8.2', 'snowballstemmer==1.2.1', 'sphinx-autodoc-annotation==1.0', 'sphinx==1.4.5', 'sqlparse==0.2.0', 'sqltap==0.3.10', 'testtools==2.2.0', 'traceback2==1.4.0', 'typing==3.5.2.2', 'unittest2==1.1.0', 'waitress==0.9.0', 'webtest==2.0.23', 'werkzeug==0.11.10', 'xmlsec==0.6.1', 'zope.interface==4.2.0']' returned non-zero exit status 1 ERROR: Service 'app_web' failed to build: The command '/bin/sh -c pip install --upgrade pip && pip install --upgrade setuptools && pip install pip-tools && pip-sync prod-requirements.txt requirements.txt dev-requirements.txt' returned a non-zero code: 1
Python: 3.4.4
Pip: 8.1.2
Setuptools: 18.2Here's an excerpt from our Dockerfile to give you an idea of what we're doing:
FROM python:3.4.4 RUN mkdir /application WORKDIR /application RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates build-essential python3-setuptools python3-dev libpq-dev libxml2-dev xmlsec1 libxmlsec1-dev libxslt1-dev libffi-dev libjpeg-dev libmemcached-dev freetds-dev unixodbc unixodbc-dev mercurial postgresql-client mysql-client \ && apt-get clean RUN pyvenv venv COPY build/requirements.txt ./requirements.txt COPY build/prod-requirements.txt ./prod-requirements.txt COPY build/dev-requirements.txt ./dev-requirements.txt RUN pip install --upgrade pip && pip install pip-tools && pip-sync prod-requirements.txt requirements.txt dev-requirements.txt
We also tried adding the following deps:
python-lxml, libxmlsec1-openssl pkg-config
to no avail.Error when using verify
I was updating my pip packages when I ran into this. Anything I can do? Is there an older version where this still works?
Thanks!
xmlsec.verify(info, certificate)
File "/web/core/virt1/lib/python2.7/site-packages/xmlsec/__init__.py", line 329, in verify return len(_verify(t, keyspec, sig_path)) > 0 File "/web/core/virt1/lib/python2.7/site-packages/xmlsec/__init__.py", line 306, in _verify this_cert = xmlsec.crypto.from_keyspec(keyspec, signature_element=sig) File "/web/core/virt1/lib/python2.7/site-packages/xmlsec/crypto.py", line 62, in from_keyspec key = _load_keyspec(keyspec, private, signature_element) File "/web/core/virt1/lib/python2.7/site-packages/xmlsec/crypto.py", line 199, in _load_keyspec return XMLSecCryptoFromXML(signature_element, keyspec) File "/web/core/virt1/lib/python2.7/site-packages/xmlsec/crypto.py", line 144, in __init__ fp,_ = _cert_fingerprint(keyspec) File "/web/core/virt1/lib/python2.7/site-packages/xmlsec/crypto.py", line 234, in _cert_fingerprint cert_pem = pem2b64(cert_pem)
Segfault when running test on old version of libxml2
Hi,
I'm trying to debug a very tedious problem, my program is using python-xmlsec and I'm running tests on it on CircleCI Ubuntu 12.04 and for some reason I'm always getting a segfault.
This is the command and the output I currently run
$ gdb -ex r --args python asd.py GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from python...(no debugging symbols found)...done. Starting program: /home/ubuntu/virtualenvs/venv-system/bin/python asd.py [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x00007ffff52f318a in xmlDictLookup () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 (gdb) bt #0 0x00007ffff52f318a in xmlDictLookup () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 #1 0x00007ffff523290c in ?? () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 #2 0x00007ffff52355d9 in ?? () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 #3 0x00007ffff5238c79 in ?? () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 #4 0x00007ffff524551c in xmlParseElement () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 #5 0x00007ffff5244308 in xmlParseContent () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 #6 0x00007ffff5245fd3 in xmlParseInNodeContext () from /usr/lib/x86_64-linux-gnu/libxml2.so.2 #7 0x00007ffff5a0509c in xmlSecReplaceNodeBufferAndReturn () from /usr/lib/libxmlsec1.so.1 #8 0x00007ffff5a034b5 in xmlSecEncCtxDecrypt () from /usr/lib/libxmlsec1.so.1 #9 0x00007ffff45e7bef in __pyx_pf_6xmlsec_3enc_17EncryptionContext_10decrypt (__pyx_v_node=0x7ffff5e94518, __pyx_v_self=<optimized out>) at src/xmlsec/enc.c:2756 #10 __pyx_pw_6xmlsec_3enc_17EncryptionContext_11decrypt (__pyx_v_self=<optimized out>, __pyx_v_node=0x7ffff5e94518) at src/xmlsec/enc.c:2568 #11 0x0000000000499c7b in PyEval_EvalFrameEx () #12 0x00000000004a090c in PyEval_EvalCodeEx () #13 0x000000000049ab45 in PyEval_EvalFrameEx () #14 0x00000000004a1634 in ?? () #15 0x000000000044e4a5 in PyRun_FileExFlags () #16 0x000000000044ec9f in PyRun_SimpleFileExFlags () #17 0x000000000044f904 in Py_Main () #18 0x00007ffff7818f45 in __libc_start_main (main=0x44f9c2 <main>, argc=2, argv=0x7fffffffddf8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdde8) at libc-start.c:287 #19 0x0000000000578c4e in _start ()
And this is the contents of my
asd.py
located in the "tests" folderfrom conftest import * from examples import test_decrypt test_decrypt.test_decrypt1()
So far I'm unable to reproduce the issue anywhere else than in CircleCI's container so the problem is related to that. However a very weird segfault.
.... And actually while writing this ticket I realized that the segfault does come from the libxml2 part of the stack so I figured I'd check that version and BOOM. To document here if someone else has the same issue with
libxml2-dev 2.7.8.dfsg-5.1ubuntu4.14
the decryption will crash.Is there a fix possible to prevent this kind of thing happening?
'xmlSecXkmsNs' undeclared
It seems that in the latest version of
xmlsec1
there is no XMKS. Andpip install xmlsec
fails on Alpinelinux withxmlsec==1.2.22
.gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_DL_LIBLTDL=1 -DXMLSEC_NO_SIZE_T= -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_GOST=1 -DXMLSEC_OPENSSL_100=1 -DXMLSEC_NO_GOST2012=1 -Isrc -I/usr/local/lib/python2.7/site-packages/lxml/includes -I/usr/local/lib/python2.7/site-packages/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/local/include/python2.7 -c src/xmlsec/constants.c -o build/temp.linux-x86_64-2.7/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/constants.c: In function 'initconstants': src/xmlsec/constants.c:1760:41: error: 'xmlSecXkmsNs' undeclared (first use in this function) __pyx_t_2 = __pyx_f_6xmlsec_5utils__u(xmlSecXkmsNs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) ^ src/xmlsec/constants.c:1760:41: note: each undeclared identifier is reported only once for each function it appears in error: command 'gcc' failed with exit status 1
"High" memory required to install
Firstly thank you for the library!
It might be worth pointing out in the readme that this library will not install on systems with 512 memory (t2.nano) on t2.micro it works fine though. (I know for modern computers this isnt very high, but maybe as people move towards micro services / containers this becomes more relevant)
Please implement xmlSecTmplX509DataAddCertificate wrapper
xmlSecTmplX509DataAddCertificate function wrapper seems to be missing.
I'd create a PR but can't get the local env to work : )
https://www.aleksey.com/xmlsec/api/xmlsec-templates.html#XMLSECTMPLX509DATAADDCERTIFICATE
Missing tag for 0.6.1
It'd be helpful to have tags on GitHub for all of the PyPI releases if possible. We're unable to use 1.0.x because of memory leaks (working on a minimal example for a separate issue). In the meantime, there's a tag for 0.6.0 on GitHub, but a 0.6.1 release on PyPI.
XMLSEC_CRYPTO is deprecated since xmlsec 1.2.21
XMLSEC_CRYPTO is deprecated. need to use function xmlSecGetDefaultCrypto instead.
https://github.com/lsh123/xmlsec/blob/xmlsec-1_2_21/include/xmlsec/xmlsec.h#L98Error signing apparently valid envelope
I'm having trouble signing what seems to be a valid envelope.
ctx.sign()
fails, returningxmlsec.Error: (1, 'failed to sign')
.But, if I write
etree.tostring()
to file, I can sign the envelope on the command line usingxmlsec1
, so it seems valid.Furthermore, if I write
etree.tostring()
to file thenetree.parse()
it straight back, I can sign the 'new' envelope usingctx.sign()
! What is going on here? The old and new envelopes are different objects but have identicaldump()
outputs, so they seem to be the same XML document. Can you shed any light on whyctx.sign()
might prefer one over the other?Alternatively, can you advise how I might debug this? I've been trying to use
gdb
to set a breakpoint onPyXmlSec_SignatureContextSign
, but haven't been successful yet. I'm new to C extensions.Thanks
Pip install failing on Ubuntu 12.04, Python 3.4.3
This is the first time I have attempted to utilize this library, so hopefully I am missing something easy.
I installed the dependencies:
apt-get install libxml2-dev libxmlsec1-dev
A
pip install xmlsec==0.3.3
generates the following error:[...] x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DXMLSEC_NO_GOST=1 -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_OPENSSL_098=1 -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_CRYPTO=\\openssl\\ -DXMLSEC_NO_SIZE_T= -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -Isrc -I/home/daaray/.virtualenvs/market_builder/build/xmlsec/lxml-3.5.0b1-py3.4-linux-x86_64.egg/lxml/includes -I/home/daaray/.virtualenvs/market_builder/build/xmlsec/lxml-3.5.0b1-py3.4-linux-x86_64.egg/lxml -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/usr/include/python3.4m -I/home/daaray/.virtualenvs/market_builder/include/python3.4m -c src/xmlsec/constants.c -o build/temp.linux-x86_64-3.4/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 src/xmlsec/constants.c: In function ‘PyInit_constants’: src/xmlsec/constants.c:2419:61: error: ‘xmlSecTransformEcdsaSha1Id’ undeclared (first use in this function) src/xmlsec/constants.c:2419:61: note: each undeclared identifier is reported only once for each function it appears in src/xmlsec/constants.c:2431:61: error: ‘xmlSecTransformEcdsaSha224Id’ undeclared (first use in this function) src/xmlsec/constants.c:2443:61: error: ‘xmlSecTransformEcdsaSha256Id’ undeclared (first use in this function) src/xmlsec/constants.c:2455:61: error: ‘xmlSecTransformEcdsaSha384Id’ undeclared (first use in this function) src/xmlsec/constants.c:2467:61: error: ‘xmlSecTransformEcdsaSha512Id’ undeclared (first use in this function) error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Please advise.
Value error during pip install
Hi, I get this error when installing xmlsec via pip:
" raise ValueError("path '%s' cannot be absolute" % pathname)
ValueError: path '/home/travis/build/mehcode/python-xmlsec/src/constants.c'
cannot be absolute"Environment:
Windows 2008 R2 Server
Python 3.5
lmxl v4.1.1Any clues? Thank you.
Error when trying to decrypt
I have this private key (self-signed, develop server)
MIICXgIBAAKBgQCXM75B84nKjooRgRQKJNFlNTNBeZd9LkWH0e4zvhSf9KxEAsYI 0nvWoEiU8vD2o72mz8Vy0KpWeP09oyjdQ7tnSq/h7Ee0ds0vOGe8HMClXChTZ3bl gSlqqlF+y+hZFuq3wfBWyM/C4GOLNxRi2w5aVHTzIDvLrPlTNegHtf/JowIDAQAB AoGBAItN5NAmbKDuSk5uOeROn407QonkWKnAY9cKlwec7KuiZMQUOhgOtIG9EqII YfEaUrTJYAS0MvuQZODQ3eldad4J7dYNs6OGq0jGRw9FZ5J1kBHj8+/QU7q2hMZv QI80kClRVijHosGs91w4IXq/IIe54yUgvpNzsN8vM9O/CO6hAkEAxWBZWIbPWUl3 e4NO5gX2jj2wEc7i9GYaYc194JCIqikHCmLpMZCDwit2aAQZelXLHYIUF1ZswuYk tbrN2lFeRwJBAMQcgM/Q5jmNn9GVUnM6UZvB3sstG3HmwzTlXNafgeppEfjUsumj GNvwGeYWS4MZtPkAV09uSDJAjWvdGRSpW8UCQHM61c6GHcWdy4CzXzuRXakbQJCU /RD8DwjsREH3f6IAA9k/d671FMcmQqFlS06NieB3Ua1ySlraq7HhFk8P0/8CQQCB Tz4MSXUUq/KekjQccG7RIiNSmvqGvx8l6LqvdduHAiLsjOsvrPA+TXH2SeselbvD l9r6MACAyhm17sKT4hv1AkEAll3xuT4vgUGb2EOLfqZ6LVNgezqfx88wVDZsMSju XS/bRr/Xg6T7phWMXUxv9XJ9IEVn3m+tPIJ/0O3mocVXHw==
And I'm trying to decrypt this SAMLResponse
<?xml version="1.0" encoding="UTF-8"?><saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="https://kriti.ridecell.com/saml/?acs" ID="_90701d8bd9070b58f3020bde22d0c96c" InResponseTo="ONELOGIN_9a618e7aadd1f728c1bae7d4d9f6a118e09ce9d8" IssueInstant="2016-03-14T18:49:01.510Z" Version="2.0"><saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://idp.testshib.org/idp/shibboleth</saml2:Issuer><saml2p:Status><saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></saml2p:Status><saml2:EncryptedAssertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"><xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_a5b212d518a73c70bf12f296e1f2e8be" Type="http://www.w3.org/2001/04/xmlenc#Element"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"/><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><xenc:EncryptedKey Id="_95d4233914438eeaed583a7ad642b464" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/></xenc:EncryptionMethod><ds:KeyInfo><ds:X509Data><ds:X509Certificate>MIICsDCCAhmgAwIBAgIJALtQidWkXwd+MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAlVTMRMw EQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcN MTYwMzExMjAyMDIwWhcNMjYwMzExMjAyMDIwWjBFMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29t ZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEB AQUAA4GNADCBiQKBgQCXM75B84nKjooRgRQKJNFlNTNBeZd9LkWH0e4zvhSf9KxEAsYI0nvWoEiU 8vD2o72mz8Vy0KpWeP09oyjdQ7tnSq/h7Ee0ds0vOGe8HMClXChTZ3blgSlqqlF+y+hZFuq3wfBW yM/C4GOLNxRi2w5aVHTzIDvLrPlTNegHtf/JowIDAQABo4GnMIGkMB0GA1UdDgQWBBR+m91SFd4V LZRFYz2ytqNK4uC5CzB1BgNVHSMEbjBsgBR+m91SFd4VLZRFYz2ytqNK4uC5C6FJpEcwRTELMAkG A1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMg UHR5IEx0ZIIJALtQidWkXwd+MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAIpbHkxn4 qxJbj0whJrxvUfXCp/GLEA4G0fmnFHyvxFemuZy5N1gptxj8pvs7bRSEhh5n9ndLbmJR6GQEtsTf qGV2ahYDDG1JoEPr9ybD0om57Z0OsmA1DUVE0GUj9bE5itpwguHiUWRs0FiTQ6GW0XCPhspkh8eb amLbxkNQLgc=</ds:X509Certificate></ds:X509Data></ds:KeyInfo><xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:CipherValue>d0ZbCDibxnD7dwyi+CPPkF5OOpcVqxPnPl8qQKsmjX40Arf5ufgv/XEg7jcrktsIGt1JVx1ioTVbuna/d5qEMFVLJEmuKWBhgIZNBN2n9xTeuX2CDl4zfvUjrkLKPI2VtPD9rThcBe85/FLmEUjI7AArRv3l2vEojWYmtwcvlSk=</xenc:CipherValue></xenc:CipherData></xenc:EncryptedKey></ds:KeyInfo><xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:CipherValue>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6O9UeyzH2xtKN9wDdYz6kHTgweqDWtb1aT8l0vMojeAlN+1tqux/Y8SuX5KvwWilJ0OBpg1Nkqon4j8VSDNb9C//Z+0dmCfOvx/kwfXsj9LhMnxYvh3jRAPAjL9SW7LIUww0vpAfneFKqNpDSpSACwFD7crwyeTcEy3czFrznMvqmQgMnwoL7U9+dq7u5P9rwesRef2DqLdCX6gdxTs36hsP0/t7ZU8Ul+TSQzfZLORmuHAti14wAldlNx7mUiMIgJI8NymoII6OnB0aQIi5e5/i9TbRYNk+gnk5qD0+9oylec8hAqgom6GQlBaM9hfr9VqlbEDd0cz5eqvPRCgIRJbL1e9xsm3bUZ/QJln0HF6TQbuo/F1YL6NLJGTulT+rmVgcj/Yr4XD3a5Wt8DkRkBzwdNHJsQr7NAAGaBEpfKjuskkqcQ9Wewt53OGYNQd0GCORgV91nt88OfMUBZL2N2Qmo6NipfsyZt6Ncqa2xHQxwXCdTKK0vy9MYh0tazDyn9CFLEygXqTZz/zFhMOlvrW6e2/T7ya7bHLsQUJw2M2I8/09NU3XISD7GKeVudd5/NEl6H2+W8Rw5L2LuOoI3VMkkz1pG35aTuOJA==</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData></saml2:EncryptedAssertion></saml2p:Response>
If I use this online tool that uses xmlseclibs I'm able to decrypt, but when I execute
xmlsec.initialize() mngr = xmlsec.KeysMngr() key = xmlsec.Key.loadMemory(key, xmlsec.KeyDataFormatPem, None) mngr.addKey(key) enc_ctx = xmlsec.EncCtx(mngr) return enc_ctx.decrypt(encrypted_data)
I got:
x509vfy.c:360(xmlSecOpenSSLX509StoreVerify) obj=x509-store subject=X509_verify_cert msg=subj=/C=US/ST=Some-State/O=Internet Widgits Pty Ltd;err=18;msg=self signed certificate errno=4 x509vfy.c:408(xmlSecOpenSSLX509StoreVerify) obj=x509-store msg=err=18;msg=self signed certificate errno=71 kt_rsa.c:779(xmlSecOpenSSLRsaOaepProcess) obj=rsa-oaep-mgf1p subject=RSA_private_decrypt(RSA_PKCS1_OAEP_PADDING) errno=4 kt_rsa.c:636(xmlSecOpenSSLRsaOaepExecute) obj=rsa-oaep-mgf1p subject=xmlSecOpenSSLRsaOaepProcess transforms.c:2207(xmlSecTransformDefaultPushBin) obj=rsa-oaep-mgf1p subject=xmlSecTransformExecute msg=final=1 transforms.c:2234(xmlSecTransformDefaultPushBin) obj=rsa-oaep-mgf1p subject=xmlSecTransformPushBin msg=final=1;outSize=32 transforms.c:1118(xmlSecTransformCtxBinaryExecute) subject=xmlSecTransformCtxPushBin msg=dataSize=172 xmlenc.c:741(xmlSecEncCtxDecryptToBuffer) subject=xmlSecTransformCtxBinaryExecute keys.c:1370(xmlSecKeysMngrGetKey) subject=xmlSecKeysMngrFindKey xmlenc.c:957(xmlSecEncCtxEncDataNodeRead) errno=45 xmlenc.c:715(xmlSecEncCtxDecryptToBuffer) subject=xmlSecEncCtxEncDataNodeRead xmlenc.c:623(xmlSecEncCtxDecrypt) subject=xmlSecEncCtxDecryptToBuffer Error: Error('function decrypt', -1)
Any idea what is wrong?
error compiling from source
I'm trying to build the module from source using
python setup.py bdist_egg
I get the following error while trying to build. I'm probably missing some library, that I can't figure out.
Thank you.xmlsec-1.3.3/src/constants.c: In function 'PyXmlSec_ConstantsModule_Init': xmlsec-1.3.3/src/constants.c:433:33: error: 'xmlSecTransformXsltId' undeclared (first use in this function) tmp = PyXmlSec_TransformNew(xmlSec ## name ## Id); \ ^ /python-xmlsec/xmlsec-1.3.3/src/constants.c:452:5: note: in expansion of macro 'PYXMLSEC_ADD_TRANSFORM_CONSTANT' PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformXslt, "XSLT"); ^ xmlsec-1.3.3/src/constants.c:433:33: note: each undeclared identifier is reported only once for each function it appears in tmp = PyXmlSec_TransformNew(xmlSec ## name ## Id); \ ^ xmlsec-1.3.3/src/constants.c:452:5: note: in expansion of macro 'PYXMLSEC_ADD_TRANSFORM_CONSTANT' PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformXslt, "XSLT"); ^ error: command 'gcc' failed with exit status 1
Problem installing xmlsec on Mac 10.13.4, version 1.3.3
I have this error when trying to import
xmlsec
python -c "import xmlsec"
Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: dlopen(/usr/local/lib/python3.6/site-packages/xmlsec.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libcrypto.1.0.0.dylib Referenced from: /usr/local/lib/python3.6/site-packages/xmlsec.cpython-36m-darwin.so Reason: image not found
The lib seems to work fine when installing from the last master branch though:
pip install .
python -c "import xmlsec; print(xmlsec.version)"that gives
1.0.1.dev0
as output. By the way, the master version1.0.1.dev0
is supposed to be newer than the pypi version1.3.3
which doesn't seem to be the case.Below is my system information:
Mac 10.13.4
Python 3.6.5 installed with brew
libxmlsec1: stable 1.2.25 (bottled): installed with brew
libxml2: stable 2.9.7 (bottled), HEAD [keg-only]: installer with brewOutput of
pkg-config --cflags xmlsec1
-D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_CRYPTO_OPENSSL=1 -I/usr/local/Cellar/libxmlsec1/1.2.25/include/xmlsec1 -I/usr/local/opt/openssl/include -I/usr/include/libxml2
Error importing xmlsec: null argument to internal routine
I running into some trouble when building and using a manylinux1 wheel (https://github.com/pypa/manylinux). The docker image uses an old distro, CentOS 5, so I can't use
yum
to install all the dependencies as the packages don't meet the minimum requirements for python-xmlsec.So, I'm manually assembling most of the dependencies before building the wheel. I'm using openssl for libxmlsec's crypto library, e.g.
./configure --with-openssl=/usr/local/ssl && make && make install
.Everything builds just fine, but when I then pip install my wheel on my server and try to import xmlsec in python, I get this error:
jnorton$ pip install xmlsec-1.3.3-cp35-cp35m-manylinux1_x86_64.whl jnorton$ python -c "import xmlsec" func=xmlSecPtrListAdd:file=list.c:line=305:obj=unknown:subj=xmlSecPtrListIsValid(list):error=100:assertion: func=xmlSecKeyDataIdsRegister:file=keysdata.c:line=110:obj=unknown:subj=xmlSecPtrListAdd:error=1:xmlsec library function failed:dataId=aes func=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:file=dl.c:line=615:obj=aes:subj=xmlSecKeyDataIdsRegister:error=1:xmlsec library function failed: func=xmlSecOpenSSLInit:file=crypto.c:line=340:obj=unknown:subj=xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms:error=1:xmlsec library function failed: Traceback (most recent call last): File "<string>", line 1, in <module> SystemError: null argument to internal routine
Python version: 3.5.1
python-xmlsec version: 1.3.3
libxmlsec1 version: 1.2.25
libxml2 version: 2.9.8
libxslt version: 1.1.29
openssl version: 1.0.2ojnorton$ pkg-config --cflags xmlsec1 -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_OPENSSL_110=1 -DXMLSEC_CRYPTO_OPENSSL=1 -I/usr/include/libxml2 -I/usr/include/xmlsec1
Any tips for solving this? I realize this is a non-standard way of installing python-xmlsec, but it'd be great to find a way to make this work.
Side-note: I have gotten this wheel building to work with python-xmlsec 0.6.0 by using an older version of libxmlsec1, but I'd like to use the newest version of python-xmlsec if possible.
Also, if it's helpful, here's the libraries that get packaged in the xmlsec wheel:
jnorton$ ls venv/lib/python3.5/site-packages/.libsxmlsec/ libltdl-c1a91d42.so.7.3.1 libxml2-ef3ec899.so.2.9.8 libxmlsec1-177bee2c.so.1.2.25 libxslt-bcf758f0.so.1.1.29 libz-a147dcb0.so.1.2.3
Unable to install on Windows Server 2012
Hi, I'm trying to install this library on windows server 2012, but I get this error:
(demo32) C:\Users\patrick\Documents\sources\xmlsec-0.3.3 λ python setup.py install running install running bdist_egg running egg_info writing requirements to xmlsec.egg-info\requires.txt writing xmlsec.egg-info\PKG-INFO writing top-level names to xmlsec.egg-info\top_level.txt writing dependency_links to xmlsec.egg-info\dependency_links.txt reading manifest file 'xmlsec.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'xmlsec.egg-info\SOURCES.txt' installing library code to build\bdist.win32\egg running install_lib running build_py running build_ext skipping 'src\xmlsec\constants.c' Cython extension (up-to-date) building 'xmlsec.constants' extension C:\Users\patrick\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc -Ic:\users\patrick\documents\sources\xmlsec-0.3.3\.eggs\lxml-3.5.0-py2.7-win32.egg\lxml\includes -Ic:\users\patrick\documents\sources\xmlsec-0.3.3\.eggs\lxml-3.5.0-py2.7-win32.egg\lxml -IC:\Python27\include -IC:\Users\patrick\Documents\demo32\PC /Tcsrc\xmlsec\constants.c /Fobuild\temp.win32-2.7\Release\src\xmlsec\constants.obj -DXMLSEC_CRYPTO_OPENSSL=1 constants.c C:\Users\patrick\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\Libs /LIBPATH:C:\Users\patrick\Documents\demo32\libs /LIBPATH:C:\Users\patrick\Documents\demo32\PCbuild /EXPORT:initconstants build\temp.win32-2.7\Release\src\xmlsec\constants.obj /OUT:build\lib.win32-2.7\xmlsec\constants.pyd /IMPLIB:build\temp.win32-2.7\Release\src\xmlsec\constants.lib /MANIFESTFILE:build\temp.win32-2.7\Release\src\xmlsec\constants.pyd.manifest Creating library build\temp.win32-2.7\Release\src\xmlsec\constants.lib and object build\temp.win32-2.7\Release\src\xmlsec\constants.exp constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformSha512GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformSha384GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformSha256GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformSha224GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformSha1GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaOaepGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaPkcs1GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaSha512GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaSha384GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaSha256GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaSha224GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaSha1GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaRipemd160GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRsaMd5GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformRipemd160GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformMd5GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformHmacSha512GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformHmacSha384GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformHmacSha256GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformHmacSha224GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformHmacSha1GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformHmacRipemd160GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformHmacMd5GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformEcdsaSha512GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformEcdsaSha384GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformEcdsaSha256GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformEcdsaSha224GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformEcdsaSha1GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformDsaSha1GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformKWDes3GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformDes3CbcGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformKWAes256GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformKWAes192GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformKWAes128GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformAes256CbcGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformAes192CbcGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecOpenSSLTransformAes128CbcGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformVisa3DHackGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformRemoveXmlTagsC14NGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformXsltGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformXPointerGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformXPath2GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformXPathGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformEnvelopedGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformExclC14NWithCommentsGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformExclC14NGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformInclC14N11WithCommentsGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformInclC14N11GetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformInclC14NWithCommentsGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol _xmlSecTransformInclC14NGetKlass referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeKeyInfo referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeKeyReference referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeDataReference referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeReferenceList referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeCipherReference referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeCipherValue referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeCipherData referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeEncryptionProperty referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeEncryptionProperties referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeEncryptionMethod referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeEncryptedKey referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeEncryptedData referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeSignatureProperties referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeManifest referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeObject referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeDigestValue referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeDigestMethod referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeSignatureValue referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeSignatureMethod referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeCanonicalizationMethod referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeSignedInfo referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNodeSignature referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecTypeEncElement referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecTypeEncContent referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecSoap12Ns referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecSoap11Ns referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecXPointerNs referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecXPath2Ns referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecXPathNs referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecEncNs referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecDSigNs referenced in function _initconstants constants.obj : error LNK2019: unresolved external symbol __imp__xmlSecNs referenced in function _initconstants build\lib.win32-2.7\xmlsec\constants.pyd : fatal error LNK1120: 82 unresolved externals error: command 'C:\\Users\\patrick\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120
I also compiled xmlsec, openssl and libxml2 but I get this error no matter what. Is there anything I should try?
Add support for xmlSecTmplTransformAddC14NInclNamespaces
Hi,
For consuming a SOAP WebService with required Signature, the Transform should contain a InclusiveNamespaces tag, as defined in the EXC_C14.
Those call aren't implemente yet in the python-xmlsec wrapper.
windows binaries will be removed on 17th June 2018 from ci.appveyor.com
Subj, need to find other place to host this binaries.
Issue with 1.0.4 on alpine linux xmlsec 1.2.22-r1 (Reopen #26)
It appears that issue #26 has resurfaced, now that the module was rewritten in C...
I'm getting
In file included from ./src/constants.c:10:0: ./src/constants.c: In function 'PyXmlSec_ConstantsModule_Init': ./src/constants.c:278:50: error: 'xmlSecXkmsNs' undeclared (first use in this function) tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \ ^ ./src/common.h:25:23: note: in definition of macro 'DO_JOIN2' #define DO_JOIN2(X,Y) X##Y ^ ./src/common.h:23:19: note: in expansion of macro 'DO_JOIN1' #define JOIN(X,Y) DO_JOIN1(X,Y) ^~~~~~~~ ./src/constants.c:278:45: note: in expansion of macro 'JOIN' tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \ ^~~~ ./src/constants.c:287:5: note: in expansion of macro 'PYXMLSEC_ADD_NS_CONSTANT' PYXMLSEC_ADD_NS_CONSTANT(XkmsNs, "XKMS"); ^~~~~~~~~~~~~~~~~~~~~~~~ ./src/constants.c:278:50: note: each undeclared identifier is reported only once for each function it appears in tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \ ^ ./src/common.h:25:23: note: in definition of macro 'DO_JOIN2' #define DO_JOIN2(X,Y) X##Y ^ ./src/common.h:23:19: note: in expansion of macro 'DO_JOIN1' #define JOIN(X,Y) DO_JOIN1(X,Y) ^~~~~~~~ ./src/constants.c:278:45: note: in expansion of macro 'JOIN' tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \ ^~~~ ./src/constants.c:287:5: note: in expansion of macro 'PYXMLSEC_ADD_NS_CONSTANT' PYXMLSEC_ADD_NS_CONSTANT(XkmsNs, "XKMS"); ^~~~~~~~~~~~~~~~~~~~~~~~ error: command 'gcc' failed with exit status 1 ----------------------------------------
Trying to pip install python-xmlsec 1.0.4 with xmlsec version 1.2.22-r1 on alpine 3.4
Question regarding xmlsec.SignatureContext.sign
Hi,
I just wanted to check if there is a way to force xmlsec.SignatureContext.sign to include the<X509SubjectName>
and<X509IssuerSerial>
tags while signing xml documents.Right now, I'm doing this (most of the code is taken from the
test_sign_generated_template_pem_with_x509
method intest_sign.py
)root_node = etree.fromstring(xmlstr) signature_node = xmlsec.template.create(root_node, xmlsec.Transform.EXCL_C14N, xmlsec.Transform.RSA_SHA1) root_node.append(signature_node) # Add the <ds:Reference/> node to the signature template. ref = xmlsec.template.add_reference(signature_node, xmlsec.Transform.SHA1) # Add the enveloped transform descriptor. xmlsec.template.add_transform(ref, xmlsec.Transform.ENVELOPED) # Add the <ds:KeyInfo/> and <ds:KeyName/> nodes. key_info = xmlsec.template.ensure_key_info(signature_node) xmlsec.template.add_x509_data(key_info) # Create a digital signature context (no key manager is needed). ctx = xmlsec.SignatureContext() # Load private key (assuming that there is no password). filename = 'public-pk.pem' key = xmlsec.Key.from_file(filename, xmlsec.KeyFormat.PEM, '<password>') assert key is not None # Load the certificate and add it to the key. filename = 'public-cert.pem' key.load_cert_from_file(filename, xmlsec.KeyFormat.PEM) # Set key name to the file name (note: this is just a test). key.name = os.path.basename(filename) # Set the key on the context. ctx.key = key ctx.sign(signature_node)
Thanks,
Naresh/
Check that package correctness before upload to pip
Version 1.3.2 was broken and CI did not recognise this.
Need to add tests to make sure that package is correct, before uploading to PIP.[deploy] added valid pypi token for auto-deployment from travis.
need to add credentials for pypi into travis.yaml. the detailed instructions can be found here:
https://docs.travis-ci.com/user/deployment/pypi/Symbol not found: _xmlFree on OS X
Installed the latest version of python-xmlsec (1.0.7) via pip, but now my tests break with:
../.virtualenvs/avail_api/lib/python3.4/site-packages/py/_path/local.py:650: in pyimport __import__(modname) avail_api/__init__.py:26: in <module> from avail_api.views.v1.saml_auth import add_saml_auth_routes avail_api/views/v1/saml_auth.py:11: in <module> from onelogin.saml2.auth import OneLogin_Saml2_Auth ../.virtualenvs/avail_api/lib/python3.4/site-packages/onelogin/saml2/auth.py:14: in <module> import xmlsec E ImportError: dlopen(/Users/charles/.virtualenvs/avail_api/lib/python3.4/site-packages/xmlsec.so, 2): Symbol not found: _xmlFree E Referenced from: /Users/charles/.virtualenvs/avail_api/lib/python3.4/site-packages/xmlsec.so E Expected in: flat namespace E in /Users/charles/.virtualenvs/avail_api/lib/python3.4/site-packages/xmlsec.so
I've previously installed it successfully in one venv on my machine, but for the life of me cannot reproduce that successful reinstall. I know very little about compilation, but I suspect that the important difference between the working and non-working copies is what libraries they're linked to.
Good (unrepeatable) install:
$ otool -L /Users/charles/.virtualenvs/$VENV/lib/python3.4/site-packages/xmlsec.so /Users/charles/.virtualenvs/pysaml/lib/python3.4/site-packages/xmlsec.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0) /usr/local/opt/libxslt/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.29.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/local/opt/libxmlsec1/lib/libxmlsec1.1.dylib (compatibility version 4.0.0, current version 4.20.0) /usr/local/opt/libxml2/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.4.0) /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /usr/local/opt/libxmlsec1/lib/libxmlsec1-openssl.1.dylib (compatibility version 4.0.0, current version 4.20.0) /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
Bad (consistent) installs:
$ otool -L /Users/charles/.virtualenvs/avail_api/lib/python3.4/site-packages/xmlsec.so /Users/charles/.virtualenvs/avail_api/lib/python3.4/site-packages/xmlsec.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
The reason I calls those bad is because they link to the system install, which doesn't have a matching symbol:
$ nm /usr/lib/libSystem.B.dylib | grep _xmlFree
But the brew-installed libxml2 does:
$ nm /usr/local/opt/libxml2/lib/libxml2.2.dylib | grep _xmlFree 00000000000f7b18 D _xmlFree
Some version info, which will hopefully help:
- OS X: Yosemite (10.10.5 (14F2315))
- Python: 3.4.2
- libxml2 (homebrew): stable 2.9.4 (bottled), HEAD [keg-only]
- libxmlsec1 (homebrew): stable 1.2.20 (bottled)
- libxslt (homebrew): stable 1.1.29 (bottled), HEAD [keg-only]
Have tried adding all the things I see in the good one as C_INCLUDE_PATH, i.e., export C_INCLUDE_PATH="/usr/local/opt/libxmlsec1/include/:/usr/local/opt/libxml2/include/:/usr/local/opt/libxslt/include/", but none of them get linked in the final .so file. Also, to get it to build, I have to set CFLAGS+="-g $(xmlsec1-config --cflags)", otherwise I get the error:
In file included from ./src/constants.c:11: In file included from ./src/constants.h:13: ./src/platform.h:15:10: fatal error: 'xmlsec/version.h' file not found #include <xmlsec/version.h> ^ 1 error generated. error: command 'clang' failed with exit status 1
error: lvalue required as left operand of assignment while installing on ubuntu.
error: lvalue required as left operand of assignment Installing collected packages: pyyaml, boto, peewee, couchbase, bottle, markupsafe, jinja2, beaker, idna, pyasn1, six, pycparser, cffi, cryptography, pyopenssl, lxml, xmlsec, isodate, python3-saml, filechunkio, python-dateutil, pytz, raven, pymysql, cherrypy Running setup.py install for xmlsec Complete output from command /webapplication/venv/pancake/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-aijzb_28/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-41kah7g8-record/install-record.txt --single-version-externally-managed --compile --install-headers /webapplication/venv/pancake/include/site/python3.4/xmlsec: running install running build running build_py running build_ext skipping 'src/xmlsec/constants.c' Cython extension (up-to-date) skipping 'src/xmlsec/utils.c' Cython extension (up-to-date) skipping 'src/xmlsec/tree.c' Cython extension (up-to-date) skipping 'src/xmlsec/key.c' Cython extension (up-to-date) skipping 'src/xmlsec/ds.c' Cython extension (up-to-date) skipping 'src/xmlsec/enc.c' Cython extension (up-to-date) building 'xmlsec.enc' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DXMLSEC_NO_SIZE_T= -DXMLSEC_NO_GOST=1 -DXMLSEC_CRYPTO=openssl -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_OPENSSL_098=1 -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_NO_XKMS=1 -Isrc -I/webapplication/venv/pancake/lib/python3.4/site-packages/lxml/includes -I/webapplication/venv/pancake/lib/python3.4/site-packages/lxml -I/usr/include/libxml2 -I/usr/include/xmlsec1 -I/usr/include/python3.4m -I/webapplication/venv/pancake/include/python3.4m -c src/xmlsec/enc.c -o build/temp.linux-x86_64-3.4/src/xmlsec/enc.o -DXMLSEC_CRYPTO_OPENSSL=1 src/xmlsec/enc.c: In function ‘__pyx_import_star_set’: src/xmlsec/enc.c:3384:37: error: lvalue required as left operand of assignment XMLSEC_ENC_RETURN_REPLACED_NODE = __Pyx_PyInt_As_unsigned_int(o); if ((XMLSEC_ENC_RETURN_REPLACED_NODE == (unsigned int)-1) && PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L2_error;}; ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I'm trying to install xmlsec==0.3.1 via
pip install xmlsec
, however, it fails with the previous errors.I already installed libxml2-dev and libxmlsec1-dev as the instruction.
How can I install it?
Signing with Smart Card
Hello,
I am trying to sign with a smart card but I couldn't find a way to do this. Is there a method for that ?
Thanks.
Move documentation to https://readthedocs.org/
Uploading to pythonhosted.org is not supported anymore.
Upload_docs command is deprecated. Use RTD instead. Submitting documentation to https://upload.pypi.org/legacy/ Upload failed (410): Uploading documentation is no longer supported, we recommend using https://readthedocs.org/.
It needs to move documentation to https://readthedocs.org/
xmlsec package installation on windows failing
I am trying to install xmlsec package on windows but it failing. I tried to use the pre-build binaries for the required packages of libxml2, libxslt but still its failing to install. FOllowing are the minimal logs(otherwise it pretty long list)
constants.obj : warning LNK4217: locally defined symbol xmlSecNs imported in function initconstants
libxmlsec.lib(xmlenc.o) : warning LNK4217: locally defined symbol xmlMalloc imported in function xmlSecEncCtxXmlEncrypt
libxmlsec.lib(keysmngr.o) : warning LNK4217: locally defined symbol xmlMalloc imported in function xmlSecSimpleKeysStoreFindKey
libxmlsec.lib(base64.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(io.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(keyinfo.o) : warning LNK4217: locally defined symbol xmlMalloc imported in function xmlSecKeyInfoNodeRead
libxmlsec.lib(keys.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(transforms.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(xmltree.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(buffer.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(keysdata.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(xpath.o) : warning LNK4217: locally defined symbol xmlMalloc imported in function xmlSecXPathDataCreate
libxmlsec.lib(dl.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(nodeset.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(list.o) : warning LNK4049: locally defined symbol xmlMalloc imported
libxmlsec.lib(keys.o) : warning LNK4049: locally defined symbol xmlFree imported
libxmlsec.lib(xmlenc.o) : warning LNK4217: locally defined symbol xmlFree imported in function xmlSecEncCtxEncDataNodeReadCan you please provide definite steps to install this package on windows?
I can not install xmlsec on Windows
Command "python setup.px egg_info" failed with error code 1 in c:\Usrers.....
This my error,
KeysManager not freeing memory after use
With xmlsec==1.0.9, this function uses ~1MB of memory for
xmlsec.KeysManager()
on each call, that is never freed. With xmlsec==0.6.1, the memory seems to be freed when exiting the function.def _encrypt_usernametoken(self, envelope): """Encrypt the ``UsernameToken`` element in the ``envelope``.""" header = envelope.find(ns(SOAP_NS, 'Header')) security = header.find(ns(WSSE_NS, 'Security')) # Create a keys manager and load the cert into it. manager = xmlsec.KeysManager() key = xmlsec.Key.from_file(self.recipient_cert, xmlsec.KeyFormat.CERT_PEM) manager.add_key(key) # Encrypt the UsernameToken target = security.find(ns(WSSE_NS, 'UsernameToken')) # Create the EncryptedData node we will replace the target node with, # and make sure it has the contents XMLSec expects (a CipherValue node, # a KeyInfo node, and an EncryptedKey node within the KeyInfo which # itself has a CipherValue). enc_data = xmlsec.template.encrypted_data_create( envelope, xmlsec.Transform.DES3, type=xmlsec.EncryptionType.ELEMENT, ns='xenc', ) xmlsec.template.encrypted_data_ensure_cipher_value(enc_data) key_info = xmlsec.template.encrypted_data_ensure_key_info( enc_data, ns='dsig') enc_key = xmlsec.template.add_encrypted_key( key_info, # Service requires RSA 1.5 encryption, which is the same as RSA # PKCS1. xmlsec.Transform.RSA_PKCS1, ) xmlsec.template.encrypted_data_ensure_cipher_value(enc_key) enc_ctx = xmlsec.EncryptionContext(manager) # Generate a per-session DES key (will be encrypted using the cert). enc_ctx.key = xmlsec.Key.generate( xmlsec.KeyData.DES, 192, xmlsec.KeyDataType.SESSION) # Ask XMLSec to actually do the encryption. enc_data = enc_ctx.encrypt_xml(enc_data, target) # XMLSec inserts the EncryptedKey node directly within EncryptedData, # but WSSE wants it in the Security header instead, and referencing the # EncryptedData as well as the actual cert in a BinarySecurityToken. # Move the EncryptedKey node up into the wsse:Security header. security.insert(0, enc_key) # Create a wsse:BinarySecurityToken node containing the cert and add it # to the Security header. cert_bst = create_binary_security_token(self.recipient_cert) security.insert(0, cert_bst) # Create a ds:KeyInfo node referencing the BinarySecurityToken we just # created, and insert it into the EncryptedKey node. enc_key.insert(1, create_key_info_bst(cert_bst)) # Add a DataReference from the EncryptedKey node to the EncryptedData. add_data_reference(enc_key, enc_data) # Remove the now-empty KeyInfo node from EncryptedData (it used to # contain EncryptedKey, but we moved that up into the Security header). enc_data.remove(key_info)
It also looks like our signing function leaks ~0.1MB/call with xmlsec==1.0.9:
def _sign(self, envelope): """Sign the ``soap:Body`` and ``wsu:Timestamp`` of ``envelope``.""" # Insert the Signature node in the wsse:Security header. header = envelope.find(ns(SOAP_NS, 'Header')) security = header.find(ns(WSSE_NS, 'Security')) cert_bst = create_binary_security_token(self.sender_cert) security.append(cert_bst) # Create the Signature node. signature = xmlsec.template.create( envelope, xmlsec.Transform.EXCL_C14N, xmlsec.Transform.RSA_SHA1, ) key_info = create_key_info_bst(cert_bst) signature.append(key_info) security.append(signature) # Perform the actual signing. ctx = xmlsec.SignatureContext() ctx.key = xmlsec.Key.from_file(self.sender_key, xmlsec.KeyFormat.PEM) _sign_node(ctx, signature, envelope.find(ns(SOAP_NS, 'Body'))) _sign_node(ctx, signature, security.find(ns(WSU_NS, 'Timestamp'))) ctx.sign(signature)
Error: (4, 'cannot read key')
Hi,
When I do
key = xmlsec.Key.from_file('~/signing_key.pem',xmlsec.constants.KeyDataFormatPem)
Getting Error: (4, 'cannot read key')Unable to find why is it failing to read the private key file.
v0.3.3 broken on gcc 4.x (so it appears)
Build error on Ubuntu 16.04 LTS, Python 3.6
Hi I'm currently on Ubuntu 16.04 LTS, using Python 3.6.3
After having installedlibxml2-dev libxmlsec1-dev libxmlsec1-openssl
and plenty of other libs I can't install correctly xmlsecAlready installed xml lib :
dpkg -l | grep xml ii libqt4-xml:amd64 4:4.8.7+dfsg-5ubuntu2 amd64 Qt 4 XML module ii libqt4-xmlpatterns:amd64 4:4.8.7+dfsg-5ubuntu2 amd64 Qt 4 XML patterns module ii libqt5xml5:amd64 5.5.1+dfsg-16ubuntu7.5 amd64 Qt 5 XML module ii libxml-parser-perl 2.44-1build1 amd64 Perl module for parsing XML files ii libxml-twig-perl 1:3.48-1 all Perl module for processing huge XML documents in tree mode ii libxml-xpathengine-perl 0.13-1 all re-usable XPath engine for DOM-like trees ii libxml2:amd64 2.9.3+dfsg1-1ubuntu0.5 amd64 GNOME XML library ii libxml2-dev:amd64 2.9.3+dfsg1-1ubuntu0.5 amd64 Development files for the GNOME XML library ii libxmlsec1 1.2.20-2ubuntu4 amd64 XML security library ii libxmlsec1-dev 1.2.20-2ubuntu4 amd64 Development files for the XML security library ii libxmlsec1-gcrypt 1.2.20-2ubuntu4 amd64 Gcrypt engine for the XML security library ii libxmlsec1-gnutls 1.2.20-2ubuntu4 amd64 Gnutls engine for the XML security library ii libxmlsec1-nss 1.2.20-2ubuntu4 amd64 Nss engine for the XML security library ii libxmlsec1-openssl 1.2.20-2ubuntu4 amd64 Openssl engine for the XML security library ii python3-lxml 3.5.0-1build1 amd64 pythonic binding for the libxml2 and libxslt libraries ii xml-core 0.13+nmu2 all XML infrastructure and XML catalog file support
The following error is occuring when I
pip install xmlsec
:Using cached xmlsec-1.3.3.tar.gz Requirement already satisfied: pkgconfig in /home/valentin/workspace/hxp/lib/python3.6/site-packages (from xmlsec) Requirement already satisfied: lxml>=3.0 in /home/valentin/workspace/hxp/lib/python3.6/site-packages (from xmlsec) Building wheels for collected packages: xmlsec Running setup.py bdist_wheel for xmlsec ... error Complete output from command /home/valentin/workspace/hxp/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ycws7_21/xmlsec/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/tmp5cc64v0spip-wheel- --python-tag cp36: running bdist_wheel running build running build_ext building 'xmlsec' extension creating build creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/tmp creating build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21 creating build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21/xmlsec creating build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21/xmlsec/src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.3.3 -DXMLSEC_CRYPTO="openssl" -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_OPENSSL_100=1 -DXMLSEC_CRYPTO_OPENSSL=1 -I/usr/include/libxml2 -I/usr/include/xmlsec1 -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/libexslt -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/libxml -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/__pycache__ -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/libxslt -I/usr/include/python3.6m -I/home/valentin/workspace/hxp/include/python3.6m -c /tmp/pip-build-ycws7_21/xmlsec/src/template.c -o build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21/xmlsec/src/template.o -g -std=c99 -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os In file included from /tmp/pip-build-ycws7_21/xmlsec/src/template.c:11:0: /tmp/pip-build-ycws7_21/xmlsec/src/platform.h:16:20: fatal error: Python.h: Aucun fichier ou dossier de ce type compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Failed building wheel for xmlsec Running setup.py clean for xmlsec Failed to build xmlsec Installing collected packages: xmlsec Running setup.py install for xmlsec ... error Complete output from command /home/valentin/workspace/hxp/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ycws7_21/xmlsec/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-5ez67kti-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/valentin/workspace/hxp/include/site/python3.6/xmlsec: running install running build running build_ext building 'xmlsec' extension creating build creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/tmp creating build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21 creating build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21/xmlsec creating build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21/xmlsec/src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.3.3 -DXMLSEC_CRYPTO="openssl" -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_OPENSSL_100=1 -DXMLSEC_CRYPTO_OPENSSL=1 -I/usr/include/libxml2 -I/usr/include/xmlsec1 -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/libexslt -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/libxml -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/__pycache__ -I/home/valentin/workspace/hxp/lib/python3.6/site-packages/lxml/includes/libxslt -I/usr/include/python3.6m -I/home/valentin/workspace/hxp/include/python3.6m -c /tmp/pip-build-ycws7_21/xmlsec/src/template.c -o build/temp.linux-x86_64-3.6/tmp/pip-build-ycws7_21/xmlsec/src/template.o -g -std=c99 -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os In file included from /tmp/pip-build-ycws7_21/xmlsec/src/template.c:11:0: /tmp/pip-build-ycws7_21/xmlsec/src/platform.h:16:20: fatal error: Python.h: Aucun fichier ou dossier de ce type compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Command "/home/valentin/workspace/hxp/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ycws7_21/xmlsec/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-5ez67kti-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/valentin/workspace/hxp/include/site/python3.6/xmlsec" failed with error code 1 in /tmp/pip-build-ycws7_21/xmlsec/
Can anyone help me ?
fatal error: Python.h: No such file or directory
During installation, I'm getting the following error.
(rcn) [root@bhs01 shortener]# pip install xmlsec Collecting xmlsec Using cached xmlsec-0.6.1.tar.gz Requirement already satisfied (use --upgrade to upgrade): lxml>=3.0 in /root/project/rcn/lib/python3.4/site-packages (from xmlsec) Building wheels for collected packages: xmlsec Running setup.py bdist_wheel for xmlsec ... error Complete output from command /root/project/rcn/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1ctsfpg5/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpl926zohtpip-wheel- --python-tag cp34: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.4 creating build/lib.linux-x86_64-3.4/xmlsec copying src/xmlsec/meta.py -> build/lib.linux-x86_64-3.4/xmlsec copying src/xmlsec/error.py -> build/lib.linux-x86_64-3.4/xmlsec copying src/xmlsec/__init__.py -> build/lib.linux-x86_64-3.4/xmlsec running build_ext cythoning src/xmlsec/constants.pyx to src/xmlsec/constants.c building 'xmlsec.constants' extension creating build/temp.linux-x86_64-3.4 creating build/temp.linux-x86_64-3.4/src creating build/temp.linux-x86_64-3.4/src/xmlsec gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DXMLSEC_DL_LIBLTDL=1 -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_CRYPTO=openssl -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_OPENSSL_100=1 -DXMLSEC_NO_XKMS=1 -DXMLSEC_CRYPTO_OPENSSL=1 -Isrc -I/root/project/rcn/lib/python3.4/site-packages/lxml/includes -I/root/project/rcn/lib/python3.4/site-packages/lxml -I/usr/include/libxml2 -I/usr/include/xmlsec1 -I/usr/include/python3.4m -c src/xmlsec/constants.c -o build/temp.linux-x86_64-3.4/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/constants.c:4:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for xmlsec Running setup.py clean for xmlsec Failed to build xmlsec Installing collected packages: xmlsec Running setup.py install for xmlsec ... error Complete output from command /root/project/rcn/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1ctsfpg5/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-pbn875fk-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/project/rcn/include/site/python3.4/xmlsec: running install running build running build_py creating build creating build/lib.linux-x86_64-3.4 creating build/lib.linux-x86_64-3.4/xmlsec copying src/xmlsec/meta.py -> build/lib.linux-x86_64-3.4/xmlsec copying src/xmlsec/error.py -> build/lib.linux-x86_64-3.4/xmlsec copying src/xmlsec/__init__.py -> build/lib.linux-x86_64-3.4/xmlsec running build_ext skipping 'src/xmlsec/constants.c' Cython extension (up-to-date) building 'xmlsec.constants' extension creating build/temp.linux-x86_64-3.4 creating build/temp.linux-x86_64-3.4/src creating build/temp.linux-x86_64-3.4/src/xmlsec gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DXMLSEC_CRYPTO=openssl -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_XKMS=1 -D__XMLSEC_FUNCTION__=__FUNCTION__ -DXMLSEC_NO_GOST=1 -DXMLSEC_OPENSSL_100=1 -DXMLSEC_NO_SIZE_T= -DXMLSEC_DL_LIBLTDL=1 -Isrc -I/root/project/rcn/lib/python3.4/site-packages/lxml/includes -I/root/project/rcn/lib/python3.4/site-packages/lxml -I/usr/include/libxml2 -I/usr/include/xmlsec1 -I/usr/include/python3.4m -c src/xmlsec/constants.c -o build/temp.linux-x86_64-3.4/src/xmlsec/constants.o -DXMLSEC_CRYPTO_OPENSSL=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 src/xmlsec/constants.c:4:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated. error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/root/project/rcn/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1ctsfpg5/xmlsec/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-pbn875fk-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/project/rcn/include/site/python3.4/xmlsec" failed with error code 1 in /tmp/pip-build-1ctsfpg5/xmlsec/
I have followed the readme file and installed all the dependencies before running pip install xmlsec.
I'm on CentOS 7. Python 3.4. My env has an entry for C_INCLUDE_PATH as the following -
C_INCLUDE_PATH=/usr/include/xmlsec1:/usr/include/libxml2
Segmentation fault when executing dsig_ctx.verify with Python3
I tested and using Python2 works.
I was executing testValidateSign from python3-saml and got a segmentation fault when executed
OneLogin_Saml2_Utils.validate_metadata_sign(xml_metadata_signed, cert, validatecert=True)
that internally executes:
manager = xmlsec.KeysManager() manager.load_cert_from_memory(cert, xmlsec.KeyFormat.CERT_PEM, xmlsec.KeyDataType.TRUSTED) dsig_ctx = xmlsec.SignatureContext(manager) dsig_ctx.set_enabled_key_data([xmlsec.KeyData.X509]) dsig_ctx.verify(signature_node)
and this last command throw the segmentation fault.
If instead I executes
dsig_ctx = xmlsec.SignatureContext() dsig_ctx.key = xmlsec.Key.from_memory(cert, xmlsec.KeyFormat.CERT_PEM, None) dsig_ctx.set_enabled_key_data([xmlsec.KeyData.X509]) dsig_ctx.verify(signature_node)
or run Python2 instead of Python3, it works as expected
so something is wrong on Python3 with the use of the Manager and xmlsec.KeyDataType.TRUSTED
It used to work time ago.I'm using
Python 3.4.3 .... lxml==3.5.0 xmlsec==0.5.0
I hope you will be able to reproduce and fix.
Best regards.
Flask debug=True causes TypeError with xmlsec
Hello,
Running a Flask app with debug=True (app.run(debug=True)) returns a TypeError when attempting to enable debugging for xmlsec:
xmlsec.enable_debug_trace(debug)
e.g. in https://github.com/onelogin/python3-saml/blob/master/src/onelogin/saml2/utils.py#L557
Using a 0 or 1 instead of True/False works correctly.
I am using xmlsec 0.3.3.
I was asked to open an issue here -- I originally reported with OneLogin but was asked to open one here:
Support for Python 3.4
is
python-xmlsec
compatible with Python 3.4+?Symbol not found: _xmlSecDSigNs
I installed python-xmlsec on Mac OS X 10.10.5, using libxml2 2.9.3 and libxmlsec1 1.2.20.
However, I cannot
import libxmlsec
with both Python 2.7 and Python 3.4. I get the following ImportError:ImportError: dlopen(/usr/local/[…]/xmlsec/constants.so, 2): Symbol not found: _xmlSecDSigNs
Referenced from: /usr/local/[…]/xmlsec/constants.so
Expected in: flat namespace
in /usr/local/[…]/xmlsec/constants.soI tried compilling with both clang and gcc-4.9, but I still get this error. I'm not sure where it is coming from. Someone else experienced this with Ruby, but the solution proposed (remove and re-install libxml2 and libxmlsec1) doesn't work on my system.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.