aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/command.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/command.c
parent74b8ab228e7fc36f2a648b4e6b206c45d289aa85 (diff)
Fix the salt
Diffstat (limited to 'FICS/command.c')
-rw-r--r--FICS/command.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/FICS/command.c b/FICS/command.c
index a64c4ff..93de68d 100644
--- a/FICS/command.c
+++ b/FICS/command.c
@@ -33,6 +33,7 @@
#include "command.h"
#include "command_list.h"
#include "config.h"
+#include "fics_getsalt.h"
#include "ficsmain.h"
#include "gamedb.h"
#include "gameproc.h"
@@ -661,7 +662,7 @@ check_news(int p, int admin)
PRIVATE int
process_password(int p, char *password)
{
- char salt[6];
+ char salt[FICS_SALT_SIZE];
int dummy; // to hold a return value
int fd;
int messnum;
@@ -671,12 +672,8 @@ process_password(int p, char *password)
turn_echo_on(parray[p].socket);
if (parray[p].passwd && parray[p].registered) {
- salt[0] = '$';
- salt[1] = '1';
- salt[2] = '$';
- salt[3] = parray[p].passwd[0];
- salt[4] = parray[p].passwd[1];
- salt[5] = '\0';
+ strncpy(salt, &(parray[p].passwd[0]), sizeof salt - 1);
+ salt[sizeof salt - 1] = '\0';
if (strcmp(crypt(password, salt), parray[p].passwd)) {
fd = parray[p].socket;