SA-MP Forums Archive
Whirlpool, and y_ini issue. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whirlpool, and y_ini issue. (/showthread.php?tid=339784)



Whirlpool, and y_ini issue. - ReneG - 05.05.2012

So I am hashing passwords using Whirlpool, and I am having trouble with the user login. I've debugged it up to where the problem was. INI_ParseFile wasn't parsing the hashed password properly.
pawn Код:
public OnPlayerConnectEx(playerid)
{
    SetJoinCamera(playerid);
    resetVars(playerid);
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        printf("[debug] Pass: %s", PlayerInfo[playerid][pPass]); // this thing
        ShowPlayerLoginMenu(playerid, MENU_LOGIN);
    }
    else
    {
        ShowPlayerLoginMenu(playerid, MENU_REGISTER);
    }
    return 1;
}
The debug message prints
Код:
Pass:
What can I do to get the password to be loaded correctly?


Re: Whirlpool, and y_ini issue. - RicaNiel - 05.05.2012

Did you try to load it?

in INI_String


Re: Whirlpool, and y_ini issue. - ReneG - 05.05.2012

I'm an idiot. Forgot to post the LoadUser_data code.
pawn Код:
public LoadUser_data(playerid, name[], value[])
{
    INI_String("Password", PlayerInfo[playerid][pPass], 129);
    return 1;
}
EDIT:
================================================== ========================
I've added a debug message on the LoadUser_data callback. Console printed nothing so I'm guessing it's not calling the LoadUser_data function.


Re: Whirlpool, and y_ini issue. - ReneG - 05.05.2012

Bump.


Re: Whirlpool, and y_ini issue. - Face9000 - 05.05.2012

You use a stock to hash the password?


Re: Whirlpool, and y_ini issue. - ReneG - 05.05.2012

I'm using the Whirlpool plugin to hash the password. Nothing is wrong with the plugin. Just mainly loading the hashed password.


Re: Whirlpool, and y_ini issue. - warcodes_ - 05.05.2012

Whirpool hashes strings(inputtext) into an integra, so you will then have to use strval to compare the string with the buff. Just use INI_Int, i am sure it will fix the bug your experiencing.


Re: Whirlpool, and y_ini issue. - Face9000 - 05.05.2012

Tried this?

pawn Код:
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])



Re: Whirlpool, and y_ini issue. - warcodes_ - 05.05.2012

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Tried this?

pawn Код:
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
He is using Whirlpool, i doubt dudb and Whirlpool return the same result.


Re: Whirlpool, and y_ini issue. - ReneG - 05.05.2012

UDB hash is waaaaay more different than Whirlpool, and whirlpool returns a string, not an integer.