summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorhemagx <hemagx2@gmail.com>2016-02-17 14:26:01 +0200
committerHaru <haru@dotalux.com>2016-07-12 20:58:34 +0200
commit732c6d6019d608f9f0e151ec75c48fcc498d4f51 (patch)
tree85691162dcea7fad5c050cf3414bed2e77cc33f9 /src/login
parentad05eb4f2e531f5a9aec6f27d2f69fd53b6525ac (diff)
downloadhercules-732c6d6019d608f9f0e151ec75c48fcc498d4f51.tar.gz
hercules-732c6d6019d608f9f0e151ec75c48fcc498d4f51.tar.bz2
hercules-732c6d6019d608f9f0e151ec75c48fcc498d4f51.tar.xz
hercules-732c6d6019d608f9f0e151ec75c48fcc498d4f51.zip
Interface md5calc.c
Diffstat (limited to 'src/login')
-rw-r--r--src/login/lclif.c10
-rw-r--r--src/login/login.c14
2 files changed, 12 insertions, 12 deletions
diff --git a/src/login/lclif.c b/src/login/lclif.c
index 9515c5940..3ed257e85 100644
--- a/src/login/lclif.c
+++ b/src/login/lclif.c
@@ -86,7 +86,7 @@ enum parsefunc_rcode lclif_parse_CA_LOGIN(int fd, struct login_session_data *sd)
safestrncpy(sd->passwd, packet->password, PASSWD_LEN);
if (login->config->use_md5_passwds)
- MD5_String(sd->passwd, sd->passwd);
+ md5->string(sd->passwd, sd->passwd);
sd->passwdenc = PWENC_NONE;
login->client_login(fd, sd);
@@ -160,7 +160,7 @@ enum parsefunc_rcode lclif_parse_CA_LOGIN_PCBANG(int fd, struct login_session_da
safestrncpy(sd->passwd, packet->password, PASSWD_LEN);
if (login->config->use_md5_passwds)
- MD5_String(sd->passwd, sd->passwd);
+ md5->string(sd->passwd, sd->passwd);
sd->passwdenc = PWENC_NONE;
login->client_login(fd, sd);
@@ -183,7 +183,7 @@ enum parsefunc_rcode lclif_parse_CA_LOGIN_HAN(int fd, struct login_session_data
safestrncpy(sd->passwd, packet->password, PASSWD_LEN);
if (login->config->use_md5_passwds)
- MD5_String(sd->passwd, sd->passwd);
+ md5->string(sd->passwd, sd->passwd);
sd->passwdenc = PWENC_NONE;
login->client_login(fd, sd);
@@ -209,7 +209,7 @@ enum parsefunc_rcode lclif_parse_CA_SSO_LOGIN_REQ(int fd, struct login_session_d
safestrncpy(sd->passwd, packet->t1, min(tokenlen + 1, PASSWD_LEN)); // Variable-length field, don't copy more than necessary
if (login->config->use_md5_passwds)
- MD5_String(sd->passwd, sd->passwd);
+ md5->string(sd->passwd, sd->passwd);
sd->passwdenc = PWENC_NONE;
login->client_login(fd, sd);
@@ -222,7 +222,7 @@ enum parsefunc_rcode lclif_parse_CA_REQ_HASH(int fd, struct login_session_data *
{
memset(sd->md5key, '\0', sizeof(sd->md5key));
sd->md5keylen = (uint16)(12 + rnd() % 4);
- MD5_Salt(sd->md5keylen, sd->md5key);
+ md5->salt(sd->md5keylen, sd->md5key);
lclif->coding_key(fd, sd);
return PACKET_VALID;
diff --git a/src/login/login.c b/src/login/login.c
index a8ba3d9b7..7f5f78a4d 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -239,7 +239,7 @@ bool login_check_encrypted(const char* str1, const char* str2, const char* passw
nullpo_ret(str2);
nullpo_ret(passwd);
safesnprintf(tmpstr, sizeof(tmpstr), "%s%s", str1, str2);
- MD5_String(tmpstr, md5str);
+ md5->string(tmpstr, md5str);
return (0==strcmp(passwd, md5str));
}
@@ -1378,7 +1378,7 @@ void login_parse_request_connection(int fd, struct login_session_data* sd, const
safestrncpy(sd->userid, RFIFOP(fd,2), NAME_LENGTH);
safestrncpy(sd->passwd, RFIFOP(fd,26), NAME_LENGTH);
if (login->config->use_md5_passwds)
- MD5_String(sd->passwd, sd->passwd);
+ md5->string(sd->passwd, sd->passwd);
sd->passwdenc = PWENC_NONE;
sd->version = login->config->client_version_to_connect; // hack to skip version check
server_ip = ntohl(RFIFOL(fd,54));
@@ -1529,14 +1529,14 @@ int login_config_read(const char *cfgName)
login->config->client_hash_check = config_switch(w2);
else if(!strcmpi(w1, "client_hash")) {
int group = 0;
- char md5[33];
- memset(md5, '\0', 33);
+ char md5hash[33];
+ memset(md5hash, '\0', 33);
- if (sscanf(w2, "%d, %32s", &group, md5) == 2) {
+ if (sscanf(w2, "%d, %32s", &group, md5hash) == 2) {
struct client_hash_node *nnode;
CREATE(nnode, struct client_hash_node, 1);
- if (strcmpi(md5, "disabled") == 0) {
+ if (strcmpi(md5hash, "disabled") == 0) {
nnode->hash[0] = '\0';
} else {
int i;
@@ -1544,7 +1544,7 @@ int login_config_read(const char *cfgName)
char buf[3];
unsigned int byte;
- memcpy(buf, &md5[i], 2);
+ memcpy(buf, &md5hash[i], 2);
buf[2] = 0;
sscanf(buf, "%x", &byte);