Ticket #3316: auth_crypt.patch

File auth_crypt.patch, 582 bytes (added by axiak@…, 18 years ago)

Update to patch as per mir's comments.

  • .py

    old new  
    1717    elif algo == 'sha1':
    1818        import sha
    1919        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)
    2026
    2127    raise ValueError, "Got unknown password algorithm type in password."
Back to Top