Merge commit 'tg/master'

This commit is contained in:
psyc://psyced.org/~lynX 2011-07-26 11:38:52 +02:00
commit 0f3828597d
2 changed files with 23 additions and 3 deletions

View File

@ -757,9 +757,14 @@ checkPassword(try, method, salt, args, cb, varargs cbargs) {
// why here?
//while (remove_call_out(#'quit) != -1);
#ifndef REGISTERED_USERS_ONLY
# ifdef AUTH_HMAC_SECRET
if (IS_NEWBIE && method != "hmac-sha1-shared") ARETURN(1)
# else
if (IS_NEWBIE) ARETURN(1) // could auto-register here..
# endif
#endif
if (!try || try == "") ARETURN(0)
if (!try || try == "" || v("password") == "") ARETURN(0)
switch(method) {
#if __EFUN_DEFINED__(sha1)
case "SHA1":
@ -773,8 +778,15 @@ case "HMAC-SHA1":
case "hmac-sha1":
ARETURN(try == hmac(TLS_HASH_SHA1, v("password"), salt))
# ifdef AUTH_HMAC_SECRET
# define REGISTER_DISABLED
case "hmac-sha1-shared":
ARETURN(try == hmac(TLS_HASH_SHA1, AUTH_HMAC_SECRET, salt + MYNICK))
if (try == hmac(TLS_HASH_SHA1, AUTH_HMAC_SECRET, salt + MYNICK)) {
if (IS_NEWBIE) {
vSet("password", "");
save();
}
ARETURN(1);
} else ARETURN(0);
# endif
# endif
#else
@ -809,7 +821,7 @@ default:
P4(("plain text pw %O == %O?\n", try, v("password")))
#ifdef PASSWORDCHECK
PASSWORDCHECK(v("password"), try)
#else
#else
if (try == v("password")) ARETURN(1);
#endif
}

View File

@ -3056,6 +3056,14 @@ set(key, value) {
w("_echo_set_default",
"Setting [_key_set] has been reset to its default state.",
([ "_key_set" : key ]) );
#ifdef REGISTER_DISABLED
} else if (key == "password" && IS_NEWBIE) {
# ifdef REGISTER_URL
w("_echo_set_password", "Registration disabled here. You can register at: " + REGISTER_URL);
# else
w("_echo_set_password", "Registration disabled.");
# endif
#endif
} else {
vSet(key, value);
if (key == "password") w("_echo_set_password",