Skip to content

Commit 4a70449

Browse files
committed
Bandit - silence old hash warnings.
They are not recommended. Kept for older installs. Newer installs get upgraded password storage using PBKDF2.
1 parent 00a7a78 commit 4a70449

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roundup/password.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def ssha(password, salt):
105105
Based on code of Roberto Aguilar <[email protected]>
106106
https://gist.github.com/rca/7217540
107107
'''
108-
shaval = sha1(password)
108+
shaval = sha1(password) # nosec
109109
shaval.update( salt )
110110
ssha_digest = b64encode( shaval.digest() + salt ).strip()
111111
return ssha_digest
@@ -185,9 +185,9 @@ def encodePassword(plaintext, scheme, other=None, config=None):
185185
salt = random_.token_bytes(salt_len)
186186
s = ssha(s2b(plaintext), salt)
187187
elif scheme == 'SHA':
188-
s = sha1(s2b(plaintext)).hexdigest()
188+
s = sha1(s2b(plaintext)).hexdigest() # nosec
189189
elif scheme == 'MD5':
190-
s = md5(s2b(plaintext)).hexdigest()
190+
s = md5(s2b(plaintext)).hexdigest() # nosec
191191
elif scheme == 'crypt' and crypt is not None:
192192
if other is not None:
193193
salt = other

0 commit comments

Comments
 (0)