summaryrefslogtreecommitdiff
path: root/lib/libskey/skey.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-06-20 22:14:21 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-06-20 22:14:21 +0000
commit79838afcce2c6ed02163f947fa685514386519ba (patch)
tree9172fc6aee4983c5fdc5cbd90749a08ca2c04ebb /lib/libskey/skey.h
parent50faafc11b7d796a0599751c412b4d800f09bb6c (diff)
o Add a length parameter to struct skey and rearrange some other structs
o Protect from duplicate inclusion and use __{BEGIN,END}_DECLS o Prototype new skey_unlock() function and remove proto for getskeyprompt() which has been removed.
Diffstat (limited to 'lib/libskey/skey.h')
-rw-r--r--lib/libskey/skey.h90
1 files changed, 44 insertions, 46 deletions
diff --git a/lib/libskey/skey.h b/lib/libskey/skey.h
index bb023c8af8c..ec6f5f1fc7c 100644
--- a/lib/libskey/skey.h
+++ b/lib/libskey/skey.h
@@ -1,62 +1,56 @@
/*
- * S/KEY v1.1b (skey.h)
+ * OpenBSD S/Key (skey.h)
*
* Authors:
* Neil M. Haller <nmh@thumper.bellcore.com>
* Philip R. Karn <karn@chicago.qualcomm.com>
* John S. Walden <jsw@thumper.bellcore.com>
- *
- * Modifications:
* Scott Chasin <chasin@crimelab.com>
* Todd C. Miller <Todd.Miller@courtesan.com>
*
* Main client header
*
- * $OpenBSD: skey.h,v 1.13 1999/07/15 14:33:48 provos Exp $
+ * $OpenBSD: skey.h,v 1.14 2001/06/20 22:14:20 millert Exp $
*/
+#ifndef _SKEY_H_
+#define _SKEY_H_ 1
+
+#include <sys/cdefs.h>
+
/* Server-side data structure for reading keys file during login */
struct skey {
FILE *keyfile;
- char buf[256];
char *logname;
- int n;
char *seed;
char *val;
+ int n;
+ int len;
long recstart; /* needed so reread of buffer is efficient */
+ char buf[256];
};
/* Client-side structure for scanning data stream for challenge */
struct mc {
- char buf[256];
int skip;
int cnt;
+ char buf[256];
};
/* Maximum sequence number we allow */
-#ifndef SKEY_MAX_SEQ
#define SKEY_MAX_SEQ 10000
-#endif
-/* Minimum secret password length (rfc1938) */
-#ifndef SKEY_MIN_PW_LEN
+/* Minimum secret password length (rfc2289) */
#define SKEY_MIN_PW_LEN 10
-#endif
-/* Max secret password length (rfc1938 says 63 but allows more) */
-#ifndef SKEY_MAX_PW_LEN
+/* Max secret password length (rfc2289 says 63 but allows more) */
#define SKEY_MAX_PW_LEN 255
-#endif
-/* Max length of an S/Key seed (rfc1938) */
-#ifndef SKEY_MAX_SEED_LEN
+/* Max length of an S/Key seed (rfc2289) */
#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
@@ -67,30 +61,34 @@ struct mc {
/* Location of random file for bogus challenges */
#define _SKEY_RAND_FILE_PATH_ "/var/db/host.random"
-/* Prototypes */
-void f __P((char *x));
-int keycrunch __P((char *result, char *seed, char *passwd));
-char *btoe __P((char *engout, char *c));
-char *put8 __P((char *out, char *s));
-int etob __P((char *out, char *e));
-void rip __P((char *buf));
-int skeychallenge __P((struct skey * mp, char *name, char *ss));
-int skeylookup __P((struct skey * mp, char *name));
-int skeyverify __P((struct skey * mp, char *response));
-int skeyzero __P((struct skey * mp, char *response));
-void sevenbit __P((char *s));
-void backspace __P((char *s));
-char *skipspace __P((char *s));
-char *readpass __P((char *buf, int n));
-char *readskey __P((char *buf, int n));
-int skey_authenticate __P((char *username));
-int skey_passcheck __P((char *username, char *passwd));
-char *skey_keyinfo __P((char *username));
-int skey_haskey __P((char *username));
-int getskeyprompt __P((struct skey *mp, char *name, char *prompt));
-int atob8 __P((char *out, char *in));
-int btoa8 __P((char *out, char *in));
-int htoi __P((int c));
+__BEGIN_DECLS
+void f __P((char *));
+int keycrunch __P((char *, char *, char *));
+char *btoe __P((char *, char *));
+char *put8 __P((char *, char *));
+int etob __P((char *, char *));
+void rip __P((char *));
+int skeychallenge __P((struct skey *, char *, char *));
+int skeylookup __P((struct skey *, char *));
+int skeyverify __P((struct skey *, char *));
+int skeyzero __P((struct skey *, char *));
+void sevenbit __P((char *));
+void backspace __P((char *));
+char *skipspace __P((char *));
+char *readpass __P((char *, int));
+char *readskey __P((char *, int));
+int skey_authenticate __P((char *));
+int skey_passcheck __P((char *, char *));
+char *skey_keyinfo __P((char *));
+int skey_haskey __P((char *));
+int getskeyprompt __P((struct skey *, char *, char *));
+int atob8 __P((char *, char *));
+int btoa8 __P((char *, char *));
+int htoi __P((int));
const char *skey_get_algorithm __P((void));
-char *skey_set_algorithm __P((char *new));
-int skeygetnext __P((struct skey *mp));
+char *skey_set_algorithm __P((char *));
+int skeygetnext __P((struct skey *));
+int skey_unlock __P((struct skey *));
+__END_DECLS
+
+#endif /* _SKEY_H_ */