diff options
-rw-r--r-- | contrib/opie/libopie/challenge.c | 4 | ||||
-rw-r--r-- | contrib/opie/opie.h | 8 | ||||
-rw-r--r-- | contrib/opie/opiekey.c | 2 | ||||
-rw-r--r-- | usr.bin/opiekey/Makefile | 4 |
4 files changed, 10 insertions, 8 deletions
diff --git a/contrib/opie/libopie/challenge.c b/contrib/opie/libopie/challenge.c index fc836aa..6c42018 100644 --- a/contrib/opie/libopie/challenge.c +++ b/contrib/opie/libopie/challenge.c @@ -68,7 +68,9 @@ int opiechallenge FUNCTION((mp, name, ss), struct opie *mp AND char *name AND ch } if (rval || - (snprintf(ss, OPIE_CHALLENGE_MAX, "otp-%s %d %s ext", algids[MDX], mp->opie_n - 1, mp->opie_seed) >= OPIE_CHALLENGE_MAX)) { + (snprintf(ss, OPIE_CHALLENGE_MAX+1, "otp-%s %d %s ext", algids[MDX], mp->opie_n - 1, mp->opie_seed) >= OPIE_CHALLENGE_MAX+1)) { + if (!rval) + rval = 1; opierandomchallenge(ss); memset(mp, 0, sizeof(*mp)); } diff --git a/contrib/opie/opie.h b/contrib/opie/opie.h index be508c7..69ba005 100644 --- a/contrib/opie/opie.h +++ b/contrib/opie/opie.h @@ -69,11 +69,11 @@ struct opie { /* Maximum length of a seed */ #define OPIE_SEED_MAX 16 -/* Max length of hash algorithm name (md4/md5) */ -#define OPIE_HASHNAME_MAX 3 +/* Max length of hash algorithm name (md4/md5/sha1) */ +#define OPIE_HASHNAME_MAX 4 -/* Maximum length of a challenge (otp-md? 9999 seed) */ -#define OPIE_CHALLENGE_MAX (4+OPIE_HASHNAME_MAX+1+4+1+OPIE_SEED_MAX) +/* Maximum length of a challenge (otp-md? 9999 seed ext) */ +#define OPIE_CHALLENGE_MAX (4+OPIE_HASHNAME_MAX+1+4+1+OPIE_SEED_MAX+1+3) /* Maximum length of a response that we allow */ #define OPIE_RESPONSE_MAX (9+1+19+1+9+OPIE_SEED_MAX+1+19+1+19+1+19) diff --git a/contrib/opie/opiekey.c b/contrib/opie/opiekey.c index 6988349..17a0f46 100644 --- a/contrib/opie/opiekey.c +++ b/contrib/opie/opiekey.c @@ -144,7 +144,7 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) int type = RESPONSE_STANDARD; int force = 0; - if (slash = strchr(argv[0], '/')) + if (slash = strrchr(argv[0], '/')) slash++; else slash = argv[0]; diff --git a/usr.bin/opiekey/Makefile b/usr.bin/opiekey/Makefile index e017f4d..0ee8570 100644 --- a/usr.bin/opiekey/Makefile +++ b/usr.bin/opiekey/Makefile @@ -15,9 +15,9 @@ LDADD= -lopie -lmd LINKS= ${BINDIR}/opiekey ${BINDIR}/otp-md4 LINKS+= ${BINDIR}/opiekey ${BINDIR}/otp-md5 -LINKS+= ${BINDIR}/opiekey ${BINDIR}/otp-sha +LINKS+= ${BINDIR}/opiekey ${BINDIR}/otp-sha1 -MLINKS= opiekey.1 otp-md4.1 opiekey.1 otp-md5.1 opiekey.1 otp-sha.1 +MLINKS= opiekey.1 otp-md4.1 opiekey.1 otp-md5.1 opiekey.1 otp-sha1.1 .PATH: ${OPIE_DIST} |