Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src Pull up S/Key overhaul (RFC2289 compliance, new hash ty...



details:   https://anonhg.NetBSD.org/src/rev/0997009df2ff
branches:  netbsd-1-5
changeset: 488553:0997009df2ff
user:      mjl <mjl%NetBSD.org@localhost>
date:      Mon Jul 17 19:55:50 2000 +0000

description:
Pull up S/Key overhaul (RFC2289 compliance, new hash types,
ctype clean up) from current. Approved by thorpej.

diffstat:

 distrib/sets/lists/base/shl.elf |    4 +-
 distrib/sets/lists/base/shl.mi  |    4 +-
 include/paths.h                 |    3 +-
 lib/libskey/put.c               |   53 +--
 lib/libskey/shlib_version       |    4 +-
 lib/libskey/skey.h              |  103 ++++---
 lib/libskey/skeylogin.c         |  535 ++++++++++++++++++++++++++++-----------
 lib/libskey/skeysubr.c          |  489 ++++++++++++++++++++++++++---------
 usr.bin/skey/skey.1             |   18 +-
 usr.bin/skey/skey.c             |   83 ++++--
 usr.bin/skey/skeyaudit.sh       |   52 ++-
 usr.bin/skeyinit/skeyinit.1     |   37 ++-
 usr.bin/skeyinit/skeyinit.c     |  282 ++++++++++++++------
 13 files changed, 1137 insertions(+), 530 deletions(-)

diffs (truncated from 2448 to 300 lines):

diff -r 164980f9d3bf -r 0997009df2ff distrib/sets/lists/base/shl.elf
--- a/distrib/sets/lists/base/shl.elf   Mon Jul 17 08:56:38 2000 +0000
+++ b/distrib/sets/lists/base/shl.elf   Mon Jul 17 19:55:50 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.elf,v 1.21.4.2 2000/07/17 05:59:56 mrg Exp $
+# $NetBSD: shl.elf,v 1.21.4.3 2000/07/17 19:55:50 mjl Exp $
 ./usr/lib/libamu.so.1
 ./usr/lib/libasn1.so.2
 ./usr/lib/libbz2.so.0
@@ -31,7 +31,7 @@
 ./usr/lib/libposix.so.0
 ./usr/lib/libresolv.so.1
 ./usr/lib/libroken.so.8
-./usr/lib/libskey.so.0
+./usr/lib/libskey.so.1
 ./usr/lib/libsl.so.1
 ./usr/lib/libss.so.3
 ./usr/lib/libssl.so.1
diff -r 164980f9d3bf -r 0997009df2ff distrib/sets/lists/base/shl.mi
--- a/distrib/sets/lists/base/shl.mi    Mon Jul 17 08:56:38 2000 +0000
+++ b/distrib/sets/lists/base/shl.mi    Mon Jul 17 19:55:50 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.78.2.3 2000/07/17 05:59:56 mrg Exp $
+# $NetBSD: shl.mi,v 1.78.2.4 2000/07/17 19:55:50 mjl Exp $
 ./usr/lib/libamu.so.1.1
 ./usr/lib/libasn1.so.2.0
 ./usr/lib/libbz2.so.0.0
@@ -31,7 +31,7 @@
 ./usr/lib/libposix.so.0.1
 ./usr/lib/libresolv.so.1.0
 ./usr/lib/libroken.so.8.1
-./usr/lib/libskey.so.0.0
+./usr/lib/libskey.so.1.0
 ./usr/lib/libsl.so.1.0
 ./usr/lib/libss.so.3.0
 ./usr/lib/libssl.so.1.0
diff -r 164980f9d3bf -r 0997009df2ff include/paths.h
--- a/include/paths.h   Mon Jul 17 08:56:38 2000 +0000
+++ b/include/paths.h   Mon Jul 17 19:55:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: paths.h,v 1.14 2000/05/27 06:08:28 matt Exp $  */
+/*     $NetBSD: paths.h,v 1.14.4.1 2000/07/17 19:55:51 mjl Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -73,6 +73,7 @@
 #define        _PATH_OAUDIOCTL "/dev/audioctl"
 #define        _PATH_SENDMAIL  "/usr/sbin/sendmail"
 #define        _PATH_SHELLS    "/etc/shells"
+#define        _PATH_SKEYKEYS  "/etc/skeykeys"
 #define        _PATH_SOUND     "/dev/sound0"
 #define        _PATH_TTY       "/dev/tty"
 #define        _PATH_UNIX      "/netbsd"
diff -r 164980f9d3bf -r 0997009df2ff lib/libskey/put.c
--- a/lib/libskey/put.c Mon Jul 17 08:56:38 2000 +0000
+++ b/lib/libskey/put.c Mon Jul 17 19:55:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: put.c,v 1.7 1999/07/02 15:45:23 simonb Exp $   */
+/*     $NetBSD: put.c,v 1.7.8.1 2000/07/17 19:55:52 mjl Exp $  */
 
 /* S/KEY v1.1b (put.c)
  *
@@ -15,12 +15,13 @@
 #include <string.h>
 #include <assert.h>
 #include <ctype.h>
+#include <sys/types.h>
 #include "skey.h"
 
-static unsigned int extract __ARGS ((char *s, int start, int length));
-static void standard __ARGS ((char *word));
-static void insert __ARGS ((char *s, int x, int start, int length));
-static int wsrch __ARGS ((char *w, int low, int high));
+static unsigned int extract __P ((char *s, int start, int length));
+static void standard __P ((char *word));
+static void insert __P ((char *s, int x, int start, int length));
+static int wsrch __P ((const char *w, int low, int high));
 
 /* Dictionary for integer-word translations */
 char Wp[2048][4] = {
@@ -2077,10 +2078,7 @@
 /* Encode 8 bytes in 'c' as a string of English words.
  * Returns a pointer to a static buffer
  */
-char *
- btoe (engout, c)
-  char *engout;
-  const char *c;
+char *btoe(char *engout, const char *c)
 {
   char cp[9];                  /* add in room for the parity 2 bits */
   int p, i;
@@ -2117,10 +2115,7 @@
  *        -1 badly formed in put ie > 4 char word
  *        -2 words OK but parity is wrong
  */
-int
- etob (out, e)
-  char *out;
-  const char *e;
+int etob(char *out, const char *e)
 {
   char *word;
   int i, p, v, l, low, high;
@@ -2172,12 +2167,9 @@
 }
 
 /* Display 8 bytes as a series of 16-bit hex digits */
-char *
- put8 (out, s)
-  char *out;
-  const char *s;
+char *put8(char *out, const char *s)
 {
-  sprintf (out, "%02X%02X %02X%02X %02X%02X %02X%02X", /* XXX: sprintf (put8()) appears to be unused */
+  sprintf (out, "%02X%02X %02X%02X %02X%02X %02X%02X",
           s[0] & 0xff, s[1] & 0xff, s[2] & 0xff,
           s[3] & 0xff, s[4] & 0xff, s[5] & 0xff,
           s[6] & 0xff, s[7] & 0xff);
@@ -2188,9 +2180,7 @@
 /* Encode 8 bytes in 'cp' as stream of ascii letters.
  * Provided as a possible alternative to btoe()
  */
-char *
- btoc (cp)
-  char *cp;
+char *btoc(char *cp)
 {
   int i;
   static char out[31];
@@ -2210,10 +2200,7 @@
 /* Internal subroutines for word encoding/decoding */
 
 /* Dictionary binary search */
-static int
- wsrch (w, low, high)
-  char *w;
-  int low, high;
+static int wsrch(const char *w, int low, int high)
 {
   int i, j;
 
@@ -2238,11 +2225,8 @@
       low = i;                 /* Search upper half */
   }
 }
-static void
- insert (s, x, start, length)
-  char *s;
-  int x;
-  int start, length;
+
+static void insert (char *s, int x, int start, int length)
 {
   unsigned char cl;
   unsigned char cc;
@@ -2277,9 +2261,7 @@
   }
 }
 
-static void
- standard (word)
-  char *word;
+static void standard(char *word)
 {
   while (*word)
   {
@@ -2298,10 +2280,7 @@
 }
 
 /* Extract 'length' bits from the char array 's' starting with bit 'start' */
-static unsigned int
- extract (s, start, length)
-  char *s;
-  int start, length;
+static unsigned int extract(char *s, int start, int length)
 {
   unsigned char cl;
   unsigned char cc;
diff -r 164980f9d3bf -r 0997009df2ff lib/libskey/shlib_version
--- a/lib/libskey/shlib_version Mon Jul 17 08:56:38 2000 +0000
+++ b/lib/libskey/shlib_version Mon Jul 17 19:55:50 2000 +0000
@@ -1,5 +1,5 @@
-#      $NetBSD: shlib_version,v 1.3 1999/02/25 08:02:20 abs Exp $
+#      $NetBSD: shlib_version,v 1.3.10.1 2000/07/17 19:55:52 mjl Exp $
 #      Remember to update distrib/sets/lists/base/shl.* when changing
 #
-major=0
+major=1
 minor=0
diff -r 164980f9d3bf -r 0997009df2ff lib/libskey/skey.h
--- a/lib/libskey/skey.h        Mon Jul 17 08:56:38 2000 +0000
+++ b/lib/libskey/skey.h        Mon Jul 17 19:55:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: skey.h,v 1.6 2000/01/23 02:11:02 mycroft Exp $ */
+/*     $NetBSD: skey.h,v 1.6.4.1 2000/07/17 19:55:52 mjl Exp $ */
 
 /*
  * S/KEY v1.1b (skey.h)
@@ -10,26 +10,11 @@
  *
  * Modifications:
  *          Scott Chasin <chasin%crimelab.com@localhost>
+ *          Todd C. Miller <Todd.Miller%courtesan.com@localhost>
  *
  * Main client header
  */
 
-#if    defined(__TURBOC__) || defined(__STDC__) || defined(LATTICE)
-#define        ANSIPROTO       1
-#endif
-
-#ifndef        __ARGS
-#ifdef ANSIPROTO
-#define        __ARGS(x)       x
-#else
-#define        __ARGS(x)       ()
-#endif
-#endif
-
-#ifdef SOLARIS
-#define setpriority(x,y,z)      z
-#endif
-
 /* Server-side data structure for reading keys file during login */
 struct skey
 {
@@ -40,8 +25,6 @@
   char *seed;
   char *val;
   long recstart;               /* needed so reread of buffer is efficient */
-
-
 };
 
 /* Client-side structure for scanning data stream for challenge */
@@ -52,26 +35,64 @@
   int cnt;
 };
 
-void f __ARGS ((char *x));
-int keycrunch __ARGS ((char *result, const char *seed, const char *passwd));
-char *btoe __ARGS ((char *engout, const char *c));
-char *put8 __ARGS ((char *out, const char *s));
-int etob __ARGS ((char *out, const char *e));
-void rip __ARGS ((char *buf));
-int skeychallenge __ARGS ((struct skey * mp, const char *name, char *ss, int sslen));
-int skeylookup __ARGS ((struct skey * mp, const char *name));
-int skeyverify __ARGS ((struct skey * mp, char *response));
-void sevenbit __ARGS ((char *s));
-void backspace __ARGS ((char *s));
-const char *skipspace __ARGS ((const char *s));
-char *readpass __ARGS ((char *buf, int n));
-char *readskey __ARGS ((char *buf, int n));
-int skey_authenticate __ARGS ((const char *));
-int skey_passcheck __ARGS ((const char *, char *));
-char *skey_keyinfo __ARGS ((const char *));
-int skey_haskey __ARGS ((const char *));
-int getskeyprompt __ARGS ((struct skey *, char *, char *));
-int atob8 __ARGS((char *, const char *));
-int btoa8 __ARGS((char *, const char *));
-int htoi __ARGS((int));
+/* Maximum sequence number we allow */
+#ifndef SKEY_MAX_SEQ
+#define SKEY_MAX_SEQ           10000
+#endif
+
+/* Minimum secret password length (rfc2289) */
+#ifndef SKEY_MIN_PW_LEN
+#define SKEY_MIN_PW_LEN                10
+#endif
+
+/* Max secret password length (rfc2289 says 63 but allows more) */
+#ifndef SKEY_MAX_PW_LEN
+#define SKEY_MAX_PW_LEN                255
+#endif
+
+/* Max length of an S/Key seed (rfc2289) */
+#ifndef SKEY_MAX_SEED_LEN
+#define SKEY_MAX_SEED_LEN       16
+#endif
+
+/* Max length of S/Key challenge (otp-???? 9999 seed) */
+#ifndef SKEY_MAX_CHALLENGE
+#define SKEY_MAX_CHALLENGE      (11 + SKEY_MAX_HASHNAME_LEN + SKEY_MAX_SEED_LEN)
+#endif
+
+/* Max length of hash algorithm name (md4/md5/sha1/rmd160) */
+#define SKEY_MAX_HASHNAME_LEN  6
+
+/* Size of a binary key (not NULL-terminated) */
+#define SKEY_BINKEY_SIZE                8
 
+/* Location of random file for bogus challenges */
+#define _SKEY_RAND_FILE_PATH_  "/var/db/host.random"
+
+/* Prototypes */
+void f __P ((char *));
+int keycrunch __P ((char *, const char *, const char *));
+char *btoe __P ((char *, const char *));



Home | Main Index | Thread Index | Old Index