Whirlpool, and y_ini issue.
#1

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?
Reply
#2

Did you try to load it?

in INI_String
Reply
#3

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.
Reply
#4

Bump.
Reply
#5

You use a stock to hash the password?
Reply
#6

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

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.
Reply
#8

Tried this?

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

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)