p Most S/Key operations take a pointer to a .Em struct skey , which should be considered as an opaque identifier. .Sh FUNCTIONS The following high-level functions are available: l -tag -width compact t Fn skeychallenge "mp" "name" "ss" "sslen" Return a S/Key challenge for user .Fa name . If successful, the caller's skey structure .Fa mp is filled and 0 is returned. If unsuccessful (e.g. if name is unknown), -1 is returned. t Fn skeylookup "mp" "name" Find an entry for user .Fa name in the one-time password database. Returns 0 if the entry is found and 1 if the entry is not found. If an error occurs accessing the database, -1 is returned. t Fn skeygetnext "mp" Get the next entry in the one-time password database. Returns 0 on success and the entry is stored in .Ar mp and 1 if no more entries are available. If an error occurs accessing the database, -1 is returned. t Fn skeyverify "mp" "response" Verify response .Fa response to a S/Key challenge. Returns 0 if the verification is successful and 1 if the verification failed. If an error occurs accessing the database, -1 is returned. t Fn skeyzero "mp" "response" Comment out user's entry in the S/Key database. Returns 0 on success and the database is updated, otherwise -1 is returned and the database remains unchanged. t Fn getskeyprompt "mp" "name" "prompt" Issue a S/Key challenge for user .Ar name . If successful, fill in the caller's skey structure .Fa mp and return 0. If unsuccessful (e.g. if name is unknown) -1 is returned. .El
p The following lower-level functions are available: l -tag -width compact t Fn skey_set_algorithm "new" Set hash algorithm type. Valid values for .Fa new are "md4", "md5" and "sha1". t Fn skey_get_algorithm "void" Get current hash type. t Fn skey_haskey "username" Returns 0 if the user .Fa username exists and 1 if the user doesn't exist. Returns -1 on file error. t Fn skey_keyinfo "username" Returns the current sequence number and seed for user .Ar username . t Fn skey_passcheck "username" "passwd" Checks to see if answer is the correct one to the current challenge. t Fn skey_authenticate "username" Used when calling program will allow input of the user's response to the challenge. Returns zero on success or -1 on failure. .El
p The following miscellaneous functions are available: l -tag -width compact t Fn f "x" One-way function to take 8 bytes pointed to by .Fa x and return 8 bytes in place. t Fn keycrunch "char *result" "const char *seed" "const char *passwd" Crunch a key. t Fn rip "buf" Strip trailing CR/LF characters from a line of text .Fa buf . t Fn readpass "buf" "n" Read in secret passwd (turns off echo). t Fn readskey "buf" "n" Read in an s/key OTP (does not turn off echo). t Fn atob8 "out" "in" Convert 8-byte hex-ascii string .Fa in to binary array .Fa out . Returns 0 on success, -1 on error. t Fn btoa8 "out" "in" Convert 8-byte binary array .Fa in to hex-ascii string .Fa out . Returns 0 on success, -1 on error. t Fn htoi "int c" Convert hex digit to binary integer. t Fn skipspace "cp" Skip leading spaces from the string .Fa cp . t Fn backspace "buf" Remove backspaced over characters from the string .Fa buf . t Fn sevenbit "buf" Ensure line .Fa buf is all seven bits. t Fn btoe "engout" "c" Encode 8 bytes in .Ar c as a string of English words. Returns a pointer to a static buffer in .Fa engout . t Fn etob "out" "e" Convert English to binary. Returns 0 if the word is not in the database, 1 if all good words and parity is valid, -1 if badly formed input (i.e. > 4 char word) and -2 if words are valid but parity is wrong. t Fn put8 "out" "s" Display 8 bytes .Fa s as a series of 16-bit hex digits. .El .Sh FILES l -tag -width /usr/lib/libskey_p.a -compact t Pa /usr/lib/libskey.a static skey library t Pa /usr/lib/libskey.so dynamic skey library t Pa /usr/lib/libskey_p.a static skey library compiled for profiling .El .Sh SEE ALSO .Xr skey 1 , .Xr skeyaudit 1 , .Xr skeyinfo 1 .Sh BUGS The .Nm library functions are not re-entrant or thread-safe.
p The .Nm library defines many poorly named functions which pollute the name space.