send hashes instead of plaintext admin passwords

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3073 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2008-10-16 20:38:08 +00:00
parent 8a338d0b89
commit 37e22762b6
8 changed files with 231 additions and 50 deletions
+12
View File
@@ -2,6 +2,7 @@
#include "pch.h"
#include "cube.h"
#include "hash.h"
#ifdef _DEBUG
bool protocoldbg = false;
@@ -162,3 +163,14 @@ char msgsizelookup(int msg)
return -1;
}
const char *genpwdhash(const char *name, const char *pwd, int salt)
{
static string temp;
s_sprintf(temp)("%s %d %s %s %d", pwd, salt, name, pwd, PROTOCOL_VERSION);
tiger::hashval hash;
tiger::hash((uchar *)temp, strlen(temp), hash);
s_sprintf(temp)("%llx %llx %llx", hash.chunks[0], hash.chunks[1], hash.chunks[2]);
return temp;
}