Whirlpool fail?
#1

I recently switched my hatching plugin to Whirlpool, I already got a problem.
This is the login dialog's code.
pawn Код:
new pHash[129];
            WP_Hash(pHash,sizeof(pHash),inputtext);
            if(!strcmp(pInfo[playerid][Pass],pHash)) {
                INI_ParseFile(PlayerPath(playerid), "UserDataLoad_%s", .bExtra = true, .extra = playerid);
                GivePlayerMoney(playerid,pInfo[playerid][Cash]);
                SetPlayerScore(playerid,pInfo[playerid][Score]);
                if(pInfo[playerid][AdminLevel] == 0) {
                    SendClientMessage(playerid,lime,"You've successfully logged in!");
                } else {
                    SendClientMessage(playerid,lime,"Welcome,{FFFF00} administrator!");
                }
                pInfo[playerid][Logged] = 1;
            } else {
                if(gTries[playerid] == 0) gTries[playerid] = 1;
                if(gTries[playerid] == 3) {
                    new iStr[128];
                    format(iStr,sizeof(iStr),"%s has been kicked for exceeding login tries.",pName(playerid));
                    SendClientMessageToAll(red,iStr);
                    return Kick(playerid);
                }
                new iStr[128];
                format(iStr,sizeof(iStr),"You've entered an incorrect password. Tries: %i/3",gTries[playerid]);
                ShowPlayerDialog(playerid,iDialog1,DIALOG_STYLE_INPUT,"Login",iStr,"Login","Leave");
                gTries[playerid]++;
            }
        }
This is the register dialog's code: (a part of it)
pawn Код:
new pHash[129],pIP[16];
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid,iDialog2,DIALOG_STYLE_INPUT,"Register","Please input a password.","Register","Leave");
            WP_Hash(pHash,sizeof(pHash),inputtext);
            pInfo[playerid][Pass] = pHash;
                        UserDataSave(playerid);
I checked, the password is hashed in my user file.

Then I wanted to login, but it always said incorrect password..

Can you help me? :\
And the
Reply
#2

Print 'pInfo[playerid][Pass]' and 'pHash' in your login code.
Reply
#3

Код:
[21:01:54] F9A42F8EABDAB42DBD369E68571FC1C53BAE3C2BDAB2193C32A4CD74ACCC4DDC8CA7387CA8CAA38A6308848A2B428D6CB1BC8E8931C516CD15D409C430C13100
[21:01:54] F9A42F8EABDAB42DBD369E68571FC1C53BAE3C2BDAB2193C32A4CD74ACCC4DDC8CA7387CA8CAA38A6308848A2B428D6CB1BC8E8931C516CD15D409C430C1310
Reply
#4

Is there any reason why one of them is one character shorter than the other? What's the size of 'pInfo[playerid][Pass]'?
Reply
#5

It's 129 characters. Like every single hash variable.
Reply
#6

Show us the code you use to get the password from the file.
Reply
#7

It's in INI_ParseFile
pawn Код:
INI_String("Pass",pInfo[playerid][Pass],129);
Reply
#8

Bump, I really need this. :\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)