summaryrefslogtreecommitdiffstats
path: root/contrib/opie/opie.h
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-03-21 23:42:52 +0000
committermarkm <markm@FreeBSD.org>2002-03-21 23:42:52 +0000
commitb38a0011c18c49fcb516cc2b4f5d751565e53f44 (patch)
tree1ec99b3b189dcbff75d7f05f7c29bd03c4d795da /contrib/opie/opie.h
parent084b4588f24346b3d369eaf49193461c380e8521 (diff)
downloadFreeBSD-src-b38a0011c18c49fcb516cc2b4f5d751565e53f44.zip
FreeBSD-src-b38a0011c18c49fcb516cc2b4f5d751565e53f44.tar.gz
Resolve conflicts.
Diffstat (limited to 'contrib/opie/opie.h')
-rw-r--r--contrib/opie/opie.h54
1 files changed, 44 insertions, 10 deletions
diff --git a/contrib/opie/opie.h b/contrib/opie/opie.h
index 7ac9b21..be508c7 100644
--- a/contrib/opie/opie.h
+++ b/contrib/opie/opie.h
@@ -2,7 +2,7 @@
system that a program might need.
%%% portions-copyright-cmetz-96
-Portions of this software are Copyright 1996-1998 by Craig Metz, All Rights
+Portions of this software are Copyright 1996-1999 by Craig Metz, All Rights
Reserved. The Inner Net License Version 2 applies to these portions of
the software.
You should have received a copy of the license with this software. If
@@ -15,6 +15,9 @@ License Agreement applies to this software.
History:
+ Modified by cmetz for OPIE 2.4. Added sequence number limits. Added
+ struct opie_otpkey and made many functions use it. Added
+ opiestrncpy(). Include header with libmissing prototypes.
Modified by cmetz for OPIE 2.32. Added symbolic flag names for
opiepasswd(). Added __opieparsechallenge() prototype.
Modified by cmetz for OPIE 2.31. Removed active attack protection.
@@ -53,7 +56,9 @@ struct opie {
#define __OPIE_FLAGS_READ 2
/* Minimum length of a secret password */
+#ifndef OPIE_SECRET_MIN
#define OPIE_SECRET_MIN 10
+#endif /* OPIE_SECRET_MIN */
/* Maximum length of a secret password */
#define OPIE_SECRET_MAX 127
@@ -76,25 +81,47 @@ struct opie {
/* Maximum length of a principal (read: user name) */
#define OPIE_PRINCIPAL_MAX 32
-#include <sys/cdefs.h>
+/* Maximum sequence number */
+#ifndef OPIE_SEQUENCE_MAX
+#define OPIE_SEQUENCE_MAX 9999
+#endif /* OPIE_SEQUENCE_MAX */
+
+/* Restricted sequence number */
+#ifndef OPIE_SEQUENCE_RESTRICT
+#define OPIE_SEQUENCE_RESTRICT 9
+#endif /* OPIE_SEQUENCE_RESTRICT */
+
+#define UINT4 u_int32_t
+
+struct opie_otpkey {
+ UINT4 words[2];
+};
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif /* SEEK_SET */
+
+#ifndef SEEK_END
+#define SEEK_END 2
+#endif /* SEEK_END */
__BEGIN_DECLS
int opieaccessfile __P((char *));
int rdnets __P((long));
int isaddr __P((register char *));
int opiealways __P((char *));
-char *opieatob8 __P((char *,char *));
+char *opieatob8 __P((struct opie_otpkey *, char *));
void opiebackspace __P((char *));
-char *opiebtoa8 __P((char *,char *));
-char *opiebtoe __P((char *,char *));
-char *opiebtoh __P((char *,char *));
-int opieetob __P((char *,char *));
+char *opiebtoa8 __P((char *, struct opie_otpkey *));
+char *opiebtoe __P((char *, struct opie_otpkey *));
+char *opiebtoh __P((char *, struct opie_otpkey *));
+int opieetob __P((struct opie_otpkey *, char *));
int opiechallenge __P((struct opie *,char *,char *));
int opiegenerator __P((char *,char *,char *));
int opiegetsequence __P((struct opie *));
-void opiehash __P((void *, unsigned));
+void opiehash __P((struct opie_otpkey *, unsigned));
int opiehtoi __P((register char));
-int opiekeycrunch __P((int, char *, char *, char *));
+int opiekeycrunch __P((int, struct opie_otpkey *, char *, char *));
int opielock __P((char *));
int opieunlock __P((void));
void opieunlockaeh __P((void));
@@ -121,7 +148,6 @@ __END_DECLS
#define FUNCTION(arglist, args) (args)
#define AND ,
#define FUNCTION_NOARGS ()
-#define UINT4 u_int32_t
__BEGIN_DECLS
struct utmp;
@@ -133,6 +159,14 @@ int __opiereadrec __P((struct opie *));
int __opiewriterec __P((struct opie *));
int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts));
__END_DECLS
+
+#define opiestrncpy(dst, src, n) \
+ do { \
+ strncpy(dst, src, n-1); \
+ dst[n-1] = 0; \
+ } while(0)
+
+/* #include "missing.h" */
#endif /* _OPIE */
#define OPIEPASSWD_CONSOLE 1
OpenPOWER on IntegriCloud