password verifier #81

Parent #5Owner #361Flags readSource hellcore/hellcore.db

Aliases: password verifier, password, verifier, pwd

13 verbs · 39 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
help_msgthis none thisrxd#8112
reject_passwordthis none thisrxd#8114
trivial_checkthis none thisrxd#8113
check_lengththis none thisrxd#813
check_namethis none thisrxd#816
check_emailthis none thisrxd#8112
check_hoststhis none thisrxd#8110
check_dictionarythis none thisrxd#8121
check_for_funky_charactersthis none thisrxd#8110
check_against_moothis none thisrxd#8113
_is_funky_casethis none thisrxd#8110
check_obscure_combinationsthis none thisrxd#816
init_for_corethis none thisrxd#814

Properties

PropertyDefinerFlagsOwnerValue
minimum_password_length#81r#3610
check_against_name#81r#3610
check_against_email#81r#3610
check_against_hosts#81r#3610
check_against_dictionary#81r#3610
require_funky_characters#81r#3610
help_msg#81r#29
list of 8{"Password Verifier", "==================", "", "To check for the validity of a password, use", " :reject_password( password [, for-whom? ] )", "... If it returns a true value, that value will contain the string representing the reason why the password was rejected. If it returns a false value, the password is OK.", "", "The toggle switches for this checking are:"}
check_against_moo#81r#3610
check_obscure_stuff#81r#3610
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#361<clear>
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#361<clear>
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"password verifier", "password", "verifier", "pwd"}
description#1rc#361"The password verifier verifies passwords."
object_size#1r#29{11350, 1298433815}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: none

Call graph

calls n81_0 #81:help_msg n20_27 #20:english_number n81_0->n20_27 n81_1 #81:reject_password n42_0 #42:controls n81_1->n42_0 n81_2 #81:trivial_check n81_1->n81_2 n81_3 #81:check_length n81_1->n81_3 n81_4 #81:check_name n81_1->n81_4 n81_5 #81:check_email n81_1->n81_5 n81_6 #81:check_hosts n81_1->n81_6 n81_7 #81:check_dictionary n81_1->n81_7 n81_8 #81:check_for_funky_characters n81_1->n81_8 n81_9 #81:check_against_moo n81_1->n81_9 n81_11 #81:check_obscure_combinations n81_1->n81_11 n81_2->n42_0 n45_5 #45:isa n81_2->n45_5 n81_3->n20_27 n30_1 #30:find_exact n81_4->n30_1 n30_0 #30:find n81_4->n30_0 n20_49 #20:reverse n81_4->n20_49 n81_5->n42_0 n17_39 #17:get_email_address n81_5->n17_39 n81_6->n42_0 n69_5 #69:get n81_7->n69_5 n81_10 #81:_is_funky_case n81_7->n81_10 n81_8->n81_10 n81_9->n81_10 n20_14 #20:uppercase n81_10->n20_14 n81_12 #81:init_for_core n1_22 #1:init_for_core n81_12->n1_22

Source

help_msg

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

none

Source

1if (typeof(base = this.(verb)) == STR)
2base = {base};
3endif
4base = {@base, "", tostr(".minimum_password_length = ", toliteral(x = this.minimum_password_length)), x ? tostr("Passwords are required to be a minimum of ", $string_utils:english_number(x), " characters in length.") | "There is no minimum length requirement for passwords."};
5base = {@base, "", tostr(".check_against_moo = ", toliteral(x = this.check_against_moo)), tostr("Passwords ", x ? "may not" | "may", " be variants on the MOO's name (", $network.MOO_name, ").")};
6base = {@base, "", tostr(".check_against_name = ", toliteral(x = this.check_against_name)), tostr("Passwords ", x ? "may not" | "may", " be variants on the player's MOO name and/or aliases.")};
7base = {@base, "", tostr(".check_against_email = ", toliteral(x = this.check_against_email)), x ? "Passwords may not be variants on the player's email address." | "Passwords are not checked against the player's email address."};
8base = {@base, "", tostr(".check_against_hosts = ", toliteral(x = this.check_against_hosts)), x ? "Passwords may not be variants on the player's hostname(s)." | "Passwords are not checked against the player's hostname(s)."};
9base = {@base, "", tostr(".check_against_dictionary = ", toliteral(x = this.check_against_dictionary)), tostr("Passwords ", (typeof(x) in {LIST, OBJ}) ? "may not" | "may", " be dictionary words.", (x && (!$network.active)) ? "  (This option is set but unavailable.)" | "")};
10base = {@base, "", tostr(".require_funky_characters = ", toliteral(x = this.require_funky_characters)), tostr("Non-alphabetic characters are ", x ? "" | "not ", "required in passwords.")};
11base = {@base, "", tostr(".check_obscure_stuff = ", toliteral(x = this.check_obscure_stuff)), x ? "Misc. obscure checks enabled" | "No obscure checks in use."};
12return base;

reject_password

Spec this none thisFlags rxdOwner #361Definer #81

Referenced by

Source

1":reject_password ( STR password [ , OBJ for-whom ] );";
2"=> string value [if the password is rejected, why?]";
3"=> false value [if the password isn't rejected]";
4if (length(args) == 1)
5trust = 0;
6else
7if ($perm_utils:controls(caller_perms(), args[2]))
8trust = 1;
9else
10return "Permissions don't permit setting of that password.";
11endif
12endif
13"this is gonna be huge";
14return (((((((this:trivial_check(@args) || (this.minimum_password_length && this:check_length(@args))) || ((this.check_against_name && trust) && this:check_name(@args))) || ((this.check_against_email && trust) && this:check_email(@args))) || ((this.check_against_hosts && trust) && this:check_hosts(@args))) || ((typeof(this.check_against_dictionary) in {LIST, OBJ}) && this:check_dictionary(@args))) || (this.require_funky_characters && this:check_for_funky_characters(@args))) || (this.check_against_moo && this:check_against_moo(@args))) || (this.check_obscure_stuff && this:check_obscure_combinations(@args));

trivial_check

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1if (typeof(pwd = args[1]) != STR)
2return "Passwords must be strings.";
3elseif (index(pwd, " "))
4return "Passwords may not contain spaces.";
5elseif (length(args) == 2)
6if (((typeof(who = args[2]) != OBJ) || (!valid(who))) || (!is_player(who)))
7return "That's not a player.";
8elseif (!$perm_utils:controls(caller_perms(), who))
9return "You can't set the password for that player.";
10elseif ($object_utils:isa(who, $guest))
11return "Sorry, but guest characters are not allowed to change their passwords.";
12endif
13endif

check_length

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1if ((l = this.minimum_password_length) && (length(args[1]) < l))
2return tostr("Passwords must be a minimum of ", $string_utils:english_number(l), (l == 1) ? " character " | " characters ", "long.");
3endif

check_name

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1pwd = args[1];
2if (valid($player_db:find_exact(pwd)))
3return "Passwords may not be close to a player's name/alias pair.";
4elseif (valid($player_db:find($string_utils:reverse(pwd))))
5return "Passwords ought not be the reverse of a player's name/alias.";
6endif

check_email

Spec this none thisFlags rxdOwner #361Definer #81

Referenced by

Source

1{pwd, who} = args;
2if (!$perm_utils:controls(caller_perms(), who))
3return "Permission denied.";
4endif
5email = $wiz_utils:get_email_address(who);
6if (!email)
7"can't check";
8return;
9endif
10if (index(email, pwd))
11return "Passwords can't match your registered email address.";
12endif

check_hosts

Spec this none thisFlags rxdOwner #361Definer #81

Referenced by

Source

1{pwd, who} = args;
2if (!$perm_utils:controls(caller_perms(), who))
3return "Permission denied.";
4endif
5hosts = who.all_connect_places;
6for x in (hosts)
7if (index(x, pwd))
8return "Passwords may not match hostnames.";
9endif
10endfor

check_dictionary

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1pwd = args[1];
2if ((typeof(dict = this.check_against_dictionary) == LIST) && $network.active)
3"assume we're checking an on-line dictionary";
4dict[3] = dict[3] + pwd;
5result = $gopher:get(@dict);
6if (typeof(result) == ERR)
7"we probably can't check the dictionary anyway";
8return;
9elseif ((result[1] && (result[1][1] != "0")) && (!this:_is_funky_case(pwd)))
10return "Dictionary words are not permitted for passwords.";
11endif
12elseif (typeof(dict) == OBJ)
13"assume we're checking mr spell";
14try
15if (dict:find_exact(pwd) && (!this:_is_funky_case(pwd)))
16return "Dictionary words are not permitted for passwords.";
17endif
18except (ANY)
19"in case this is messed up. Just let it go and return 0;";
20endtry
21endif

check_for_funky_characters

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1if (this:_is_funky_case(pwd = args[1]))
2return;
3endif
4alphabet = $string_utils.alphabet;
5for i in [1..length(pwd)]
6if (!index(alphabet, pwd[i]))
7return;
8endif
9endfor
10return "At least one unusual capitalization and/or numeric or punctuation character is required.";

check_against_moo

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1pwd = args[1];
2moo = $network.MOO_Name;
3if (this:_is_funky_case(pwd))
4return;
5endif
6if (pwd == moo)
7return "The MOO's name is not secure as a password.";
8endif
9if (moo[$ - 2..$] == "MOO")
10if (pwd == moo[1..$ - 3])
11return "The MOO's name is not secure as a password.";
12endif
13endif

_is_funky_case

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1pwd = args[1];
2if (!strcmp(pwd, u = $string_utils:uppercase(pwd)))
3return 0;
4elseif (!strcmp(pwd, l = $string_utils:lowercase(pwd)))
5return 0;
6elseif (!strcmp(pwd, tostr(u[1], l[2..$])))
7return 0;
8else
9return 1;
10endif

check_obscure_combinations

Spec this none thisFlags rxdOwner #29Definer #81

Referenced by

Source

1pwd = args[1];
2if (match(pwd, "^[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]$"))
3return "Social security numbers are potentially insecure passwords.";
4elseif (match(pwd, "^[0-9]+/[0-9]+/[0-9]+$"))
5return "Passwords which look like dates are potentially insecure passwords.";
6endif

init_for_core

Spec this none thisFlags rxdOwner #361Definer #81

Referenced by

none

Source

1if (caller_perms().wizard)
2pass(@args);
3this.minimum_password_length = this.check_against_name = this.check_against_email = this.check_against_hosts = this.check_against_dictionary = this.require_funky_characters = this.check_against_moo = this.check_obscure_stuff = 0;
4endif