summaryrefslogtreecommitdiff
path: root/openid
diff options
context:
space:
mode:
authorVlastimil Zíma <vlastimil.zima@nic.cz>2018-05-11 11:04:32 +0200
committerVlastimil Zíma <vlastimil.zima@nic.cz>2018-05-15 11:20:18 +0200
commit083edc87fc0e1f97907e5169299cb6166a29dc78 (patch)
treea16a3adfdb5c623389ea410f51c851bab83de0d4 /openid
parente50e69b58fab73fce4c03350acf4228766c117bf (diff)
downloadopenid-083edc87fc0e1f97907e5169299cb6166a29dc78.tar.gz
Drop condition for SHA256 availability
Diffstat (limited to 'openid')
-rw-r--r--openid/association.py37
1 files changed, 11 insertions, 26 deletions
diff --git a/openid/association.py b/openid/association.py
index ae566e7..5baf06f 100644
--- a/openid/association.py
+++ b/openid/association.py
@@ -17,8 +17,7 @@ association.
@var default_negotiator: A C{L{SessionNegotiator}} that allows all
association types that are specified by the OpenID
specification. It prefers to use HMAC-SHA1/DH-SHA1, if it's
- available. If HMAC-SHA256 is not supported by your Python runtime,
- HMAC-SHA256 and DH-SHA256 will not be available.
+ available.
@var encrypted_negotiator: A C{L{SessionNegotiator}} that
does not support C{'no-encryption'} associations. It prefers
@@ -48,31 +47,17 @@ all_association_types = [
'HMAC-SHA256',
]
-if hasattr(cryptutil, 'hmacSha256'):
- supported_association_types = list(all_association_types)
-
- default_association_order = [
- ('HMAC-SHA1', 'DH-SHA1'),
- ('HMAC-SHA1', 'no-encryption'),
- ('HMAC-SHA256', 'DH-SHA256'),
- ('HMAC-SHA256', 'no-encryption'),
- ]
-
- only_encrypted_association_order = [
- ('HMAC-SHA1', 'DH-SHA1'),
- ('HMAC-SHA256', 'DH-SHA256'),
- ]
-else:
- supported_association_types = ['HMAC-SHA1']
-
- default_association_order = [
- ('HMAC-SHA1', 'DH-SHA1'),
- ('HMAC-SHA1', 'no-encryption'),
- ]
+default_association_order = [
+ ('HMAC-SHA1', 'DH-SHA1'),
+ ('HMAC-SHA1', 'no-encryption'),
+ ('HMAC-SHA256', 'DH-SHA256'),
+ ('HMAC-SHA256', 'no-encryption'),
+]
- only_encrypted_association_order = [
- ('HMAC-SHA1', 'DH-SHA1'),
- ]
+only_encrypted_association_order = [
+ ('HMAC-SHA1', 'DH-SHA1'),
+ ('HMAC-SHA256', 'DH-SHA256'),
+]
def getSessionTypes(assoc_type):