Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
crypto.hpp File Reference
#include "inexor/shared/cube_types.hpp"

Go to the source code of this file.

Functions

void hashpassword (int cn, int sessionid, const char *pwd, char *result, int maxlen=MAXSTRLEN)
 Get the session hash. More...
 
bool checkpassword (int cn, int sessionid, const char *wanted, const char *given)
 Checks if the given session hash results from our pw or not. More...
 

Function Documentation

bool checkpassword ( int  cn,
int  sessionid,
const char *  wanted,
const char *  given 
)

Checks if the given session hash results from our pw or not.

It answers: is our hash valid for our password?

References tiger::hash(), and hashpassword().

Referenced by server::allowconnect(), and server::setmaster().

void hashpassword ( int  cn,
int  sessionid,
const char *  pwd,
char *  result,
int  maxlen = MAXSTRLEN 
)

Get the session hash.

Formats the sessionid, the cn and a password string together to give a session hash.

References concatstring(), formatstring(), and hashstring().

Referenced by checkpassword(), game::hashpwd(), game::sendintro(), and game::setmaster().