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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user