Whirpool help
#1

Hello, I want to use whirlpool but there is a issue..

Evrything works fine, expect that no matter what I input I get logged in. If my password is 123456 and I type asdsad I will get logged in.

pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                //if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                 new hashpass[129]; //Will create a new variable to hash his/her password
                 WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password
                 if(!strcmp(hashpass,PlayerInfo[playerid][pPass]))
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    SetSpawnInfo(playerid, 265, 0, 1525.7687,-1667.9515,6.2188, 0, 0, 0, 0, 0, 0, 0 );
                    SpawnPlayer(playerid);
                    TogglePlayerSpectating( playerid, 0 );
                    SetPlayerSkin( playerid, PlayerInfo[playerid][pSkin] );
                    PlayerInfo[playerid][pLogs]++;

                }
                 else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                 return 1;
            }
        }
Reply
#2

That's because any password works on local host(your pc).
Reply
#3

Quote:
Originally Posted by DiGiTaL_AnGeL
Посмотреть сообщение
That's because any password works on local host(your pc).
what?
Reply
#4

You loaded your password correctly ? (PlayerInfo[playerid][pPass])
Reply
#5

Quote:
Originally Posted by Salim_Karaja
Посмотреть сообщение
You loaded your password correctly ? (PlayerInfo[playerid][pPass])


OnPlayerConnect

pawn Код:
if(fexist(UserPath(playerid)))
    {
    format(string, sizeof(string), "Server: Welcome %s!", GetICName(playerid));
    SendClientMessage(playerid, COLOR_WHITE, string);
    format(string, sizeof(string), "%d_%d", (random(98999)+1000), (random(89)+10));
    SetPVarString(playerid, "MaskID", string);
    for(new i=0;i<MAX_PLAYERS;i++)
    if(IsPlayerConnected(i))
    if(GetPVarInt(i, "Masked") == 1)
    ShowPlayerNameTagForPlayer(playerid, i, 0);
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
loaduser looks like this

pawn Код:
forward LoadUser_data(playerid,name[],value[]);

public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    INI_Int("Logs",PlayerInfo[playerid][pLogs]);
    return 1;
}
Reply
#6

Try change LoadUser_%s to LoadUser_data
Reply
#7

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
Try change LoadUser_%s to LoadUser_data
Hello, I tryed both and it still dosent work for some reason..
Reply
#8

I just tryed running this https://sampforum.blast.hk/showthread.php?tid=352703, downloaded the package, runned it as an gamemode on two different servers, I can still login with random password. I also tryed to change LoadUser_%s to LoadUser_data but no luck.

Please help.
Reply
#9

Use print statements to see if the saved password matches that of the password which you are hashing.
Reply
#10

After playing around.

I printed the input password you put in when register.

pawn Код:
Password = 21D5CB651222C347EA1284C0ACF162000B4D3E34766F0D00312E3480F633088822809B6A54BA7EDFA17E8FCB5713F8912EE3A218DD98D88C38BBF611B1B1ED2
           21D5CB651222C347EA1284C0ACF162000B4D3E34766F0D00312E3480F633088822809B6A54BA7EDFA17E8FCB5713F8912EE3A218DD98D88C38BBF611B1B1ED2B
First line is in the users.ini second line is on the printf, one extra B in the end.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)