Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pysaml2 incompatible with xmlsec1 version 1.3.0 #150

Open
MathieuB1 opened this issue May 16, 2023 · 0 comments
Open

pysaml2 incompatible with xmlsec1 version 1.3.0 #150

MathieuB1 opened this issue May 16, 2023 · 0 comments

Comments

@MathieuB1
Copy link

MathieuB1 commented May 16, 2023

The IDP server doesn't work anymore with xmlsec 1.3.0. This is required when importing from saml2.sigver import get_xmlsec_binary. The breaking change is the following:

https://www.aleksey.com/xmlsec/news.html

(API breaking change) The XMLSec command line utility is using 'strict' key search mode by default. To restore the old 'lax' key search mode, use the new '--lax-key-search' option.

As there we cannot pass any arg to get_xmlsec_binary method we are stuck and have to wait for a new pysaml2 release see issue on: IdentityPython/pysaml2#906

Code to update:

https://github.com/IdentityPython/pysaml2/blob/2d47437a21aaaa77abed1b1aacdf5bda5a7f7b87/src/saml2/sigver.py#L220 
line.660 --> com_list 

Broken command:

/usr/bin/xmlsec1 --sign --privkey-pem /app/idp/certificates/private.key --id-attr:ID urn:oasis:names:tc:SAML:2.0:assertion:Assertion --node-id id-ypHQSxfXdaDrDXrHe --output /tmp/tmpjltassif.xml /tmp/tmpw0hrid6t.xml 

Signature status: FAILED
Failure reason: KEY-NOT-FOUND
Error: failed to sign file "/tmp/tmpw0hrid6t.xml"

Working command (--lax-key-search):

/usr/bin/xmlsec1 --sign --lax-key-search --privkey-pem /app/idp/certificates/private.key --id-attr:ID urn:oasis:names:tc:SAML:2.0:assertion:Assertion --node-id id-ypHQSxfXdaDrDXrHe --output /tmp/tmpjltassif.xml /tmp/tmpw0hrid6t.xml 
Signature status: OK

Temporary solution is to stick the xmlsec1 lib to xmlsec1-1.2.37 available on http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.37.tar.gz

@MathieuB1 MathieuB1 changed the title pysaml2 incomaptible with xmlsec1 version 1.3.0 pysaml2 incompatible with xmlsec1 version 1.3.0 May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant