Ticket #3316: auth_crypt.patch
File auth_crypt.patch, 582 bytes (added by , 18 years ago) |
---|
-
.py
old new 17 17 elif algo == 'sha1': 18 18 import sha 19 19 return hsh == sha.new(salt+raw_password).hexdigest() 20 elif algo == 'crypt': 21 try: 22 import crypt 23 except: 24 raise ValueError, "Crypt password algorithm not supported in this environment." 25 return hsh == crypt.crypt(raw_password, salt) 20 26 21 27 raise ValueError, "Got unknown password algorithm type in password."