From bd55cf078aeaae7929cfe5017e22fdf33616b769 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Wed, 1 Apr 2009 22:39:19 +0000 Subject: * Removed online_check config options. (always active now) * Clarified char_maintenance config option. * Changed packet 0x2712. (added request_id) * Changed packet 0x2713. (added sex, request_id, version, clienttype; removed email, expiration time, gmlevel) * Delayed user count check and mmo_char_send006b to when the account data arrives. * Created auxiliary function MD5_Salt. (split from a future commit that was getting to big for my taste) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13652 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/md5calc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/common/md5calc.c') diff --git a/src/common/md5calc.c b/src/common/md5calc.c index d6a38b865..2178739d6 100644 --- a/src/common/md5calc.c +++ b/src/common/md5calc.c @@ -9,6 +9,7 @@ #include "md5calc.h" #include #include +#include #ifndef UINT_MAX #define UINT_MAX 4294967295U @@ -227,3 +228,12 @@ void MD5_String(const char * string, char * output) digest[ 8], digest[ 9], digest[10], digest[11], digest[12], digest[13], digest[14], digest[15]); } + +/** output is a sequence of non-zero characters to be used as password salt. */ +void MD5_Salt(unsigned int len, char * output) +{ + unsigned int i; + for( i = 0; i < len; ++i ) + output[i] = (char)(1 + rand() % 255); + +} -- cgit v1.2.3-60-g2f50