1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 09:16:38 +02:00

Added options:passlen

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2831 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2010-03-21 19:57:22 +00:00
parent 287169d6e8
commit 9302af51a3
10 changed files with 18 additions and 18 deletions
+1
View File
@@ -611,6 +611,7 @@ int ServerConfig::Read(bool bail)
{"networkinfo", "userlen", "10", new ValueContainerUInt(&Config.UserLen), DT_UINTEGER | DT_NORELOAD, NoValidation},
{"networkinfo", "hostlen", "64", new ValueContainerUInt(&Config.HostLen), DT_UINTEGER | DT_NORELOAD, NoValidation},
{"options", "encryption", "", new ValueContainerString(&EncModules), DT_STRING | DT_NORELOAD, ValidateNotEmpty},
{"options", "passlen", "32", new ValueContainerUInt(&Config.PassLen), DT_UINTEGER | DT_NORELOAD, NoValidation},
{"options", "database", "", new ValueContainerString(&DBModules), DT_STRING | DT_NORELOAD, ValidateNotEmpty},
{"options", "userkey1", "0", new ValueContainerLUInt(&Config.UserKey1), DT_LUINTEGER, NoValidation},
{"options", "userkey2", "0", new ValueContainerLUInt(&Config.UserKey2), DT_LUINTEGER, NoValidation},
+2 -1
View File
@@ -346,7 +346,7 @@ class EMD5 : public Module
EventReturn OnEncrypt(const std::string &src, std::string &dest)
{
MD5_CTX context;
char digest[PASSMAX];
char *digest = new char[Config.PassLen];
std::string buf = "md5:";
char cpass[1000];
@@ -358,6 +358,7 @@ class EMD5 : public Module
buf.append(cpass);
Alog(LOG_DEBUG_2) << "(enc_md5) hashed password from [" << src << "] to [" << buf << "]";
dest.assign(buf);
delete [] digest;
return EVENT_ALLOW;
}
+2 -1
View File
@@ -199,7 +199,7 @@ class ESHA1 : public Module
EventReturn OnEncrypt(const std::string &src, std::string &dest)
{
SHA1_CTX context;
char digest[PASSMAX];
char *digest = new char[Config.PassLen];
std::string buf = "sha1:";
char cpass[1000];
@@ -213,6 +213,7 @@ class ESHA1 : public Module
buf.append(cpass);
Alog(LOG_DEBUG_2) << "(enc_sha1) hashed password from [" << src << "] to [" << buf << "]";
dest.assign(buf);
delete [] digest;
return EVENT_ALLOW;
}
+1 -1
View File
@@ -263,7 +263,7 @@ class CommandNSRegister : public CommandNSConfirm
}
else if (!stricmp(u->nick.c_str(), pass) || (Config.StrictPasswords && strlen(pass) < 5))
notice_lang(Config.s_NickServ, u, MORE_OBSCURE_PASSWORD);
else if (strlen(pass) > PASSMAX)
else if (strlen(pass) > Config.PassLen)
notice_lang(Config.s_NickServ, u, PASSWORD_TOO_LONG);
else if (email && !MailValidate(email))
notice_lang(Config.s_NickServ, u, MAIL_X_INVALID, email);
+1 -1
View File
@@ -75,7 +75,7 @@ private:
notice_lang(Config.s_NickServ, u, MORE_OBSCURE_PASSWORD);
return MOD_CONT;
}
else if (len > PASSMAX)
else if (len > Config.PassLen)
{
notice_lang(Config.s_NickServ, u, PASSWORD_TOO_LONG);
return MOD_CONT;
+1 -1
View File
@@ -71,7 +71,7 @@ class CommandNSSet : public Command
notice_lang(Config.s_NickServ, u, MORE_OBSCURE_PASSWORD);
return MOD_CONT;
}
else if (len > PASSMAX)
else if (len > Config.PassLen)
{
notice_lang(Config.s_NickServ, u, PASSWORD_TOO_LONG);
return MOD_CONT;