From 13f8c8293cf59de31497d15a17a17958b98e7ecb Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Fri, 24 May 2013 11:42:55 +0200 Subject: [PATCH] Switched to use a simple monotonic increased identifier for authn types. --- src/saml2/authn_context/__init__.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/saml2/authn_context/__init__.py b/src/saml2/authn_context/__init__.py index 849ea0b..4643bd3 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)