From 4d2bdb9a9727d61c8ea9cb009c8edb6551a40d29 Mon Sep 17 00:00:00 2001 From: Ignacio Fiorentino Date: Wed, 26 Oct 2016 17:04:12 -0300 Subject: [PATCH] Generate bigger secret with sha224. --- oidc_provider/admin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oidc_provider/admin.py b/oidc_provider/admin.py index 1a05dbd..80e8cb9 100644 --- a/oidc_provider/admin.py +++ b/oidc_provider/admin.py @@ -1,4 +1,4 @@ -from hashlib import md5 +from hashlib import sha224 from random import randint from uuid import uuid4 @@ -36,12 +36,12 @@ class ClientForm(ModelForm): if instance and instance.pk: if (self.cleaned_data['client_type'] == 'confidential') and not instance.client_secret: - secret = md5(uuid4().hex.encode()).hexdigest() + secret = sha224(uuid4().hex.encode()).hexdigest() elif (self.cleaned_data['client_type'] == 'confidential') and instance.client_secret: secret = instance.client_secret else: if (self.cleaned_data['client_type'] == 'confidential'): - secret = md5(uuid4().hex.encode()).hexdigest() + secret = sha224(uuid4().hex.encode()).hexdigest() return secret