summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-23 07:16:58 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-23 07:16:58 +0000
commitc77edfabaa6567183f3a149ecea9bd6f69934580 (patch)
tree9faef3cf99bfa0412142f0673a41eb0120cd413b
parentf3acee5781b1c778c3cffc856632d813df08141a (diff)
Fix skeygetnext()
-rw-r--r--lib/libskey/skeylogin.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c
index bc113f56db5..4996f7f3859 100644
--- a/lib/libskey/skeylogin.c
+++ b/lib/libskey/skeylogin.c
@@ -8,7 +8,7 @@
*
* S/KEY verification check, lookups, and authentication.
*
- * $Id: skeylogin.c,v 1.14 1997/07/23 06:53:12 millert Exp $
+ * $Id: skeylogin.c,v 1.15 1997/07/23 07:16:57 millert Exp $
*/
#include <sys/param.h>
@@ -177,7 +177,7 @@ skeylookup(mp, name)
/* Get the next entry in the One-time Password database.
* Return codes:
* -1: error in opening database
- * 0: next entry found, file R/W pointer positioned at beginning of record
+ * 0: next entry found and stored in mp
* 1: no more entries, file R/W pointer positioned at EOF
*/
int
@@ -185,7 +185,7 @@ skeygetnext(mp)
struct skey *mp;
{
long recstart = 0;
- char *cp, *ht = NULL;
+ char *cp;
struct stat statbuf;
/* See if _PATH_SKEYKEYS exists, and create it if not */
@@ -219,11 +219,8 @@ skeygetnext(mp)
continue;
/* Save hash type if specified, else use md4 */
if (isalpha(*cp)) {
- ht = cp;
if ((cp = strtok(NULL, " \t")) == NULL)
continue;
- } else {
- ht = "md4";
}
mp->n = atoi(cp);
if ((mp->seed = strtok(NULL, " \t")) == NULL)
@@ -233,17 +230,7 @@ skeygetnext(mp)
/* Got a real entry */
break;
}
- if (!feof(mp->keyfile)) {
- (void)fseek(mp->keyfile, recstart, SEEK_SET);
- /* Set hash type */
- if (ht && skey_set_algorithm(ht) == NULL) {
- warnx("Unknown hash algorithm %s, using %s", ht,
- skey_get_algorithm());
- }
- return 0;
- } else {
- return 1;
- }
+ return(feof(mp->keyfile));
}
/* Verify response to a s/key challenge.