summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2013-05-24 11:42:55 +0200
committerRoland Hedberg <roland.hedberg@adm.umu.se>2013-05-24 11:42:55 +0200
commit13f8c8293cf59de31497d15a17a17958b98e7ecb (patch)
treed863a646e0afe406bb5a0bfc8a4d28c12709a9cd
parentc4b33787dc1c3f327c608dfbf64b351ddfb28726 (diff)
downloadpysaml2-13f8c8293cf59de31497d15a17a17958b98e7ecb.tar.gz
Switched to use a simple monotonic increased identifier for authn types.
-rw-r--r--src/saml2/authn_context/__init__.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/saml2/authn_context/__init__.py b/src/saml2/authn_context/__init__.py
index 849ea0b4..4643bd37 100644
--- a/src/saml2/authn_context/__init__.py
+++ b/src/saml2/authn_context/__init__.py
@@ -3,8 +3,6 @@ from saml2.samlp import RequestedAuthnContext
__author__ = 'rolandh'
-import hashlib
-
from saml2 import extension_elements_to_elements
UNSPECIFIED = "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified"
@@ -36,6 +34,7 @@ CMP_TYPE = ['exact', 'minimum', 'maximum', 'better']
class AuthnBroker(object):
def __init__(self):
self.db = {"info": {}, "key": {}}
+ self.next = 0
def exact(self, a, b):
return a == b
@@ -81,17 +80,8 @@ class AuthnBroker(object):
else:
raise NotImplementedError()
- m = hashlib.md5()
- for attr in ["method", "level", "authn_auth"]:
- m.update(str(_info[attr]))
- try:
- _txt = "%s" % _info["decl"]
- except KeyError:
- pass
- else:
- m.update(_txt)
-
- _ref = m.hexdigest()
+ self.next += 1
+ _ref = str(self.next)
self.db["info"][_ref] = _info
try:
self.db["key"][key].append(_ref)