diff options
author | rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-10-17 20:42:40 +0000 |
---|---|---|
committer | rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-10-17 20:42:40 +0000 |
commit | 9bf8366451b60148699657ed966c0913fbae9465 (patch) | |
tree | 3a48a1aaa582ec259657ff1029dd691b3a99fb92 /src/core/ns_set.c | |
parent | 3dbe219758f5c9712a5c1935d85be1434cf0eee8 (diff) |
BUILD : 1.7.17 (1185) BUGS : N/A NOTES : Encryption now offers the choice of none, old and md5 - the md5 module is nicely taken from irc-services and actaully works, yes, real md5, in anope, wow eh?
git-svn-id: svn://svn.anope.org/anope/trunk@1185 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@905 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/ns_set.c')
-rw-r--r-- | src/core/ns_set.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/core/ns_set.c b/src/core/ns_set.c index 41a8424ca..ad493b104 100644 --- a/src/core/ns_set.c +++ b/src/core/ns_set.c @@ -14,9 +14,7 @@ /*************************************************************************/ #include "module.h" -#ifdef USE_ENCRYPTION #include "encrypt.h" -#endif int do_set(User * u); int do_set_display(User * u, NickCore * nc, char *param); @@ -205,6 +203,7 @@ int do_set_display(User * u, NickCore * nc, char *param) int do_set_password(User * u, NickCore * nc, char *param) { int len = strlen(param); + char tmp_pass[PASSMAX]; if (stricmp(nc->display, param) == 0 || (StrictPasswords && len < 5)) { notice_lang(s_NickServ, u, MORE_OBSCURE_PASSWORD); @@ -214,10 +213,9 @@ int do_set_password(User * u, NickCore * nc, char *param) if (nc->pass) free(nc->pass); -#ifdef USE_ENCRYPTION nc->pass = smalloc(PASSMAX); - if (encrypt(param, len, nc->pass, PASSMAX) < 0) { + if (enc_encrypt(param, len, nc->pass, PASSMAX) < 0) { memset(param, 0, len); alog("%s: Failed to encrypt password for %s (set)", s_NickServ, nc->display); @@ -226,11 +224,12 @@ int do_set_password(User * u, NickCore * nc, char *param) } memset(param, 0, len); - notice_lang(s_NickServ, u, NICK_SET_PASSWORD_CHANGED); -#else - nc->pass = sstrdup(param); - notice_lang(s_NickServ, u, NICK_SET_PASSWORD_CHANGED_TO, nc->pass); -#endif + + if(enc_decrypt(nc->pass,tmp_pass,PASSMAX)==1) { + notice_lang(s_NickServ, u, NICK_SET_PASSWORD_CHANGED_TO, nc->pass); + } else { + notice_lang(s_NickServ, u, NICK_SET_PASSWORD_CHANGED); + } alog("%s: %s!%s@%s (e-mail: %s) changed its password.", s_NickServ, u->nick, u->username, u->host, (nc->email ? nc->email : "none")); |