nomask int matches_password(string str) { if (password[0..2] == "$6$") return crypt(str, password) == password; else { if (oldcrypt(str, password) == password || crypt(str, password) == password) { write("(Upgrading your password hash to SHA512)\n"); password = crypt(str); return 1; } } return 0; }