Add support for pysaml2 >= 7.1.0
A constant was renamed in commit 1e59eaa0 [1]. [1] https://github.com/IdentityPython/pysaml2/commit/1e59eaa0 Change-Id: I0489fde7eced9af8a534736960b75a0d2c189933 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
36295cfb4b
commit
03238e343a
|
@ -366,6 +366,10 @@ class SAMLGenerator(object):
|
|||
|
||||
"""
|
||||
canonicalization_method = xmldsig.CanonicalizationMethod()
|
||||
# TODO(stephenfin): Drop when we remove support for pysaml < 7.1.0
|
||||
if hasattr(xmldsig, 'TRANSFORM_C14N'): # >= 7.1.0
|
||||
canonicalization_method.algorithm = xmldsig.TRANSFORM_C14N
|
||||
else: # < 7.1.0
|
||||
canonicalization_method.algorithm = xmldsig.ALG_EXC_C14N
|
||||
signature_method = xmldsig.SignatureMethod(
|
||||
algorithm=xmldsig.SIG_RSA_SHA1)
|
||||
|
@ -374,6 +378,10 @@ class SAMLGenerator(object):
|
|||
envelope_transform = xmldsig.Transform(
|
||||
algorithm=xmldsig.TRANSFORM_ENVELOPED)
|
||||
|
||||
# TODO(stephenfin): Drop when we remove support for pysaml < 7.1.0
|
||||
if hasattr(xmldsig, 'TRANSFORM_C14N'): # >= 7.1.0
|
||||
c14_transform = xmldsig.Transform(algorithm=xmldsig.TRANSFORM_C14N)
|
||||
else: # < 7.1.0
|
||||
c14_transform = xmldsig.Transform(algorithm=xmldsig.ALG_EXC_C14N)
|
||||
transforms.transform = [envelope_transform, c14_transform]
|
||||
|
||||
|
|
Loading…
Reference in New Issue