diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-23 15:41:51 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-23 15:41:51 +0100 |
commit | bf1bfcbac1e5d5fade8e0df53babd38e1a1132da (patch) | |
tree | 6a3217d1768ad73c0da7df565244ce77ea735eb4 /FICS | |
parent | 7c65b8bb9dcb35d77b52eda363152e293a649700 (diff) |
Fixed salt
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/adminproc.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/FICS/adminproc.c b/FICS/adminproc.c index 69eb9c3..ece63e1 100644 --- a/FICS/adminproc.c +++ b/FICS/adminproc.c @@ -890,7 +890,7 @@ com_addplayer(int p, param_list param) char *newplayer = param[0].val.word; char newplayerlower[MAX_LOGIN_NAME]; char password[PASSLEN + 1]; - char salt[3]; + char salt[6]; char text[2048]; int i; int p1; @@ -935,9 +935,12 @@ com_addplayer(int p, param_list param) password[i] = ('a' + rand() % 26); password[i] = '\0'; - salt[0] = ('a' + rand() % 26); - salt[1] = ('a' + rand() % 26); - salt[2] = '\0'; + salt[0] = '$'; + salt[1] = '1'; + salt[2] = '$'; + salt[3] = ('a' + rand() % 26); + salt[4] = ('a' + rand() % 26); + salt[5] = '\0'; parray[p1].passwd = xstrdup(crypt(password, salt)); } else { @@ -1137,7 +1140,7 @@ PUBLIC int com_cmuzzle(int p, param_list param) PUBLIC int com_asetpasswd(int p, param_list param) { - char salt[3]; + char salt[6]; char subject[400]; char text[10100]; int p1, connected; @@ -1171,9 +1174,12 @@ com_asetpasswd(int p, param_list param) sprintf(text, "Password of %s is now useless. Your account at " "our FICS has been locked.\n", parray[p1].name); } else { - salt[0] = ('a' + rand() % 26); - salt[1] = ('a' + rand() % 26); - salt[2] = '\0'; + salt[0] = '$'; + salt[1] = '1'; + salt[2] = '$'; + salt[3] = ('a' + rand() % 26); + salt[4] = ('a' + rand() % 26); + salt[5] = '\0'; parray[p1].passwd = xstrdup(crypt(param[1].val.word, salt)); |