summaryrefslogtreecommitdiffstats
path: root/contrib/opie/libopie
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-04-10 11:18:54 +0000
committerkris <kris@FreeBSD.org>2000-04-10 11:18:54 +0000
commit7833f1a4d21cf18a1fbc9f0d8d484a5e44693cdf (patch)
tree18a7928b588cb4975327cce357578a508637e6c8 /contrib/opie/libopie
parent73aab674279668f1f9d49a4464286d6e8d1444ca (diff)
downloadFreeBSD-src-7833f1a4d21cf18a1fbc9f0d8d484a5e44693cdf.zip
FreeBSD-src-7833f1a4d21cf18a1fbc9f0d8d484a5e44693cdf.tar.gz
Resolve conflicts
Diffstat (limited to 'contrib/opie/libopie')
-rw-r--r--contrib/opie/libopie/generator.c34
-rw-r--r--contrib/opie/libopie/hash.c4
-rw-r--r--contrib/opie/libopie/hashlen.c4
-rw-r--r--contrib/opie/libopie/newseed.c14
4 files changed, 41 insertions, 15 deletions
diff --git a/contrib/opie/libopie/generator.c b/contrib/opie/libopie/generator.c
index 02167bf..eef7cac 100644
--- a/contrib/opie/libopie/generator.c
+++ b/contrib/opie/libopie/generator.c
@@ -1,7 +1,7 @@
/* generator.c: The opiegenerator() library function.
%%% portions-copyright-cmetz-96
-Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights
+Portions of this software are Copyright 1996-1998 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
@@ -9,16 +9,24 @@ you didn't get a copy, you may request one from <license@inner.net>.
History:
+ Modified by cmetz for OPIE 2.32. If secret=NULL, always return
+ as if opieauto returned "get the secret". Renamed
+ _opieparsechallenge() to __opieparsechallenge(). Check
+ challenge for extended response support and don't send
+ an init-hex response if extended response support isn't
+ indicated in the challenge.
Modified by cmetz for OPIE 2.31. Renamed "init" to "init-hex".
- Removed active attack protection support. Fixed fairly
- bug in how init response was computed (i.e., dead wrong).
+ Removed active attack protection support. Fixed fairly
+ bug in how init response was computed (i.e., dead wrong).
Modified by cmetz for OPIE 2.3. Use _opieparsechallenge(). ifdef
- around string.h. Output hex responses by default, output
- OTP re-init extended responses (same secret) if sequence
- number falls below 10.
+ around string.h. Output hex responses by default, output
+ OTP re-init extended responses (same secret) if sequence
+ number falls below 10.
Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al.
- Bug fixes.
+ Bug fixes.
Created at NRL for OPIE 2.2.
+
+$FreeBSD$
*/
#include "opie_cfg.h"
@@ -36,26 +44,33 @@ int opiegenerator FUNCTION((buffer, secret, response), char *buffer AND char *se
char *seed;
char key[8];
int i;
+ int exts;
if (!(buffer = strstr(buffer, "otp-")))
return 1;
buffer += 4;
- if (_opieparsechallenge(buffer, &algorithm, &sequence, &seed))
+ if (__opieparsechallenge(buffer, &algorithm, &sequence, &seed, &exts))
return 1;
if ((sequence < 2) || (sequence > 9999))
return 1;
+ if (!secret[0])
+ return 2;
+
if (opiepasscheck(secret))
return -2;
if (i = opiekeycrunch(algorithm, key, seed, secret))
return i;
-
if (sequence < 10) {
+ if (!(exts & 1))
+ return 1;
+
+ {
char newseed[OPIE_SEED_MAX + 1];
char newkey[8];
char *c;
@@ -78,6 +93,7 @@ int opiegenerator FUNCTION((buffer, secret, response), char *buffer AND char *se
sprintf(buf, ":%s 499 %s:", algids[algorithm], newseed);
strcat(response, buf);
strcat(response, opiebtoh(buf, newkey));
+ };
} else {
while (sequence-- != 0)
opiehash(key, algorithm);
diff --git a/contrib/opie/libopie/hash.c b/contrib/opie/libopie/hash.c
index a2ffca3..eab1706 100644
--- a/contrib/opie/libopie/hash.c
+++ b/contrib/opie/libopie/hash.c
@@ -1,7 +1,7 @@
/* hash.c: The opiehash() library function.
%%% copyright-cmetz-96
-This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved.
+This software is Copyright 1996-1998 by Craig Metz, All Rights Reserved.
The Inner Net License Version 2 applies to this software.
You should have received a copy of the license with this software. If
you didn't get a copy, you may request one from <license@inner.net>.
@@ -12,6 +12,8 @@ you didn't get a copy, you may request one from <license@inner.net>.
not be correct). Backed out previous optimizations as
they killed thread-safety.
Created by cmetz for OPIE 2.3 using the old hash.c as a guide.
+
+$FreeBSD$
*/
#include "opie_cfg.h"
diff --git a/contrib/opie/libopie/hashlen.c b/contrib/opie/libopie/hashlen.c
index 5668b68..74f1fc6 100644
--- a/contrib/opie/libopie/hashlen.c
+++ b/contrib/opie/libopie/hashlen.c
@@ -1,7 +1,7 @@
/* hashlen.c: The opiehashlen() library function.
%%% copyright-cmetz-96
-This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved.
+This software is Copyright 1996-1998 by Craig Metz, All Rights Reserved.
The Inner Net License Version 2 applies to this software.
You should have received a copy of the license with this software. If
you didn't get a copy, you may request one from <license@inner.net>.
@@ -9,6 +9,8 @@ you didn't get a copy, you may request one from <license@inner.net>.
History:
Created by cmetz for OPIE 2.3.
+
+$FreeBSD$
*/
#include "opie_cfg.h"
diff --git a/contrib/opie/libopie/newseed.c b/contrib/opie/libopie/newseed.c
index 0d290ef..23cdce4 100644
--- a/contrib/opie/libopie/newseed.c
+++ b/contrib/opie/libopie/newseed.c
@@ -1,15 +1,18 @@
/* newseed.c: The opienewseed() library function.
%%% copyright-cmetz-96
-This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved.
+This software is Copyright 1996-1998 by Craig Metz, All Rights Reserved.
The Inner Net License Version 2 applies to this software.
You should have received a copy of the license with this software. If
you didn't get a copy, you may request one from <license@inner.net>.
History:
+ Modified by cmetz for OPIE 2.32. Added syslog.h if DEBUG.
Modified by cmetz for OPIE 2.31. Added time.h.
Created by cmetz for OPIE 2.22.
+
+$FreeBSD$
*/
#include "opie_cfg.h"
@@ -27,6 +30,9 @@ you didn't get a copy, you may request one from <license@inner.net>.
#include <sys/utsname.h>
#endif /* HAVE_SYS_UTSNAME_H */
#include <errno.h>
+#if DEBUG
+#include <syslog.h>
+#endif /* DEBUG */
#include "opie.h"
int opienewseed FUNCTION((seed), char *seed)
@@ -87,9 +93,9 @@ int opienewseed FUNCTION((seed), char *seed)
struct utsname utsname;
if (uname(&utsname) < 0) {
-#if 0
- perror("uname");
-#endif /* 0 */
+#if DEBUG
+ syslog(LOG_DEBUG, "uname: %s(%d)", strerror(errno), errno);
+#endif /* DEBUG */
utsname.nodename[0] = 'k';
utsname.nodename[1] = 'e';
}
OpenPOWER on IntegriCloud