Skip to content

Commit dece930

Browse files
committed
added support for more hash algorithms (SHA2, RIPEMED160)
(this patch required for saml2test alg config option)
1 parent 5e69fd1 commit dece930

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

src/xmldsig/__init__.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,45 @@
1010
NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#'
1111

1212
ENCODING_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64'
13+
14+
# digest and signature algorithms (not implemented = commented out)
1315
DIGEST_SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1'
14-
ALG_EXC_C14N = 'http://www.w3.org/2001/10/xml-exc-c14n#'
15-
SIG_DSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
16+
DIGEST_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#sha224'
17+
DIGEST_SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256'
18+
DIGEST_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#sha384'
19+
DIGEST_SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512'
20+
DIGEST_RIPEMD160 = 'http://www.w3.org/2001/04/xmlenc#ripemd160'
21+
digest_default = DIGEST_SHA1
22+
23+
#SIG_DSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
24+
#SIG_DSA_SHA256 = 'http://www.w3.org/2009/xmldsig11#dsa-sha256'
25+
#SIG_ECDSA_SHA1 = 'http://www.w3.org/2001/04/xmldsig-more#ECDSA_sha1'
26+
#SIG_ECDSA_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#ECDSA_sha224'
27+
#SIG_ECDSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#ECDSA_sha256'
28+
#SIG_ECDSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#ECDSA_sha384'
29+
#SIG_ECDSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#ECDSA_sha512'
30+
SIG_RSA_MD5 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-md5' # test framework
1631
SIG_RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
32+
SIG_RSA_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224'
33+
SIG_RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
34+
SIG_RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
35+
SIG_RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
36+
SIG_RSA_RIPMED160 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160'
37+
sig_default = SIG_RSA_SHA1
38+
1739
MAC_SHA1 = 'http://www.w3.org/2000/09/xmldsig#hmac-sha1'
1840

1941
C14N = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'
2042
C14N_WITH_C = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments'
43+
ALG_EXC_C14N = 'http://www.w3.org/2001/10/xml-exc-c14n#'
2144

2245
TRANSFORM_XSLT = 'http://www.w3.org/TR/1999/REC-xslt-19991116'
2346
TRANSFORM_XPATH = 'http://www.w3.org/TR/1999/REC-xpath-19991116'
2447
TRANSFORM_ENVELOPED = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'
2548

2649

50+
51+
2752
class CryptoBinary_(SamlBase):
2853
"""The http://www.w3.org/2000/09/xmldsig#:CryptoBinary element """
2954

0 commit comments

Comments
 (0)