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 not using signing_algorithm from sp service #963

Open
openbrian opened this issue May 23, 2024 · 2 comments
Open

PySAML2 not using signing_algorithm from sp service #963

openbrian opened this issue May 23, 2024 · 2 comments

Comments

@openbrian
Copy link

openbrian commented May 23, 2024

sp specific algorithms not being used

Code Version

7.4

Expected Behavior

https://pysaml2.readthedocs.io/en/latest/howto/config.html#signing-algorithm should be used as demonstrated.

Current Behavior

The default algorithm is used. This is sha1. Sha1 in FIPS mode (openssl) is not permitted. xmlsec1 will crash or error out. I'll put error messages in a comment.

Possible Solution

In Entity constructor, when getting the algorithms from the config, include the context which is self.entity_type.

Or, alter config getattr such that if context is specified, look there first. If the attribute is not there, then look it up (inherit) from one level up.

And/Or, drop the {context}{attr}, and stick with nested dictionaries.

Or, set the default algorithm to be anything but sha1 which is considered insecure.

Steps to Reproduce

Use PySAML2 with OpenSSL in FIPS mode. Otherwise pretty generic config. set authn_requests_signed to true.

@openbrian
Copy link
Author

func=xmlSecOpenSSLEvpSignatureExecute:file=evp_signatures.c:
line=562:obj=rsa-sha1:
subj=EVP_SignFinal:
error=4:crypto library function failed:openssl error: error:1C8000AE:Provider routines::digest not allowed

func=xmlSecTransformDefaultPushBin:file=transforms.c:
line=1934:obj=rsa-sha1:
subj=xmlSecTransformExecute:
error=1:xmlsec library function failed:final=1

func=xmlSecTransformIOBufferClose:file=transforms.c:
line=2563:obj=rsa-sha1:
subj=xmlSecTransformPushBin:
error=1:xmlsec library function failed:

@openbrian
Copy link
Author

Also interesting how the config context gets clobbered here.

self.context = typ

self.context = self.def_context

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