Problem with Whirpool...
#1

Well, I got a rare 'bug', I register and the password get's saved on a .ini file hashed correctly, if I re-enter and type a wrong password it will say that it's wrong.. all fine to here, but if I restart the server, ant type a different password, the password line on the .ini get's deleted, and therefore you can login with any password.. With 'udb_hash' this didn't happend to me..
Thanks
Reply
#2

post the code where you write to the file

"This forum requires that you wait 120 seconds between posts. Please try again in 61 seconds."
Reply
#3

pawn Код:
format(string, 128, "Users/%s.ini", name1);
WP_Hash(pass, 129, inputtext);
djSet(string, "password", pass);
When I register the first time the password get saved and hashed to the file, then I restart the server, connect and password line gets deleted..
Reply
#4

does the line get deleted when the player logs in or when you start the server? Be sure!
Reply
#5

It get's deleted when the player connects, before he types anything.
Reply
#6

Paste your code from OnPlayerConnect
Reply
#7

pawn Код:
public OnPlayerConnect(playerid)
{
    new string[128], str[128], name1[25], IP[16];
    GetPlayerName(playerid, name1, 25);
    GetPlayerIp(playerid, IP, 16);
    SetPlayerColor(playerid, COLOR_WHITE);
    PickedClass[playerid] = NONE;
    gPlayerClass[playerid] = NONE;
    logged[playerid] = 0;
    SpawnP[playerid] = 1;
    AFK[playerid] = 0;
    rank[playerid] = 0;
    kills[playerid] = 0;
    deaths[playerid] = 0;
    flags[playerid] = 0;
    zones[playerid] = 0;
    Muted[playerid] = 0;
    spree[playerid] = 0;
    countpass[playerid] = 0;
    VidaJugador[playerid] = 100.0;
    ArmaduraJugador[playerid] = 0.0;
    pSpawned[playerid] = 0;
    Escondido[playerid] = 0;
    gWhisper[playerid] = 1;
    teleportToggle[playerid] = false;
    Freezed[playerid] = false;
    ix[playerid] = false;
    TiempoOnHoras[playerid] = 0;
    TiempoOnMinutos[playerid] = 0;
    TiempoOnSegundos[playerid] = 0;
    Players++;
    Visitas++;
    ResetPlayerWeapons(playerid);
    Score[playerid] = SetTimerEx("ACTScore", 5000, 1, "i", playerid);
    TiempoOnJugador[playerid] = SetTimerEx("ACTTiempoOn", 955, 1, "i", playerid);
    TogglePlayerClock(playerid, 0);
    for(new i; i < 23; i++)
    {
        EstaCapturandose[i][playerid] = 31;
    }
    for(new i = 0; i < 47; i++)
    {
        ArmasJugadores[playerid][i] = 0;
    }
    format(string, 128, "Users/%s.ini", name1);
    if(djExists(string))
    {
        djSet(string, "ip", IP);
        ShowPlayerDialog(playerid, 60, DIALOG_STYLE_INPUT, "Login","ЎBienvenido a Desert Wars!\n\nYa tienes una cuenta en el servidor\n\nIngresa tu contraseсa:","Login","Cancelar");
    }
    else if(!djExists(string))
    {
        ShowPlayerDialog(playerid, 55, DIALOG_STYLE_INPUT,"Registro","ЎBienvenido a Desert Wars!\n\nPor favor, registra una cuenta para jugar\n\nIngresa una contraseсa:","Registrar","Salir");
    }
    //Computadoras
    SetPlayerMapIcon(playerid, 0, -267.5736, 2590.6177, 63.5703, 12, 0);
    SetPlayerMapIcon(playerid, 1, -148.1658, 1130.1038, 19.7422, 12, 0);
    SetPlayerMapIcon(playerid, 2, -691.5708, 942.0986, 13.6328, 12, 0);
    SetPlayerMapIcon(playerid, 3, -1518.8713, 2608.4832, 55.8359, 12, 0);
    SetPlayerMapIcon(playerid, 4, -835.1141, 1514.3994, 20.5838, 12, 0);
    SetPlayerMapIcon(playerid, 5, 204.3758, 1872.7375, 13.1470, 12, 0);
    //Area51
    SetPlayerMapIcon(playerid, 6, 219.6253, 1823.1097, 7.5022, 56, 0);
    //Ammu-nations
    SetPlayerMapIcon(playerid, 7, 777.4450,1871.4246,4.9067, 6, 0);
    SetPlayerMapIcon(playerid, 8, -315.8113,829.8170,14.2422, 6, 0);
    SetPlayerMapIcon(playerid, 9, -314.4954,1774.4213,43.6406, 6, 0);
    SetPlayerMapIcon(playerid, 10, -604.3909,2716.7764,72.7231, 6, 0);
    SetPlayerMapIcon(playerid, 11, -286.5354,2692.7466,62.6875,6, 0);
    SetPlayerMapIcon(playerid, 12, -181.6294, 1166.3633, 19.7500, 6, 0);
    SetPlayerMapIcon(playerid, 13, -1508.7599, 2609.7534, 55.8359, 6, 0);//Japon Ammu
    SetPlayerMapIcon(playerid, 14, -746.6768, 1589.8668, 26.9666, 6, 0);//Rusia Ammu
    //Hospital
    SetPlayerMapIcon(playerid, 15, 981.2609, 1735.0260, 8.6484, 22, 0);
    //Checkpoints
    AntenaLV[playerid] = CreateDynamicCP(-290.3261, 1535.8268, 75.5625, 2.0, -1, -1, playerid, 50.0);//antena lv
    Restaurante[playerid] = CreateDynamicCP(-549.9635, 2593.4824, 53.9348, 2.0, -1, -1, playerid, 50.0);//restaurante
    Aeropuerto[playerid] = CreateDynamicCP(387.4603, 2543.2463, 16.5527, 2.0, -1, -1, playerid, 150.0);//Aeropuerto
    CampoE[playerid] = CreateDynamicCP(767.3187, 2032.8800, 6.7109, 2.0, -1, -1, playerid, 50.0);//campo electrico
    Area51[playerid] = CreateDynamicCP(248.9298, 1860.6715, 14.0840, 2.0, -1, -1, playerid, 200.0);//area 51
    EGas[playerid] = CreateDynamicCP(669.5795, 1704.1251, 7.1949, 2.0, -1, -1, playerid, 50.0);//estacion de gas
    CPetrol[playerid] = CreateDynamicCP(217.7153, 1426.6178, 10.5859, 2.0, -1, -1, playerid, 150.0);//compaсia de petroleo
    RTrenes[playerid] = CreateDynamicCP(591.7527, 1260.3960, 11.7113, 2.0, -1, -1, playerid, 70.0);//recarga de trenes
    Represa[playerid] = CreateDynamicCP(-611.8702, 1844.2659, 22.9245, 2.0, -1, -1, playerid, 200.0);//represa
    CiudadA[playerid] = CreateDynamicCP(-391.0566, 2220.5225, 42.4297, 2.0, -1, -1, playerid, 70.0);//ciudad antigua
    UniversidadC[playerid] = CreateDynamicCP(1045.7263, 1011.3082, 11.0000, 2.0, -1, -1, playerid, 70.0);//universidad
    BAceite[playerid] = CreateDynamicCP(1066.2263, 2918.4385, 47.8231, 2.0, -1, -1, playerid, 35.0);//bomba aceite
    Cluckin[playerid] = CreateDynamicCP(-1203.3126, 1816.1016, 41.7188, 2.0, -1, -1, playerid, 70.0);//cluckinbell
    CPlaya[playerid] = CreateDynamicCP(258.7230, 2892.2939, 11.0182, 2.0, -1, -1, playerid, 70.0);//cabaсa playa
    DinerC[playerid] = CreateDynamicCP(-1939.6593, 2380.7039, 49.6953, 2.0, -1, -1, playerid, 70.0);//diner
    CasinoC[playerid] = CreateDynamicCP(2020.0873, 1007.4487, 10.8203, 2.0, -1, -1, playerid, 50.0);//casino
    AmmuC[playerid] = CreateDynamicCP(312.2892, -165.6648, 999.6010, 0.8, -1, -1, playerid, 10.0);//ammu-nation
    RanchoC[playerid] = CreateDynamicCP(-1352.9404, 2057.4385, 53.1172, 2.0, -1, -1, playerid, 25.0);//rancho
    Electric2C[playerid] = CreateDynamicCP(-1803.3779, 2038.3523, 9.5902, 2.0, -1, -1, playerid, 25.0);//electric2
    BungalowC[playerid] = CreateDynamicCP(-803.9335, 2760.7488, 45.8272, 2.0, -1, -1, playerid, 35.0);//bungalow
    HospitalC[playerid] = CreateDynamicCP(940.0401, 1733.4958, 8.8516, 2.0, -1, -1, playerid, 50);//hospital
    QuarryC[playerid] = CreateDynamicCP(589.8381, 870.4116, -42.4973, 2.0, -1, -1, playerid, 50);//quarry
    BaseAC[playerid] = CreateDynamicCP(-2471.4641, 1538.9769, 33.2344, 2.0, -1, -1, playerid, 200);//base aerea
    CabanaC[playerid] = CreateDynamicCP(-690.9512, 928.7953, 13.6293, 2.0, -1, -1, playerid, 30);//cabaсa
    //Equipo
    Teams[playerid] = TextDrawCreate(174.000000,135.000000," ");
    TextDrawAlignment(Teams[playerid], 0);
    TextDrawBackgroundColor(Teams[playerid], 0x000000ff);
    TextDrawFont(Teams[playerid], 1);
    TextDrawLetterSize(Teams[playerid],0.599999,1.200000);
    TextDrawColor(Teams[playerid], 0xffffffff);
    TextDrawSetOutline(Teams[playerid],1);
    TextDrawSetProportional(Teams[playerid],1);
    TextDrawSetShadow(Teams[playerid],1);
    //Equipo
    Jugadores[playerid] = TextDrawCreate(44.000000, 242.000000, "Jugadores: 15");
    TextDrawBackgroundColor(Jugadores[playerid], 255);
    TextDrawFont(Jugadores[playerid], 2);
    TextDrawLetterSize(Jugadores[playerid], 0.219999, 1.500000);
    TextDrawColor(Jugadores[playerid], -1);
    TextDrawSetOutline(Jugadores[playerid], 1);
    TextDrawSetProportional(Jugadores[playerid], 1);
    //Estado Motor
    Motor[playerid] = TextDrawCreate(524.000000, 396.000000, " ");
    TextDrawBackgroundColor(Motor[playerid], 255);
    TextDrawFont(Motor[playerid], 2);
    TextDrawLetterSize(Motor[playerid], 0.319999, 1.200000);
    TextDrawColor(Motor[playerid], -1);
    TextDrawSetOutline(Motor[playerid], 1);
    TextDrawSetProportional(Motor[playerid], 1);
    //Barra abajo
    tBarra[playerid] = TextDrawCreate(320.0, 430.000000, " ");
    TextDrawBackgroundColor(tBarra[playerid], 255);
    TextDrawFont(tBarra[playerid], 1);
    TextDrawLetterSize(tBarra[playerid], 0.340000, 1.500000);
    TextDrawColor(tBarra[playerid], -1);
    TextDrawAlignment(tBarra[playerid], 2);
    TextDrawSetOutline(tBarra[playerid], 1);
    TextDrawSetProportional(tBarra[playerid], 1);
    //Cuenta atras
    TRPC[playerid] = TextDrawCreate(24.000000, 295.000000, RESET);
    TextDrawBackgroundColor(TRPC[playerid], 255);
    TextDrawFont(TRPC[playerid], 1);
    TextDrawLetterSize(TRPC[playerid], 0.330000, 1.199999);
    TextDrawColor(TRPC[playerid], -1);
    TextDrawSetOutline(TRPC[playerid], 1);
    TextDrawSetProportional(TRPC[playerid], 1);
    TextDrawUseBox(TRPC[playerid], 1);
    TextDrawBoxColor(TRPC[playerid], 0x00000085);
    TextDrawTextSize(TRPC[playerid], 160.000000, -23.000000);
    //Bombas demoledor
    Bomba[playerid] = TextDrawCreate(514.000000, 129.000000, " ");
    TextDrawBackgroundColor(Bomba[playerid], 255);
    TextDrawFont(Bomba[playerid], 1);
    TextDrawLetterSize(Bomba[playerid], 0.340000, 2.100001);
    TextDrawColor(Bomba[playerid], -1);
    TextDrawSetOutline(Bomba[playerid], 1);
    TextDrawSetProportional(Bomba[playerid], 1);
    //Clases
    Clase[playerid] = TextDrawCreate(320.000000, 245.000000, " ");
    TextDrawAlignment(Clase[playerid], 2);
    TextDrawBackgroundColor(Clase[playerid], 255);
    TextDrawFont(Clase[playerid], 3);
    TextDrawLetterSize(Clase[playerid], 0.469998, 2.199999);
    TextDrawColor(Clase[playerid], -1);
    TextDrawSetOutline(Clase[playerid], 1);
    TextDrawSetProportional(Clase[playerid], 1);
    TextDrawUseBox(Clase[playerid], 1);
    TextDrawBoxColor(Clase[playerid], 85);
    TextDrawTextSize(Clase[playerid], 2.000000, 218.000000);

    Info[playerid] = TextDrawCreate(320.000000, 269.000000, " ");
    TextDrawAlignment(Info[playerid], 2);
    TextDrawBackgroundColor(Info[playerid], 255);
    TextDrawFont(Info[playerid], 1);
    TextDrawLetterSize(Info[playerid], 0.300000, 1.000000);
    TextDrawColor(Info[playerid], -1);
    TextDrawSetOutline(Info[playerid], 1);
    TextDrawSetProportional(Info[playerid], 1);
    TextDrawUseBox(Info[playerid], 1);
    TextDrawBoxColor(Info[playerid], 85);
    TextDrawTextSize(Info[playerid], 426.000000, 218.000000);
    //Gangzones
    GangZoneShowForPlayer(playerid, USA, COLOR_USA);
    GangZoneShowForPlayer(playerid, GERMANY, COLOR_GERMANY);
    GangZoneShowForPlayer(playerid, JAPAN, COLOR_YELLOWJ);
    GangZoneShowForPlayer(playerid, RUSSIA, COLOR_RUSSIA);
    //Barra abajo
    TextDrawShowForPlayer(playerid, tBarra[playerid]);
    TextDrawShowForPlayer(playerid, tBarraFondo);
    //Hora
    TextDrawShowForPlayer(playerid, tHora);

    format(str, 128, "%s ha ingresado al servidor, jugadores conectados: %d [IP: %s]", name1, Players ,IP);
    format(string, 128, "%s ha ingresado al servidor. Jugadores conectados: %d", name1, Players);
    GuardarA("Logs", "EntradasYSalidas", str);
    foreach(Player, i)
    {
        if(logged[i] != 0)
        {
            if(adminlevel[i] > 1)
            {
                SendClientMessage(i, COLOR_WHITE, str);
            }
            else
            {
                SendClientMessage(i, COLOR_WHITE, string);
            }
        }
    }
    return 1;
}
I checked it like 20 times.. it's really wierd, only with WP_Hash happends, now I have it with udb_hash and works fine.. :/
Reply
#8

A possible reason is that you try to hash an empty string, make sure it's never empty
Reply
#9

I did put

if(strlen(inputtext) == 0) //bla bla bla...

And it get's deleted even if he doesn't type anything..
Reply
#10

use isnull instead of strlen

Is the length of the string large enough for the encrypted string?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)