src/server/security-server-password.c
/* Compare current password Stored password is hashed by SHA-256 Algorithm */
Compare current password Stored password is hashed by SHA-256 Algorithm
Compare current password Stored password is hashed by SHA - 256 Algorithm
int check_password(const unsigned char *cur_pwd, const unsigned char *requested_pwd,
			const unsigned int max_attempts, const unsigned int expire_time,
			int *current_attempt)
{
	unsigned int current_time;
	if(max_attempts != 0)
	{
		*current_attempt = get_current_attempt(1);
		if(*current_attempt > max_attempts)
		{
			SEC_SVR_DBG("Server: Max attempt exceeded: %d, %d", *current_attempt, max_attempts);
			return SECURITY_SERVER_ERROR_PASSWORD_MAX_ATTEMPTS_EXCEEDED;
		}
		if(*current_attempt < 0)
		{
			SEC_SVR_DBG("Server: Attempt file operation failed. Ignoring... : %d", *current_attempt);
		}
	}
	if(memcmp(cur_pwd, requested_pwd, SECURITY_SERVER_HASHED_PWD_LEN) != 0)
	{
	    SEC_SVR_DBG("%s", "Password mismatched");
	    return SECURITY_SERVER_ERROR_PASSWORD_MISMATCH;
	}
    if(expire_time == 0)
    {
        SEC_SVR_DBG("Server: Password has been expired: %d, %d", current_time, expire_time);
        return SECURITY_SERVER_ERROR_PASSWORD_EXPIRED;
    }
    SEC_SVR_DBG("%s", "Password matched");
    return SECURITY_SERVER_SUCCESS;
}
int check_password ( const unsigned char * cur_pwd , const unsigned char * requested_pwd , const unsigned int max_attempts , const unsigned int expire_time , int * current_attempt ) { unsigned int current_time ; if ( max_attempts != 0 ) { * current_attempt = get_current_attempt ( 1 ) ; if ( * current_attempt > max_attempts ) { SEC_SVR_DBG ( " " , * current_attempt , max_attempts ) ; return SECURITY_SERVER_ERROR_PASSWORD_MAX_ATTEMPTS_EXCEEDED ; } if ( * current_attempt < 0 ) { SEC_SVR_DBG ( " " , * current_attempt ) ; } } if ( memcmp ( cur_pwd , requested_pwd , SECURITY_SERVER_HASHED_PWD_LEN ) != 0 ) { SEC_SVR_DBG ( " " , " " ) ; return SECURITY_SERVER_ERROR_PASSWORD_MISMATCH ; } if ( expire_time == 0 ) { SEC_SVR_DBG ( " " , current_time , expire_time ) ; return SECURITY_SERVER_ERROR_PASSWORD_EXPIRED ; } SEC_SVR_DBG ( " " , " " ) ; return SECURITY_SERVER_SUCCESS ; }
Compare current password Stored password is hashed by SHA-256 Algorithm
Compare current password Stored password is hashed by SHA - 256 Algorithm
/* Compare */