Changeset - 7327a0d1584c
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2011-03-22 12:05:34
marcin@python-works.com
fixes #136 leftover patch
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/auth.py
Show inline comments
 
@@ -97,27 +97,27 @@ class RhodeCodeCrypto(object):
 
            raise Exception('Unknown or unsupported platform %s' % __platform__)
 

	
 
    @classmethod
 
    def hash_check(cls, password, hashed):
 
        """
 
        Checks matching password with it's hashed value, runs different
 
        implementation based on platform it runs on
 
        
 
        :param password: password
 
        :param hashed: password in hashed form
 
        """
 

	
 
        if __platform__ == 'Windows':
 
        if __platform__ in PLATFORM_WIN:
 
            return sha256(password).hexdigest() == hashed
 
        elif __platform__ in ('Linux', 'Darwin'):
 
        elif __platform__ in PLATFORM_OTHERS:
 
            return bcrypt.hashpw(password, hashed) == hashed
 
        else:
 
            raise Exception('Unknown or unsupported platform %s' % __platform__)
 

	
 

	
 
def get_crypt_password(password):
 
    return RhodeCodeCrypto.hash_string(password)
 

	
 
def check_password(password, hashed):
 
    return RhodeCodeCrypto.hash_check(password, hashed)
 

	
 
def authfunc(environ, username, password):
0 comments (0 inline, 0 general)