head 1.1; branch ; access ; symbols ; locks strick:1.1; comment @ * @; 1.1 date 94.11.03.01.16.55; author strick; state Exp; branches ; next ; desc @@ 1.1 log @/dev/null @ text @/* get prompt code for S/KEY Authentication. S/KEY is a trademark * of Bellcore. * * Mink is the former name of the S/KEY authentication system. * Many references for mink may still be found in this program. */ #include #include #include #include #include #include #include "skey.h" #define KEYFILE "/etc/skeykeys" char *skipspace(); int skeylookup __ARGS((struct skey *mp,char *name)); /* Issue a skey challenge for user 'name'. If successful, * fill in the caller's skey structure and return 0. If unsuccessful * (e.g., if name is unknown) return -1. * * The file read/write pointer is left at the start of the * record. */ int getskeyprompt(mp,name,prompt) struct skey *mp; char *name; char *prompt; { int rval; sevenbit(name); rval = skeylookup(mp,name); strcpy(prompt,"s/key 55 latour1\n"); switch(rval){ case -1: /* File error */ return -1; case 0: /* Lookup succeeded, return challenge */ sprintf(prompt,"s/key %d %s\n",mp->n - 1,mp->seed); return 0; case 1: /* User not found */ fclose(mp->keyfile); return -1; } return -1; /* Can't happen */ } @