diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2014-04-08 19:50:09 -0500 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2014-04-09 13:54:30 -0500 |
commit | 82359492dc14e679d48e6801da304027e508533c (patch) | |
tree | 8b98f65c7bdb7f56a4229de4fa9e93215c8c36e9 /keystoneclient/utils.py | |
parent | 61322a3feeb943e5341fc25c6df957aec59463be (diff) | |
download | python-keystoneclient-82359492dc14e679d48e6801da304027e508533c.tar.gz |
Hash functions support different hash algorithms
The token hash functions always used MD5. With this change, the
hash function can be passed in to the hash functions.
SecurityImpact
Related-Bug: #1174499
Change-Id: Ia08c2d6252bb034087a244b47d5bcbea7dcfa70b
Diffstat (limited to 'keystoneclient/utils.py')
-rw-r--r-- | keystoneclient/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/keystoneclient/utils.py b/keystoneclient/utils.py index 00d58b7..01f134e 100644 --- a/keystoneclient/utils.py +++ b/keystoneclient/utils.py @@ -141,8 +141,8 @@ def isunauthenticated(f): return getattr(f, 'unauthenticated', False) -def hash_signed_token(signed_text): - hash_ = hashlib.md5() +def hash_signed_token(signed_text, mode='md5'): + hash_ = hashlib.new(mode) hash_.update(signed_text) return hash_.hexdigest() |