Django

Code

Ticket #3316: auth_crypt.patch

File auth_crypt.patch, 0.6 kB (added by axiak@mit.edu, 2 years ago)

Update to patch as per mir's comments.

  • /root/modules_old.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."