2 * This file contains routines modified from OpenBSD. Parts are contributed
3 * by Todd Miller <millert@openbsd.org>, Theo De Raadt <deraadt@openbsd.org>
10 #include <sys/types.h>
17 * Returns: 1 user doesnt exist, -1 file error, 0 user exists.
26 return opielookup(&opie, username);
32 * Returns the current sequence number and
33 * seed for the passed user.
37 opie_keyinfo(username)
41 static char str[OPIE_CHALLENGE_MAX];
44 i = opiechallenge(&opie, username, str);
54 * Check to see if answer is the correct one to the current
57 * Returns: 0 success, -1 failure
61 opie_passverify(username, passwd)
68 i = opielookup(&opie, username);
69 if (i == -1 || i == 1)
72 if (opieverify(&opie, passwd) == 0)
78 #define OPIE_HASH_DEFAULT 1
80 /* Current hash type (index into opie_hash_types array) */
81 static int opie_hash_type = OPIE_HASH_DEFAULT;
83 struct opie_algorithm_table {
87 static struct opie_algorithm_table opie_algorithm_table[] = {
91 /* Get current hash type */
95 return(opie_algorithm_table[opie_hash_type].name);