aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/adminproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-25 07:07:05 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-25 07:07:05 +0100
commit5fb77c3337679d5661a3e14747481355fbc82bfd (patch)
treead29badd5b13f1dccc12fe06c87e1859740d50ac /FICS/adminproc.c
parent74b8ab228e7fc36f2a648b4e6b206c45d289aa85 (diff)
Fix the salt
Diffstat (limited to 'FICS/adminproc.c')
-rw-r--r--FICS/adminproc.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/FICS/adminproc.c b/FICS/adminproc.c
index d7c5bdc..6f10d94 100644
--- a/FICS/adminproc.c
+++ b/FICS/adminproc.c
@@ -26,6 +26,7 @@
#include "adminproc.h"
#include "command.h"
#include "comproc.h"
+#include "fics_getsalt.h"
#include "gamedb.h"
#include "gameproc.h"
#include "multicol.h"
@@ -935,7 +936,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[6];
+ char salt[FICS_SALT_SIZE];
char text[2048];
int i;
int p1;
@@ -980,12 +981,7 @@ com_addplayer(int p, param_list param)
password[i] = ('a' + rand() % 26);
password[i] = '\0';
- salt[0] = '$';
- salt[1] = '1';
- salt[2] = '$';
- salt[3] = ('a' + rand() % 26);
- salt[4] = ('a' + rand() % 26);
- salt[5] = '\0';
+ strcpy(salt, fics_getsalt());
parray[p1].passwd = xstrdup(crypt(password, salt));
} else {
@@ -1185,7 +1181,7 @@ PUBLIC int com_cmuzzle(int p, param_list param)
PUBLIC int
com_asetpasswd(int p, param_list param)
{
- char salt[6];
+ char salt[FICS_SALT_SIZE];
char subject[400];
char text[10100];
int p1, connected;
@@ -1219,12 +1215,7 @@ 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] = '$';
- salt[1] = '1';
- salt[2] = '$';
- salt[3] = ('a' + rand() % 26);
- salt[4] = ('a' + rand() % 26);
- salt[5] = '\0';
+ strcpy(salt, fics_getsalt());
parray[p1].passwd = xstrdup(crypt(param[1].val.word, salt));