Branch: Tag:

2013-03-11

2013-03-11 17:07:42 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Passwords: Use Crypto.Password.hash() in external scripts.

Also fixes some broken use of Nettle.crypt_md5().

76:    return res;   }    + #if constant(Crypto.Password) + constant hash_password = Crypto.Password.hash; + #else + constant hash_password = Crypto.make_crypt_md5; + #endif +    int main(int argc, array argv)   {    Readline rl = Readline();
335:   <map>    <str>permissions</str> : <a> <str>Everything</str> </a>    <str>real_name</str> : <str>Administrator</str> -  <str>password</str> : <str>$1$" + Nettle.crypt_md5(password) + #"</str> +  <str>password</str> : <str>" + hash_password(password) + #"</str>    <str>name</str> : <str>" + user + "</str>\n</map>" ));       write("\n Administrator user \"" + user + "\" created.\n");   }