SA-MP Forums Archive
I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - 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: I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? (/showthread.php?tid=396410)



I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - gtakillerIV - 30.11.2012

Hey guys, I'm having this problem which is that I can login with any password. Here is the code:

pawn Code:
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(strcmp(hashpass,PlayerInfo[playerid][Pass]) == 0)
{
       //Login user..etc
}
else
{
    //Give error
}
As you can see I'm using WhirlPool + y_ini.

WhirlPool works perfectly I've made a debug to show me if it hashed the inputtext or not and it did.


Re: I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - Peach - 30.11.2012

Are you using a script before it to check the string length?


Re: I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - ReneG - 30.11.2012

Check if PlayerInfo[playerid][Pass] is being loaded correctly. It's probably null.


Re: I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - gtakillerIV - 01.12.2012

Quote:
Originally Posted by Peach
View Post
Are you using a script before it to check the string length?
Yep.

Quote:
Originally Posted by VincentDunn
View Post
Check if PlayerInfo[playerid][Pass] is being loaded correctly. It's probably null.
If I send it like a string (%s) I get an empty line, but if I send it as an Integer I get a 0.


Re: I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - [MM]RoXoR[FS] - 01.12.2012

As you said it is giving you empty line so PlayerInfo[playerid][Pass] is not loading correctly.


Re: I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - JaKe Elite - 01.12.2012

show us your INI_ParseFile.


Re: I Can Login With Any Password Using Y_ini and WhirlPool, What's wrong? - gtakillerIV - 01.12.2012

Silly me I was loading it as an Integer.

Thanks to everyone that helped. Rep+

Argh need to spread some rep before giving it back to you Vincent.