From 3b4a19fe2a7ba832839e12ae75de1c5281a8c079 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 2 Oct 1996 03:49:38 +0000 Subject: Fix a bug wrt handling of old md4 entries. Now don't save a type with md4 so we don't go over the record size and munge other entries. Don't export symbols we don't need to in put.c. --- lib/libskey/put.c | 4 ++-- lib/libskey/skeylogin.c | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'lib/libskey') diff --git a/lib/libskey/put.c b/lib/libskey/put.c index fe05e160a05..6b2636225b5 100644 --- a/lib/libskey/put.c +++ b/lib/libskey/put.c @@ -8,7 +8,7 @@ * * Dictionary lookup and extraction. * - * $Id: put.c,v 1.3 1996/09/30 04:10:43 millert Exp $ + * $Id: put.c,v 1.4 1996/10/02 03:49:37 millert Exp $ */ #include @@ -23,7 +23,7 @@ static void insert __P ((char *s, int x, int start, int length)); static int wsrch __P ((char *w, int low, int high)); /* Dictionary for integer-word translations */ -char Wp[2048][4] = { +static char Wp[2048][4] = { "A", "ABE", "ACE", diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c index 38cd82c5df9..8762a31302a 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.7 1996/09/30 04:10:46 millert Exp $ + * $Id: skeylogin.c,v 1.8 1996/10/02 03:49:36 millert Exp $ */ #include @@ -17,7 +17,6 @@ #endif #include #include -#include #include #include @@ -231,7 +230,8 @@ skeyverify(mp, response) rip(mp->buf); mp->logname = strtok(mp->buf, " \t"); cp = strtok(NULL, " \t") ; - cp = strtok(NULL, " \t") ; + if (isalpha(*cp)) + cp = strtok(NULL, " \t") ; mp->seed = strtok(NULL, " \t"); mp->val = strtok(NULL, " \t"); /* And convert file value to hex for comparison */ @@ -253,8 +253,14 @@ skeyverify(mp, response) btoa8(mp->val,key); mp->n--; (void)fseek(mp->keyfile, mp->recstart, SEEK_SET); - (void)fprintf(mp->keyfile, "%s %s %04d %-16s %s %-21s\n", - mp->logname, skey_get_algorithm(), mp->n, mp->seed, mp->val, tbuf); + /* Don't save algorithm type for md4 (keep record length same) */ + if (strcmp(skey_get_algorithm(), "md4") == 0) + (void)fprintf(mp->keyfile, "%s %04d %-16s %s %-21s\n", + mp->logname, mp->n, mp->seed, mp->val, tbuf); + else + (void)fprintf(mp->keyfile, "%s %s %04d %-16s %s %-21s\n", + mp->logname, skey_get_algorithm(), mp->n, + mp->seed, mp->val, tbuf); (void)fclose(mp->keyfile); -- cgit v1.2.3