Support for libxmlsec-1.3.0
tdivis opened this issue · 24 comments
Support for libxmlsec-1.3.0.
@lsh123 is preparing release libxmlsec-1.3.0, we should prepare support in python-xmlsec.
Thanks, it would be great if you can check out one of the RC builds (currently RC3) to ensure there are no issues. I plan to have the release out by mid April as usual:
I started with removing Soap constants as soap support was removed in libxmlsec-1.3.0. Then I run into segfaults in tests probably because of md5 is now disabled in libxmlsec-1.3.0 by default, but even with --enable-md5 in configure, it still segfaults. Other tests also behave strangely as well, including infinitive waiting.
As I'm Python programmer and have limited knowledge of C programming and cryptography, I'm afraid that someone else will have to do this :-(. I think @hoefling has some ways to (re)generate stubs etc. but it's not documented.
Still and issue. Holding off on upgrading libxmlsec specifically for this dependency and this one alone.
Note that libxmlsec 1.3.0 breaks ABI compatibility and requires re-building of dependencies.
Any updates on this?
+1
This appears to now break the ability to install python-xmlsec
on a Mac if you've installed libxmlsec1 via homebrew as now brew installs 1.3.0 of that library. Related issue: #254
Any ETA about this ? Thank you in advance.
Any updates? Running into this issue with python-xmlsec version 1.3.13
Do you plan to support it soon? It is extremely hard to install the previous version now on Mac with Brew
Is there a list of what needs to be done to support this? I'm assuming that requiring pre 1.3.0 versions of xmlsec isn't a longterm solution. At the moment, it has a knockon effect that it breaks python3-saml.
Just tested master + 036f658 and module builds but pytest is failing
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.13-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.13-4.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13
plugins: xdist-3.3.1, timeout-2.1.0, rerunfailures-11.1.2, hypothesis-6.75.3
collected 291 items / 1 skipped
tests/test_xmlsec.py . [ 0%]
tests/test_constants.py ............................................................................................................................ [ 42%]
tests/test_doc_examples.py FF.... [ 45%]
tests/test_ds.py ........................................ [ 58%]
tests/test_enc.py FEFE.FE.FE..FE..FE............ [ 67%]
tests/test_keys.py ......................................... [ 81%]
tests/test_main.py ............. [ 85%]
tests/test_templates.py .................................. [ 97%]
tests/test_tree.py ........ [100%]
========================================================================================== ERRORS ===========================================================================================
_________________________________________________________________ ERROR at teardown of TestEncryptionContext.test_decrypt1 __________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt1>
def test_decrypt1(self):
> self.check_decrypt(1)
tests/test_enc.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt1>, i = 1
def check_decrypt(self, i):
root = self.load_xml('enc{}-out.xml'.format(i))
enc_data = xmlsec.tree.find_child(root, consts.NodeEncryptedData, consts.EncNs)
self.assertIsNotNone(enc_data)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsakey.pem"), format=consts.KeyDataFormatPem))
ctx = xmlsec.EncryptionContext(manager)
> decrypted = ctx.decrypt(enc_data)
E xmlsec.Error: (1, 'failed to decrypt')
tests/test_enc.py:228: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
_________________________________________________________________ ERROR at teardown of TestEncryptionContext.test_decrypt2 __________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt2>
def test_decrypt2(self):
> self.check_decrypt(2)
tests/test_enc.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt2>, i = 2
def check_decrypt(self, i):
root = self.load_xml('enc{}-out.xml'.format(i))
enc_data = xmlsec.tree.find_child(root, consts.NodeEncryptedData, consts.EncNs)
self.assertIsNotNone(enc_data)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsakey.pem"), format=consts.KeyDataFormatPem))
ctx = xmlsec.EncryptionContext(manager)
> decrypted = ctx.decrypt(enc_data)
E xmlsec.Error: (1, 'failed to decrypt')
tests/test_enc.py:228: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
________________________________________________________________ ERROR at teardown of TestEncryptionContext.test_decrypt_key ________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt_key>
def test_decrypt_key(self):
root = self.load_xml('enc3-out.xml')
enc_key = xmlsec.tree.find_child(root, consts.NodeEncryptedKey, consts.EncNs)
self.assertIsNotNone(enc_key)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsakey.pem"), format=consts.KeyDataFormatPem))
ctx = xmlsec.EncryptionContext(manager)
> keydata = ctx.decrypt(enc_key)
E xmlsec.Error: (1, 'failed to decrypt')
tests/test_enc.py:210: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
______________________________________________________________ ERROR at teardown of TestEncryptionContext.test_encrypt_binary _______________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_encrypt_binary>
def test_encrypt_binary(self):
root = self.load_xml('enc2-in.xml')
enc_data = xmlsec.template.encrypted_data_create(
root, consts.TransformAes128Cbc, type=consts.TypeEncContent, ns="xenc", mime_type="binary/octet-stream"
)
xmlsec.template.encrypted_data_ensure_cipher_value(enc_data)
ki = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig")
ek = xmlsec.template.add_encrypted_key(ki, consts.TransformRsaOaep)
xmlsec.template.encrypted_data_ensure_cipher_value(ek)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsacert.pem"), format=consts.KeyDataFormatCertPem))
ctx = xmlsec.EncryptionContext(manager)
ctx.key = xmlsec.Key.generate(consts.KeyDataAes, 128, consts.KeyDataTypeSession)
> encrypted = ctx.encrypt_binary(enc_data, b'test')
E xmlsec.Error: (1, 'failed to encrypt binary')
tests/test_enc.py:125: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
________________________________________________________________ ERROR at teardown of TestEncryptionContext.test_encrypt_uri ________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_encrypt_uri>
def test_encrypt_uri(self):
root = self.load_xml('enc2-in.xml')
enc_data = xmlsec.template.encrypted_data_create(
root, consts.TransformAes128Cbc, type=consts.TypeEncContent, ns="xenc", mime_type="binary/octet-stream"
)
xmlsec.template.encrypted_data_ensure_cipher_value(enc_data)
ki = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig")
ek = xmlsec.template.add_encrypted_key(ki, consts.TransformRsaOaep)
xmlsec.template.encrypted_data_ensure_cipher_value(ek)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsacert.pem"), format=consts.KeyDataFormatCertPem))
ctx = xmlsec.EncryptionContext(manager)
ctx.key = xmlsec.Key.generate(consts.KeyDataAes, 128, consts.KeyDataTypeSession)
with tempfile.NamedTemporaryFile(delete=False) as tmpfile:
tmpfile.write(b'test')
> encrypted = ctx.encrypt_binary(enc_data, 'file://' + tmpfile.name)
E xmlsec.Error: (1, 'failed to encrypt binary')
tests/test_enc.py:170: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
________________________________________________________________ ERROR at teardown of TestEncryptionContext.test_encrypt_xml ________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_encrypt_xml>
def test_encrypt_xml(self):
root = self.load_xml('enc1-in.xml')
enc_data = xmlsec.template.encrypted_data_create(root, consts.TransformAes128Cbc, type=consts.TypeEncElement, ns="xenc")
xmlsec.template.encrypted_data_ensure_cipher_value(enc_data)
ki = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig")
ek = xmlsec.template.add_encrypted_key(ki, consts.TransformRsaOaep)
xmlsec.template.encrypted_data_ensure_cipher_value(ek)
data = root.find('./Data')
self.assertIsNotNone(data)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsacert.pem"), format=consts.KeyDataFormatCertPem))
ctx = xmlsec.EncryptionContext(manager)
ctx.key = xmlsec.Key.generate(consts.KeyDataAes, 128, consts.KeyDataTypeSession)
> encrypted = ctx.encrypt_xml(enc_data, data)
E xmlsec.Error: (1, 'failed to encrypt xml')
tests/test_enc.py:71: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
========================================================================================= FAILURES ==========================================================================================
_______________________________________________________________________________ test_doc_example[decrypt.py] ________________________________________________________________________________
example = PosixPath('/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/doc/source/examples/decrypt.py')
@pytest.mark.parametrize('example', examples, ids=lambda p: p.name)
def test_doc_example(example):
"""
Verify example scripts included in the docs are up to date.
Execute each script in :file:`docs/source/examples`,
not raising any errors is good enough.
"""
with cd(example.parent):
> runpy.run_path(str(example))
tests/test_doc_examples.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/runpy.py:265: in run_path
return _run_module_code(code, init_globals, run_name,
/usr/lib64/python3.8/runpy.py:97: in _run_module_code
_run_code(code, mod_globals, init_globals,
/usr/lib64/python3.8/runpy.py:87: in _run_code
exec(code, run_globals)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
from lxml import etree
import xmlsec
manager = xmlsec.KeysManager()
key = xmlsec.Key.from_file('rsakey.pem', xmlsec.constants.KeyDataFormatPem)
manager.add_key(key)
enc_ctx = xmlsec.EncryptionContext(manager)
root = etree.parse("enc1-res.xml").getroot()
enc_data = xmlsec.tree.find_child(root, "EncryptedData", xmlsec.constants.EncNs)
> decrypted = enc_ctx.decrypt(enc_data)
E xmlsec.Error: (1, 'failed to decrypt')
doc/source/examples/decrypt.py:11: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
_______________________________________________________________________________ test_doc_example[encrypt.py] ________________________________________________________________________________
example = PosixPath('/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/doc/source/examples/encrypt.py')
@pytest.mark.parametrize('example', examples, ids=lambda p: p.name)
def test_doc_example(example):
"""
Verify example scripts included in the docs are up to date.
Execute each script in :file:`docs/source/examples`,
not raising any errors is good enough.
"""
with cd(example.parent):
> runpy.run_path(str(example))
tests/test_doc_examples.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/runpy.py:265: in run_path
return _run_module_code(code, init_globals, run_name,
/usr/lib64/python3.8/runpy.py:97: in _run_module_code
_run_code(code, mod_globals, init_globals,
/usr/lib64/python3.8/runpy.py:87: in _run_code
exec(code, run_globals)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
from lxml import etree
import xmlsec
with open('enc1-doc.xml') as fp:
template = etree.parse(fp).getroot()
enc_data = xmlsec.template.encrypted_data_create(
template,
xmlsec.constants.TransformAes128Cbc,
type=xmlsec.constants.TypeEncElement,
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, xmlsec.constants.TransformRsaOaep)
xmlsec.template.encrypted_data_ensure_cipher_value(enc_key)
data = template.find('./Data')
# Encryption
manager = xmlsec.KeysManager()
key = xmlsec.Key.from_file('rsacert.pem', xmlsec.constants.KeyDataFormatCertPem, None)
manager.add_key(key)
enc_ctx = xmlsec.EncryptionContext(manager)
enc_ctx.key = xmlsec.Key.generate(
xmlsec.constants.KeyDataAes, 128, xmlsec.constants.KeyDataTypeSession
)
> enc_data = enc_ctx.encrypt_xml(enc_data, data)
E xmlsec.Error: (1, 'failed to encrypt xml')
doc/source/examples/encrypt.py:30: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
____________________________________________________________________________ TestEncryptionContext.test_decrypt1 ____________________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt1>
def test_decrypt1(self):
> self.check_decrypt(1)
tests/test_enc.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt1>, i = 1
def check_decrypt(self, i):
root = self.load_xml('enc{}-out.xml'.format(i))
enc_data = xmlsec.tree.find_child(root, consts.NodeEncryptedData, consts.EncNs)
self.assertIsNotNone(enc_data)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsakey.pem"), format=consts.KeyDataFormatPem))
ctx = xmlsec.EncryptionContext(manager)
> decrypted = ctx.decrypt(enc_data)
E xmlsec.Error: (1, 'failed to decrypt')
tests/test_enc.py:228: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
____________________________________________________________________________ TestEncryptionContext.test_decrypt2 ____________________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt2>
def test_decrypt2(self):
> self.check_decrypt(2)
tests/test_enc.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt2>, i = 2
def check_decrypt(self, i):
root = self.load_xml('enc{}-out.xml'.format(i))
enc_data = xmlsec.tree.find_child(root, consts.NodeEncryptedData, consts.EncNs)
self.assertIsNotNone(enc_data)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsakey.pem"), format=consts.KeyDataFormatPem))
ctx = xmlsec.EncryptionContext(manager)
> decrypted = ctx.decrypt(enc_data)
E xmlsec.Error: (1, 'failed to decrypt')
tests/test_enc.py:228: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=aes128-cbc
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
__________________________________________________________________________ TestEncryptionContext.test_decrypt_key ___________________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_decrypt_key>
def test_decrypt_key(self):
root = self.load_xml('enc3-out.xml')
enc_key = xmlsec.tree.find_child(root, consts.NodeEncryptedKey, consts.EncNs)
self.assertIsNotNone(enc_key)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsakey.pem"), format=consts.KeyDataFormatPem))
ctx = xmlsec.EncryptionContext(manager)
> keydata = ctx.decrypt(enc_key)
E xmlsec.Error: (1, 'failed to decrypt')
tests/test_enc.py:210: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=613:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=539:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
_________________________________________________________________________ TestEncryptionContext.test_encrypt_binary _________________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_encrypt_binary>
def test_encrypt_binary(self):
root = self.load_xml('enc2-in.xml')
enc_data = xmlsec.template.encrypted_data_create(
root, consts.TransformAes128Cbc, type=consts.TypeEncContent, ns="xenc", mime_type="binary/octet-stream"
)
xmlsec.template.encrypted_data_ensure_cipher_value(enc_data)
ki = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig")
ek = xmlsec.template.add_encrypted_key(ki, consts.TransformRsaOaep)
xmlsec.template.encrypted_data_ensure_cipher_value(ek)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsacert.pem"), format=consts.KeyDataFormatCertPem))
ctx = xmlsec.EncryptionContext(manager)
ctx.key = xmlsec.Key.generate(consts.KeyDataAes, 128, consts.KeyDataTypeSession)
> encrypted = ctx.encrypt_binary(enc_data, b'test')
E xmlsec.Error: (1, 'failed to encrypt binary')
tests/test_enc.py:125: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
__________________________________________________________________________ TestEncryptionContext.test_encrypt_uri ___________________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_encrypt_uri>
def test_encrypt_uri(self):
root = self.load_xml('enc2-in.xml')
enc_data = xmlsec.template.encrypted_data_create(
root, consts.TransformAes128Cbc, type=consts.TypeEncContent, ns="xenc", mime_type="binary/octet-stream"
)
xmlsec.template.encrypted_data_ensure_cipher_value(enc_data)
ki = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig")
ek = xmlsec.template.add_encrypted_key(ki, consts.TransformRsaOaep)
xmlsec.template.encrypted_data_ensure_cipher_value(ek)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsacert.pem"), format=consts.KeyDataFormatCertPem))
ctx = xmlsec.EncryptionContext(manager)
ctx.key = xmlsec.Key.generate(consts.KeyDataAes, 128, consts.KeyDataTypeSession)
with tempfile.NamedTemporaryFile(delete=False) as tmpfile:
tmpfile.write(b'test')
> encrypted = ctx.encrypt_binary(enc_data, 'file://' + tmpfile.name)
E xmlsec.Error: (1, 'failed to encrypt binary')
tests/test_enc.py:170: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=327:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
__________________________________________________________________________ TestEncryptionContext.test_encrypt_xml ___________________________________________________________________________
self = <tests.test_enc.TestEncryptionContext testMethod=test_encrypt_xml>
def test_encrypt_xml(self):
root = self.load_xml('enc1-in.xml')
enc_data = xmlsec.template.encrypted_data_create(root, consts.TransformAes128Cbc, type=consts.TypeEncElement, ns="xenc")
xmlsec.template.encrypted_data_ensure_cipher_value(enc_data)
ki = xmlsec.template.encrypted_data_ensure_key_info(enc_data, ns="dsig")
ek = xmlsec.template.add_encrypted_key(ki, consts.TransformRsaOaep)
xmlsec.template.encrypted_data_ensure_cipher_value(ek)
data = root.find('./Data')
self.assertIsNotNone(data)
manager = xmlsec.KeysManager()
manager.add_key(xmlsec.Key.from_file(self.path("rsacert.pem"), format=consts.KeyDataFormatCertPem))
ctx = xmlsec.EncryptionContext(manager)
ctx.key = xmlsec.Key.generate(consts.KeyDataAes, 128, consts.KeyDataTypeSession)
> encrypted = ctx.encrypt_xml(enc_data, data)
E xmlsec.Error: (1, 'failed to encrypt xml')
tests/test_enc.py:71: Error
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
func=xmlSecKeysMngrGetKey:file=keys.c:line=1347:obj=unknown:subj=unknown:error=45:key is not found:details=NULL
func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=793:obj=unknown:subj=unknown:error=45:key is not found:encMethod=rsa-oaep-mgf1p
func=xmlSecEncCtxBinaryEncrypt:file=xmlenc.c:line=311:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecKeyDataEncryptedKeyXmlWrite:file=keyinfo.c:line=1703:obj=enc-key:subj=xmlSecEncCtxBinaryEncrypt:error=1:xmlsec library function failed:
func=xmlSecKeyInfoNodeWrite:file=keyinfo.c:line=183:obj=enc-key:subj=xmlSecKeyDataXmlWrite:error=1:xmlsec library function failed:node=EncryptedKey
func=xmlSecEncCtxEncDataNodeWrite:file=xmlenc.c:line=852:obj=unknown:subj=xmlSecKeyInfoNodeWrite:error=1:xmlsec library function failed:
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=411:obj=unknown:subj=xmlSecEncCtxEncDataNodeWrite:error=1:xmlsec library function failed:
================================================================================== short test summary info ==================================================================================
SKIPPED [1] tests/test_type_stubs.py:9: could not import 'black': No module named 'black'
ERROR tests/test_enc.py::TestEncryptionContext::test_decrypt1 - xmlsec.Error: (1, 'failed to decrypt')
ERROR tests/test_enc.py::TestEncryptionContext::test_decrypt2 - xmlsec.Error: (1, 'failed to decrypt')
ERROR tests/test_enc.py::TestEncryptionContext::test_decrypt_key - xmlsec.Error: (1, 'failed to decrypt')
ERROR tests/test_enc.py::TestEncryptionContext::test_encrypt_binary - xmlsec.Error: (1, 'failed to encrypt binary')
ERROR tests/test_enc.py::TestEncryptionContext::test_encrypt_uri - xmlsec.Error: (1, 'failed to encrypt binary')
ERROR tests/test_enc.py::TestEncryptionContext::test_encrypt_xml - xmlsec.Error: (1, 'failed to encrypt xml')
FAILED tests/test_doc_examples.py::test_doc_example[decrypt.py] - xmlsec.Error: (1, 'failed to decrypt')
FAILED tests/test_doc_examples.py::test_doc_example[encrypt.py] - xmlsec.Error: (1, 'failed to encrypt xml')
FAILED tests/test_enc.py::TestEncryptionContext::test_decrypt1 - xmlsec.Error: (1, 'failed to decrypt')
FAILED tests/test_enc.py::TestEncryptionContext::test_decrypt2 - xmlsec.Error: (1, 'failed to decrypt')
FAILED tests/test_enc.py::TestEncryptionContext::test_decrypt_key - xmlsec.Error: (1, 'failed to decrypt')
FAILED tests/test_enc.py::TestEncryptionContext::test_encrypt_binary - xmlsec.Error: (1, 'failed to encrypt binary')
FAILED tests/test_enc.py::TestEncryptionContext::test_encrypt_uri - xmlsec.Error: (1, 'failed to encrypt binary')
FAILED tests/test_enc.py::TestEncryptionContext::test_encrypt_xml - xmlsec.Error: (1, 'failed to encrypt xml')
==================================================================== 8 failed, 283 passed, 1 skipped, 6 errors in 10.21s ====================================================================
Here is list of installed modules in build env
Package Version
----------------------------- -------
alabaster 0.7.13
asttokens 2.2.1
attrs 23.1.0
Babel 2.12.1
backcall 0.2.0
build 0.10.0
charset-normalizer 3.1.0
decorator 5.1.1
distro 1.8.0
docutils 0.19
exceptiongroup 1.1.1
executing 1.2.0
gpg 1.20.0
hypothesis 6.75.3
idna 3.4
imagesize 1.4.1
importlib-metadata 6.7.0
iniconfig 2.0.0
installer 0.7.0
ipython 8.12.0
jedi 0.18.2
Jinja2 3.1.2
libcomps 0.1.19
lxml 4.9.3
MarkupSafe 2.1.2
matplotlib-inline 0.1.6
packaging 23.1
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
pkgconfig 1.5.5
pluggy 1.0.0
prompt-toolkit 3.0.38
ptyprocess 0.7.0
pure-eval 0.2.2
Pygments 2.15.1
pyproject_hooks 1.0.0
pytest 7.4.0
python-dateutil 2.8.2
pytz 2023.2
requests 2.31.0
setuptools 68.0.0
setuptools-scm 7.1.0
six 1.16.0
snowballstemmer 2.2.0
sortedcontainers 2.4.0
Sphinx 6.2.1
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
stack-data 0.6.2
tomli 2.0.1
traitlets 5.9.0
typing_extensions 4.7.1
urllib3 1.26.15
wcwidth 0.2.6
wheel 0.40.0
zipp 3.15.0
BTW .. here are module compile time warnings
[tkloczko@pers-jacek SPECS]$ rpmbuild -ba python-xmlsec.spec --quiet 2>&1 | grep -- \\[-W | sed 's/.*\[//; s/\]//' | sort | uniq -c | sort -nr
2 -Wdeprecated-declarations
1 -Wunused-function
1 -Wunused-but-set-variable
1 -Wincompatible-pointer-types
and extracted stderr
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/constants.c: In function ‘PyXmlSec_ConstantsModule_Init’:
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/constants.c:448:5: warning: ‘xmlSeckeyDataEcGetKlass’ is deprecated [-Wdeprecated-declarations]
448 | PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataEcdsa, "ECDSA")
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/xmlsec1/xmlsec/crypto.h:25,
from /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/constants.h:16,
from /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/constants.c:11:
/usr/include/xmlsec1/xmlsec/app.h:89:49: note: declared here
89 | XMLSEC_EXPORT XMLSEC_DEPRECATED xmlSecKeyDataId xmlSeckeyDataEcGetKlass(void);
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/enc.c: In function ‘PyXmlSec_ClearReplacedNodes’:
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/enc.c:195:14: warning: assignment to ‘struct LxmlElement **’ from incompatible pointer type ‘PyXmlSec_LxmlElementPtr’ {aka ‘struct LxmlElement *’} [-Wincompatible-pointer-types]
195 | elem = PyXmlSec_elementFactory(doc, n);
| ^
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/exception.c: In function ‘PyXmlSec_ExchangeLastError’:
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/exception.c:76:9: warning: variable ‘r’ set but not used [-Wunused-but-set-variable]
76 | int r;
| ^
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/keys.c: In function ‘PyXmlSec_KeyFromFile’:
/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/keys.c:166:9: warning: ‘xmlSecCryptoAppKeyLoad’ is deprecated [-Wdeprecated-declarations]
166 | key->handle = xmlSecCryptoAppKeyLoad(data, format, password, NULL, NULL);
| ^~~
In file included from /usr/include/xmlsec1/xmlsec/crypto.h:25,
from /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/constants.h:16,
from /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/keys.c:11:
/usr/include/xmlsec1/xmlsec/app.h:718:49: note: declared here
718 | XMLSEC_DEPRECATED XMLSEC_EXPORT xmlSecKeyPtr xmlSecCryptoAppKeyLoad (const char *filename,
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/src/lxml.c:13:
/usr/lib64/python3.8/site-packages/lxml/includes/etree_defs.h:275:14: warning: ‘lxml_unpack_xmldoc_capsule’ defined but not used [-Wunused-function]
275 | static void* lxml_unpack_xmldoc_capsule(PyObject* capsule, int* is_owned) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
I created PR #264, which I've only tested on my Mac so far but unit tests pass with both libxmlsec1@1.2.37 and libxmlsec1@1.3.1.
Like @tdivis, I started out by removing SOAP constants to make it compile, but unit tests were failing. It seems that with xmlsec 1.3, key search strict mode is enabled by default and keys must be referenced in the KeyInfo, which is not the case in the existing test cases. I debated between updating the test cases and disabling strict mode by default, and in the end I disabled strict mode by default because I wasn't confident in my ability to provide a mechanism to disable strict mode manually.
Apologies if it's a bit hacky, I have very limited experience with C. I'm happy to make changes to it (or have others make changes) but I may require some guidance.
With a patch, can that please be folded in?
Arch Linux recently shipped an update for xmlsec (I upgraded xmlsec 1.2.39-1 -> 1.3.3-2 on 2024-02-26), so this issue now hits Arch Linux users trying to install the newest xmlsec with pip.
$ rm -rf xmlsecvenv && python -m venv xmlsecvenv && xmlsecvenv/bin/pip install xmlsec
Collecting xmlsec
Downloading xmlsec-1.3.13.tar.gz (64 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.6/64.6 kB 1.2 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting lxml>=3.8 (from xmlsec)
Obtaining dependency information for lxml>=3.8 from https://files.pythonhosted.org/packages/1f/09/df0101e6d7be06fca545c0f7417d03d69679ff280d892a406469086780a4/lxml-5.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Using cached lxml-5.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.5 kB)
Using cached lxml-5.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.1 MB)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for xmlsec (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [74 lines of output]
WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/xmlsec
copying src/xmlsec/__init__.pyi -> build/lib.linux-x86_64-cpython-311/xmlsec
copying src/xmlsec/constants.pyi -> build/lib.linux-x86_64-cpython-311/xmlsec
copying src/xmlsec/template.pyi -> build/lib.linux-x86_64-cpython-311/xmlsec
copying src/xmlsec/tree.pyi -> build/lib.linux-x86_64-cpython-311/xmlsec
copying src/xmlsec/py.typed -> build/lib.linux-x86_64-cpython-311/xmlsec
running build_ext
building 'xmlsec' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/tmp
creating build/temp.linux-x86_64-cpython-311/tmp/pip-install-ktry34o6
creating build/temp.linux-x86_64-cpython-311/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd
creating build/temp.linux-x86_64-cpython-311/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src
gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_FTP=1 -DXMLSEC_NO_MD5=1 -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.3.13 -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/tmp/pip-build-env-2v8sigmd/overlay/lib/python3.11/site-packages/lxml/includes -I/tmp/pip-build-env-2v8sigmd/overlay/lib/python3.11/site-packages/lxml -I/tmp/pip-build-env-2v8sigmd/overlay/lib/python3.11/site-packages/lxml/includes/libxml -I/tmp/pip-build-env-2v8sigmd/overlay/lib/python3.11/site-packages/lxml/includes/libexslt -I/tmp/pip-build-env-2v8sigmd/overlay/lib/python3.11/site-packages/lxml/includes/extlibs -I/tmp/pip-build-env-2v8sigmd/overlay/lib/python3.11/site-packages/lxml/includes/libxslt -I/tmp/pip-build-env-2v8sigmd/overlay/lib/python3.11/site-packages/lxml/includes/__pycache__ -I/path/to/xmlsecvenv/include -I/usr/include/python3.11 -c /tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c -o build/temp.linux-x86_64-cpython-311/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.o -g -std=c99 -fPIC -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os
In file included from /tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:10:
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c: In function ‘PyXmlSec_ConstantsModule_Init’:
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:304:51: error: ‘xmlSecSoap11Ns’ undeclared (first use in this function); did you mean ‘xmlSecEnc11Ns’?
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:304:46: note: in expansion of macro ‘JOIN’
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:319:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
319 | PYXMLSEC_ADD_NS_CONSTANT(Soap11Ns, "SOAP11");
| ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:304:51: note: each undeclared identifier is reported only once for each function it appears in
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:304:46: note: in expansion of macro ‘JOIN’
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:319:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
319 | PYXMLSEC_ADD_NS_CONSTANT(Soap11Ns, "SOAP11");
| ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:304:51: error: ‘xmlSecSoap12Ns’ undeclared (first use in this function); did you mean ‘xmlSecXPath2Ns’?
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:304:46: note: in expansion of macro ‘JOIN’
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:320:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
320 | PYXMLSEC_ADD_NS_CONSTANT(Soap12Ns, "SOAP12");
| ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:433:31: error: ‘xmlSecKeyDataEcdsaId’ undeclared (first use in this function); did you mean ‘xmlSecKeyDataDsaId’?
433 | tmp = PyXmlSec_KeyDataNew(xmlSec ## name ## Id); \
| ^~~~~~
/tmp/pip-install-ktry34o6/xmlsec_9daaa77b6d4342c7b7a0a1622c6eb1cd/src/constants.c:450:5: note: in expansion of macro ‘PYXMLSEC_ADD_KEYDATA_CONSTANT’
450 | PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataEcdsa, "ECDSA")
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for xmlsec
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects
[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: python -m pip install --upgrade pip
I am running Manjaro (based on Arch) and I now have this issue as well :(
🤞 for a fix
Can you try the latest version in development? We think we have all the required fixes in
Can you try the latest version in development? We think we have all the required fixes in
One sec 😋
Hmm for some reason I cannot apply sequence of downloaded patches generated from commits added after last release 🤔
warning: Downloading https://github.com/mehcode/python-xmlsec//archive/1.3.13/python-xmlsec-1.3.13.tar.gz to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-1.3.13.tar.gz
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/21ce9164.patch#/python-xmlsec-allow-building-docs-with-python-3.8-227.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-allow-building-docs-with-python-3.8-227.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/00759a33.patch#/python-xmlsec-add-proper-param-types-in-register_callbacks-228.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-add-proper-param-types-in-register_callbacks-228.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/82408431.patch#/python-xmlsec-adjust-doc-examples-to-212-229.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-adjust-doc-examples-to-212-229.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/c39eeff3.patch#/python-xmlsec-Add-integration-with-pre-commit.ci-230.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Add-integration-with-pre-commit.ci-230.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/91592052.patch#/python-xmlsec-fix-test-run-on-appveyor-231.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-fix-test-run-on-appveyor-231.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/e83a4576.patch#/python-xmlsec-pre-commit.ci-pre-commit-autoupdate-233.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-pre-commit.ci-pre-commit-autoupdate-233.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/c4658f37.patch#/python-xmlsec-Correct-codecov-badge-URL-in-readme.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Correct-codecov-badge-URL-in-readme.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/cc8632f4.patch#/python-xmlsec-pre-commit.ci-pre-commit-autoupdate-238.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-pre-commit.ci-pre-commit-autoupdate-238.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/92882809.patch#/python-xmlsec-Added-changes-to-enable-3.11-builds.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Added-changes-to-enable-3.11-builds.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/d16f9853.patch#/python-xmlsec-Added-changes-to-enable-3.11-builds-1.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Added-changes-to-enable-3.11-builds-1.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/519feff7.patch#/python-xmlsec-bumped-isort-to-5.11.5.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-bumped-isort-to-5.11.5.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/15639474.patch#/python-xmlsec-Fix-247-Fix-missing-import-of-template-in-__init__.p.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Fix-247-Fix-missing-import-of-template-in-__init__.p.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/a7f95d55.patch#/python-xmlsec-Added-changes-to-enable-3.11-builds-2.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Added-changes-to-enable-3.11-builds-2.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/b7683774.patch#/python-xmlsec-Added-changes-to-enable-3.11-builds-3.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Added-changes-to-enable-3.11-builds-3.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/2c58d43e.patch#/python-xmlsec-Fix-244-Fix-failing-test-with-libxmlsec-1.2.36-also-.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Fix-244-Fix-failing-test-with-libxmlsec-1.2.36-also-.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/1cf6785b.patch#/python-xmlsec-Fix-164-Add-support-for-loading-keys-from-engine-e.g.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Fix-164-Add-support-for-loading-keys-from-engine-e.g.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/0b5939fc.patch#/python-xmlsec-Fix-164-Add-tests-for-pkcs11-softhsm-key.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Fix-164-Add-tests-for-pkcs11-softhsm-key.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/4f5daea2.patch#/python-xmlsec-pre-commit.ci-auto-fixes-from-pre-commit.com-hooks.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-pre-commit.ci-auto-fixes-from-pre-commit.com-hooks.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/70753591.patch#/python-xmlsec-Remove-SOAP.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Remove-SOAP.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/2c26131e.patch#/python-xmlsec-Upgrade-isort-because-of-poetry-dependency-issue.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Upgrade-isort-because-of-poetry-dependency-issue.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/b865569c.patch#/python-xmlsec-setup-better-deal-with-compiler-flags.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-setup-better-deal-with-compiler-flags.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/5f57f2ea.patch#/python-xmlsec-Add-compatibility-for-xmlsec-1.3.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Add-compatibility-for-xmlsec-1.3.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/0e7c5e71.patch#/python-xmlsec-fix-1.2-compatibility.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-fix-1.2-compatibility.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/40c14c45.patch#/python-xmlsec-update-isort-to-fix-poetry-error-in-pre-commit.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-update-isort-to-fix-poetry-error-in-pre-commit.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/f2617835.patch#/python-xmlsec-Don-t-define-MODULE_NAME-as-a-string-literal.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Don-t-define-MODULE_NAME-as-a-string-literal.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/c97f2b8d.patch#/python-xmlsec-Make-DES-3DES-KW-3DES-support-conditional-on-DES-ava.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Make-DES-3DES-KW-3DES-support-conditional-on-DES-ava.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/31bea7c0.patch#/python-xmlsec-Use-KeyDataEc-rather-than-deprecated-KeyDataEcdsa.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Use-KeyDataEc-rather-than-deprecated-KeyDataEcdsa.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/7891e715.patch#/python-xmlsec-Use-xmlSecCryptoAppKeyLoadEx-instead-of-deprecated-x.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Use-xmlSecCryptoAppKeyLoadEx-instead-of-deprecated-x.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/c9c660b8.patch#/python-xmlsec-Use-xmlSecCryptoAppKeyLoadEx-instead-of-xmlSecCrypto.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Use-xmlSecCryptoAppKeyLoadEx-instead-of-xmlSecCrypto.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/595aeaa2.patch#/python-xmlsec-Make-the-library-backward-compatible.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Make-the-library-backward-compatible.patch
warning: Downloading https://github.com/mehcode/python-xmlsec//commit/802dff28.patch#/python-xmlsec-Update-correct-URL-No-func-change.patch to /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Update-correct-URL-No-func-change.patch
warning: source_date_epoch_from_changelog set but %changelog is missing
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.3jYBv6
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd /home/tkloczko/rpmbuild/BUILD
+ rm -rf python-xmlsec-1.3.13
+ /usr/lib/rpm/rpmuncompress -x /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-1.3.13.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd python-xmlsec-1.3.13
+ rm -rf /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/SPECPARTS
+ /usr/bin/mkdir -p /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.13/SPECPARTS
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-allow-building-docs-with-python-3.8-227.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-add-proper-param-types-in-register_callbacks-228.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-adjust-doc-examples-to-212-229.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Add-integration-with-pre-commit.ci-230.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-fix-test-run-on-appveyor-231.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-pre-commit.ci-pre-commit-autoupdate-233.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Correct-codecov-badge-URL-in-readme.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-pre-commit.ci-pre-commit-autoupdate-238.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Added-changes-to-enable-3.11-builds.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Added-changes-to-enable-3.11-builds-1.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-bumped-isort-to-5.11.5.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Fix-247-Fix-missing-import-of-template-in-__init__.p.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /home/tkloczko/rpmbuild/SOURCES/python-xmlsec-Added-changes-to-enable-3.11-builds-2.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
1 out of 1 hunk FAILED -- saving rejects to file .appveyor.yml.rej
1 out of 1 hunk FAILED -- saving rejects to file .github/workflows/macosx.yml.rej
1 out of 1 hunk FAILED -- saving rejects to file .github/workflows/manylinux.yml.rej
1 out of 1 hunk FAILED -- saving rejects to file .github/workflows/opensuse-tumbleweed.yml.rej
1 out of 1 hunk FAILED -- saving rejects to file .github/workflows/sdist.yml.rej
1 out of 1 hunk FAILED -- saving rejects to file .travis.yml.rej
1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej
error: Bad exit status from /var/tmp/rpm-tmp.3jYBv6 (%prep)
Just started testing final 1.3.14 and fond that pytest crashes i the same call which compiler reports incompatible-pointer-types
(PyXmlSec_Transform__str__)
7.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.14-rc1
configfile: pyproject.toml
plugins: forked-1.6.0, hypothesis-6.100.0, mock-3.14.0, benchmark-4.0.0, timeout-2.3.1, flaky-3.8.1, subprocess-1.5.0, flake8-1.1.1, datadir-1.5.0
collected 296 items / 1 skipped
tests/test_xmlsec.py . [ 0%]
tests/test_constants.py Fatal Python error: Segmentation fault
Current thread 0x00007f6a07a39b80 (most recent call first):
File "/home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.14-rc1/tests/test_constants.py", line 24 in test_transform_str
File "/usr/lib/python3.10/site-packages/_pytest/python.py", line 200 in pytest_pyfunc_call
File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
File "/usr/lib/python3.10/site-packages/_pytest/python.py", line 1777 in runtest
File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 172 in pytest_runtest_call
File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
File "/usr/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py", line 146 in <lambda>
File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 340 in from_call
File "/usr/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py", line 145 in _call_runtest_hook
File "/usr/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py", line 149 in call_and_report
File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 134 in runtestprotocol
File "/usr/lib/python3.10/site-packages/_pytest/runner.py", line 115 in pytest_runtest_protocol
File "/usr/lib/python3.10/site-packages/flaky/flaky_pytest_plugin.py", line 89 in pytest_runtest_protocol
File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 364 in pytest_runtestloop
File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 339 in _main
File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 285 in wrap_session
File "/usr/lib/python3.10/site-packages/_pytest/main.py", line 332 in pytest_cmdline_main
File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 102 in _multicall
File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 119 in _hookexec
File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 501 in __call__
File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 174 in main
File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 197 in console_main
File "/usr/bin/pytest", line 8 in <module>
And the same started over gdb
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.14-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.14-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ gdb --args /usr/bin/python3 -m pytest
GNU gdb (GDB) G2V 14.2-5.fc37
Copyright (C) 2023 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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 /usr/bin/python3...
Reading symbols from .gnu_debugdata for /usr/bin/python...
(No debugging symbols found in .gnu_debugdata for /usr/bin/python)
Missing separate debuginfos, use: dnf debuginfo-install python-3.10.14-2.fc37.x86_64
(gdb) r
Starting program: /usr/bin/python3 -m pytest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Detaching after vfork from child process 60900]
[Detaching after vfork from child process 60901]
[Detaching after vfork from child process 60902]
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/python-xmlsec-1.3.14
configfile: pyproject.toml
plugins: forked-1.6.0, hypothesis-6.100.0, mock-3.14.0, benchmark-4.0.0, timeout-2.3.1, flaky-3.8.1, subprocess-1.5.0, flake8-1.1.1, datadir-1.5.0
collected 296 items / 1 skipped
tests/test_xmlsec.py . [ 0%]
tests/test_constants.py
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6739da8 in PyXmlSec_Transform__str__ ()
from /home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.14-2.fc37.x86_64/usr/lib64/python3.10/site-packages/xmlsec.cpython-310-x86_64-linux-gnu.so
(gdb) bt full
#0 0x00007ffff6739da8 in PyXmlSec_Transform__str__ ()
from /home/tkloczko/rpmbuild/BUILDROOT/python-xmlsec-1.3.14-2.fc37.x86_64/usr/lib64/python3.10/site-packages/xmlsec.cpython-310-x86_64-linux-gnu.so
No symbol table info available.
#1 0x00007ffff7ccf1cd in PyObject_Str () from /lib64/libpython3.10.so.1.0
No symbol table info available.
#2 0x00007ffff7cfbf40 in unicode_new.lto_priv () from /lib64/libpython3.10.so.1.0
No symbol table info available.
#3 0x00007ffff7ce370e in type_call.lto_priv () from /lib64/libpython3.10.so.1.0
No symbol table info available.
#4 0x00007ffff7c831a8 in _PyObject_MakeTpCall () from /lib64/libpython3.10.so.1.0
No symbol table info available.
[..]
FWICS python-xmlsec 1.3.14 seems to build and test fine against xmlsec 1.3.3. Thanks!