Skip to content

Commit 86da651

Browse files
committed
Disabled xmlsec algs as configurable configuration paramenter
1 parent f7f6aef commit 86da651

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/saml2/algsupport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__author__ = 'roland'
77

88
DIGEST_METHODS = {
9-
#"hmac-md5": 'http://www.w3.org/2001/04/xmldsig-more#md5', # test framework only!
9+
"hmac-md5": 'http://www.w3.org/2001/04/xmldsig-more#md5', # test framework only!
1010
"hmac-sha1": 'http://www.w3.org/2000/09/xmldsig#sha1',
1111
"hmac-sha224": 'http://www.w3.org/2001/04/xmldsig-more#sha224',
1212
"hmac-sha256": 'http://www.w3.org/2001/04/xmlenc#sha256',
@@ -16,7 +16,7 @@
1616
}
1717

1818
SIGNING_METHODS = {
19-
#"rsa-md5": 'http://www.w3.org/2001/04/xmldsig-more#rsa-md5',
19+
"rsa-md5": 'http://www.w3.org/2001/04/xmldsig-more#rsa-md5',
2020
"rsa-ripemd160": 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160',
2121
"rsa-sha1": 'http://www.w3.org/2000/09/xmldsig#rsa-sha1',
2222
"rsa-sha224": 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224',

src/saml2/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
COMMON_ARGS = [
3131
"debug",
3232
"entityid",
33+
"xmlsec_disabled_algs",
3334
"xmlsec_binary",
3435
"key_file",
3536
"cert_file",
@@ -189,6 +190,7 @@ class Config(object):
189190
def __init__(self, homedir="."):
190191
self._homedir = homedir
191192
self.entityid = None
193+
self.xmlsec_disabled_algs = []
192194
self.xmlsec_binary = None
193195
self.xmlsec_path = []
194196
self.debug = False

src/saml2/metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ def entity_descriptor(confd):
735735
_add_attr_to_entity_attributes(entd.extensions, attr)
736736

737737
for item in algorithm_support_in_metadata(confd.xmlsec_binary):
738+
if item.algorithm in confd.__dict__.get('xmlsec_disabled_algs'):
739+
continue
738740
if not entd.extensions:
739741
entd.extensions = md.Extensions()
740742
entd.extensions.add_extension_element(item)

0 commit comments

Comments
 (0)