summaryrefslogtreecommitdiff
path: root/src/ladmin
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-28 14:34:58 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-28 14:34:58 +0000
commitef439f32648f3e9eca0c4f3b69413b53891cf3e7 (patch)
tree4724572d4f7dd8c9043e7edf4c658ed614fb4e6c /src/ladmin
parentc6751c77338a496ed61c5465fcdc55ed877ce96a (diff)
downloadhercules-ef439f32648f3e9eca0c4f3b69413b53891cf3e7.tar.gz
hercules-ef439f32648f3e9eca0c4f3b69413b53891cf3e7.tar.bz2
hercules-ef439f32648f3e9eca0c4f3b69413b53891cf3e7.tar.xz
hercules-ef439f32648f3e9eca0c4f3b69413b53891cf3e7.zip
* Tried and fixed md5 password encryption
- login_sql was doing stupid things like re-using one pre-generated key for all connections, and escaping binary md5 data (destroying it) - added missing code to login_txt when creating new accounts, showing that storing passwords as md5 hashes never really worked for txt - removed PASSWORDENC's conditional compilation effect, now just a flag - greatly simplified md5 password checking code, credits to eapp * login server will now bind only after finishing the init phase git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10384 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/ladmin')
-rw-r--r--src/ladmin/ladmin.c14
-rw-r--r--src/ladmin/ladmin.h4
2 files changed, 0 insertions, 18 deletions
diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c
index e4a358745..9376ea75e 100644
--- a/src/ladmin/ladmin.c
+++ b/src/ladmin/ladmin.c
@@ -46,9 +46,7 @@ void Gettimeofday(struct timeval *timenow)
#include "../common/version.h"
#include "../common/mmo.h"
-#ifdef PASSWORDENC
#include "../common/md5calc.h"
-#endif
//-------------------------------INSTRUCTIONS------------------------------
// Set the variables below:
@@ -63,11 +61,7 @@ void Gettimeofday(struct timeval *timenow)
char loginserverip[16] = "127.0.0.1"; // IP of login-server
int loginserverport = 6900; // Port of login-server
char loginserveradminpassword[24] = "admin"; // Administration password
-#ifdef PASSWORDENC
-int passenc = 2; // Encoding type of the password
-#else
int passenc = 0; // Encoding type of the password
-#endif
char defaultlanguage = 'E'; // Default language (F: Français/E: English)
// (if it's not 'F', default is English)
char ladmin_log_filename[1024] = "log/ladmin.log";
@@ -3274,7 +3268,6 @@ int parse_fromlogin(int fd) {
RFIFOSKIP(fd,3);
break;
-#ifdef PASSWORDENC
case 0x01dc: // answer of a coding key request
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
return 0;
@@ -3308,7 +3301,6 @@ int parse_fromlogin(int fd) {
bytes_to_read = 1;
RFIFOSKIP(fd,RFIFOW(fd,2));
break;
-#endif
case 0x7531: // Displaying of the version of the login-server
if (RFIFOREST(fd) < 10)
@@ -4182,9 +4174,7 @@ int Connect_login_server(void) {
printf("Error: Failed to connect to Login Server\n");
exit(1);
}
-#ifdef PASSWORDENC
if (passenc == 0) {
-#endif
WFIFOHEAD(login_fd,28);
WFIFOW(login_fd,0) = 0x7918; // Request for administation login
WFIFOW(login_fd,2) = 0; // no encrypted
@@ -4198,7 +4188,6 @@ int Connect_login_server(void) {
printf("Sending of the password...\n");
ladmin_log("Sending of the password..." RETCODE);
}
-#ifdef PASSWORDENC
} else {
WFIFOHEAD(login_fd,2);
WFIFOW(login_fd,0) = 0x791a; // Sending request about the coding key
@@ -4212,7 +4201,6 @@ int Connect_login_server(void) {
ladmin_log("Request about the MD5 key..." RETCODE);
}
}
-#endif
return 0;
}
@@ -4264,12 +4252,10 @@ int ladmin_config_read(const char *cfgName) {
} else if (strcmpi(w1, "admin_pass") == 0) {
strncpy(loginserveradminpassword, w2, sizeof(loginserveradminpassword));
loginserveradminpassword[sizeof(loginserveradminpassword)-1] = '\0';
-#ifdef PASSWORDENC
} else if (strcmpi(w1, "passenc") == 0) {
passenc = atoi(w2);
if (passenc < 0 || passenc > 2)
passenc = 0;
-#endif
} else if (strcmpi(w1, "defaultlanguage") == 0) {
if (w2[0] == 'F' || w2[0] == 'E')
defaultlanguage = w2[0];
diff --git a/src/ladmin/ladmin.h b/src/ladmin/ladmin.h
index b335984c7..824407af7 100644
--- a/src/ladmin/ladmin.h
+++ b/src/ladmin/ladmin.h
@@ -5,9 +5,5 @@
#define _LADMIN_H_
#define LADMIN_CONF_NAME "conf/ladmin_athena.conf"
-#define PASSWORDENC 3 // A definition is given when making an encryption password correspond.
- // It is 1 at the time of passwordencrypt.
- // It is made into 2 at the time of passwordencrypt2.
- // When it is made 3, it corresponds to both.
#endif /* _LADMIN_H_ */