Don't truncate the password and salt passed to crypt() by the $crypt()

scripting function - this allows alternate hashing methods to be selected
if supported by the C library.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@361 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2013-08-20 12:50:39 +00:00
parent 9207c838f9
commit 4118a120bc
2 changed files with 7 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2c01] [Changes 1.2c01]
* Allow selection of alternate hashing methods with $crypt(). (caf)
* Improve the initial seeding of the randm() fallback RNG. (caf) * Improve the initial seeding of the randm() fallback RNG. (caf)
* Strengthen the cookie generation algorithm for /detach. (caf) * Strengthen the cookie generation algorithm for /detach. (caf)

View File

@@ -4189,16 +4189,13 @@ BUILT_IN_FUNCTION(function_crypt, words)
#if defined(WINNT) #if defined(WINNT)
RETURN_STR(empty_string); RETURN_STR(empty_string);
#else #else
char pass[9] = "\0"; char *pass, *salt;
char seed[3] = "\0"; extern char *crypt(const char *, const char *);
char *blah, *bleh, *crypt (const char *, const char *);
GET_STR_ARG(blah, words) GET_STR_ARG(pass, words)
GET_STR_ARG(bleh, words) GET_STR_ARG(salt, words)
strmcpy(pass, blah, 8);
strmcpy(seed, bleh, 2);
RETURN_STR(crypt(pass, seed)); RETURN_STR(crypt(pass, salt));
#endif #endif
} }