[Help] Whirpool problem (Weird)
#1

Hello, this problem comes randomly and im not getting it...

Imagine you join server, type your password and script say's its wrong (3 Times you can enter password).. you reconnect, type it again and you enter...

This happens randomly...

Its Yini + Whirpool il'l give you login dialog for example.

Il'l cut script to be easier to read.

Код:
case DIALOG_LOGIN:
{
	if(response)
	{
		new hashpass[129];
		WP_Hash(hashpass,sizeof(hashpass),inputtext);
		if(!strcmp(hashpass, PlayerInfo[playerid][pPassword], false))
		{
			//IF Password is good, login part
		}
		else
		{
	           //if miss 3 times part when kick's him..
		}
	}
	else Kick(playerid);
}
Reply
#2

It can be random only if you use random values. Run a simple unit test on WP_Hash to check how it works - if it always provide correct hash then you should look for an issue in your code

Print hashpass and inputtext to see in which case you get errors.
Reply
#3

pawn Код:
case DIALOG_LOGIN:
{
    if(response)
    {
        new hashpass[129];
        WP_Hash(hashpass,sizeof(hashpass),inputtext);
        if(!strcmp(hashpass, PlayerInfo[playerid][pPassword], false))
        {
            //IF Password is good, login part
        }
        else
        {
               //if miss 3 times part when kick's him..
        }
        printf("%s", PlayerInfo[playerid][pPassword]);
        printf("%s", hashpass);
    }
    else Kick(playerid);
}
Tell me the results of the printf function.

EDIT:
Probably the size of PlayerInfo[playerid][pPassword] is 128, on which Whirlpool requires 129.
Reply
#4

Il'l tell you result of print in thurdsay, cant make it earlier.. I put 129 on all and check all few times so...
Reply
#5

Quote:
Originally Posted by lukewid
Посмотреть сообщение
pawn Код:
case DIALOG_LOGIN:
{
    if(response)
    {
        new hashpass[129];
        WP_Hash(hashpass,sizeof(hashpass),inputtext);
        if(!strcmp(hashpass, PlayerInfo[playerid][pPassword], false))
        {
            //IF Password is good, login part
        }
        else
        {
               //if miss 3 times part when kick's him..
        }
        printf("%s", PlayerInfo[playerid][pPassword]);
        printf("%s", hashpass);
    }
    else Kick(playerid);
}
Tell me the results of the printf function.

EDIT:
Probably the size of PlayerInfo[playerid][pPassword] is 128, on which Whirlpool requires 129.
Print is the same... if that was mistake you could never login with same password
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)