Skip to content

Commit 3f832aa

Browse files
committed
use hashlib.new syntax which handles non-existent arguments. This allows py3.8 to ignore the usedforsecurity argument.
1 parent 72701b7 commit 3f832aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

oidc_provider/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import base64
22
import binascii
3-
from hashlib import md5, sha256
3+
import hashlib
4+
from hashlib import sha256
45
import json
56

67
from django.db import models
@@ -264,5 +265,7 @@ def __unicode__(self):
264265
@property
265266
def kid(self):
266267
return u'{0}'.format(
267-
md5(self.key.encode('utf-8'), usedforsecurity=False).hexdigest() if self.key else ''
268+
hashlib.new("md5", self.key.encode('utf-8'), usedforsecurity=False).hexdigest()
269+
if self.key
270+
else ''
268271
)

0 commit comments

Comments
 (0)