diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-02 03:49:38 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-10-02 03:49:38 +0000 |
commit | 3b4a19fe2a7ba832839e12ae75de1c5281a8c079 (patch) | |
tree | d7dc616096c8a8221ba66a8897c1a06febfb8990 /lib | |
parent | 36ae36319d92202d4c1d7634d20ab3dcc402e907 (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libskey/put.c | 4 | ||||
-rw-r--r-- | lib/libskey/skeylogin.c | 16 |
2 files changed, 13 insertions, 7 deletions
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 <stdio.h> @@ -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 <sys/param.h> @@ -17,7 +17,6 @@ #endif #include <sys/stat.h> #include <sys/time.h> -#include <sys/timeb.h> #include <sys/resource.h> #include <stdio.h> @@ -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); |