diff --git a/Changelog b/Changelog index 7fa1821..ae1b6b3 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2c01] +* Allow selection of alternate hashing methods with $crypt(). (caf) + * Improve the initial seeding of the randm() fallback RNG. (caf) * Strengthen the cookie generation algorithm for /detach. (caf) diff --git a/source/functions.c b/source/functions.c index c7e199a..7ea3400 100644 --- a/source/functions.c +++ b/source/functions.c @@ -4189,16 +4189,13 @@ BUILT_IN_FUNCTION(function_crypt, words) #if defined(WINNT) RETURN_STR(empty_string); #else - char pass[9] = "\0"; - char seed[3] = "\0"; - char *blah, *bleh, *crypt (const char *, const char *); + char *pass, *salt; + extern char *crypt(const char *, const char *); - GET_STR_ARG(blah, words) - GET_STR_ARG(bleh, words) - strmcpy(pass, blah, 8); - strmcpy(seed, bleh, 2); + GET_STR_ARG(pass, words) + GET_STR_ARG(salt, words) - RETURN_STR(crypt(pass, seed)); + RETURN_STR(crypt(pass, salt)); #endif }