From 7833f1a4d21cf18a1fbc9f0d8d484a5e44693cdf Mon Sep 17 00:00:00 2001 From: kris Date: Mon, 10 Apr 2000 11:18:54 +0000 Subject: Resolve conflicts --- contrib/opie/ftpcmd.y | 4 +++- contrib/opie/libopie/generator.c | 34 +++++++++++++++++++++++++--------- contrib/opie/libopie/hash.c | 4 +++- contrib/opie/libopie/hashlen.c | 4 +++- contrib/opie/libopie/newseed.c | 14 ++++++++++---- contrib/opie/opie.4 | 2 +- contrib/opie/opie.h | 11 ++++++++++- contrib/opie/opie_cfg.h | 12 ++++++++---- contrib/opie/opieftpd.c | 7 +++++-- contrib/opie/opieinfo.1 | 3 ++- contrib/opie/opiekey.1 | 3 ++- contrib/opie/opiekeys.5 | 5 ++++- contrib/opie/opiepasswd.1 | 3 ++- 13 files changed, 78 insertions(+), 28 deletions(-) (limited to 'contrib/opie') diff --git a/contrib/opie/ftpcmd.y b/contrib/opie/ftpcmd.y index 494dc81..ea5bb36 100644 --- a/contrib/opie/ftpcmd.y +++ b/contrib/opie/ftpcmd.y @@ -1,7 +1,7 @@ /* ftpcmd.y: yacc parser for the FTP daemon. %%% 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 @@ -21,6 +21,8 @@ you didn't get a copy, you may request one from . PORT attack fixes from Hobbit. Modified at NRL for OPIE 2.0. Originally from BSD. + +$FreeBSD$ */ /* * Copyright (c) 1985, 1988 Regents of the University of California. 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 . 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 . @@ -12,6 +12,8 @@ you didn't get a copy, you may request one from . 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 . @@ -9,6 +9,8 @@ you didn't get a copy, you may request one from . 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 . 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 . #include #endif /* HAVE_SYS_UTSNAME_H */ #include +#if DEBUG +#include +#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'; } diff --git a/contrib/opie/opie.4 b/contrib/opie/opie.4 index d597dee..58fa0d3 100644 --- a/contrib/opie/opie.4 +++ b/contrib/opie/opie.4 @@ -1,7 +1,7 @@ .\" opie.4: Overview of the OPIE software. .\" .\" %%% 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 diff --git a/contrib/opie/opie.h b/contrib/opie/opie.h index 404487e..71db7bd 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-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 @@ -15,6 +15,8 @@ License Agreement applies to this software. History: + 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. Modified by cmetz for OPIE 2.3. Renamed PTR to VOIDPTR. Added re-init key and extension file fields to struct opie. Added @@ -31,6 +33,8 @@ License Agreement applies to this software. Modified at NRL for OPIE 2.0. Written at Bellcore for the S/Key Version 1 software distribution (skey.h). + +$FreeBSD$ */ #ifndef _OPIE_H #define _OPIE_H 1 @@ -117,6 +121,11 @@ FILE *__opieopen __P((char *, int, int)); #endif /* EOF */ 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 #endif /* _OPIE */ + +#define OPIEPASSWD_CONSOLE 1 +#define OPIEPASSWD_FORCE 2 + #endif /* _OPIE_H */ diff --git a/contrib/opie/opie_cfg.h b/contrib/opie/opie_cfg.h index d890814..be29b59 100644 --- a/contrib/opie/opie_cfg.h +++ b/contrib/opie/opie_cfg.h @@ -1,7 +1,7 @@ /* opie_cfg.h: Various configuration-type pieces of information for OPIE. %%% 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 @@ -14,6 +14,8 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.32. Include before + to make *BSD happy. Modified by cmetz for OPIE 2.31. Added 4.4BSD-Lite pathnames.h definitions from ftpd. Added struct spwd definition and HAVE_SHADOW logic for SunOS C2 shadow password support. @@ -44,13 +46,15 @@ License Agreement applies to this software. Modified at NRL for OPIE 2.1. Fixed sigprocmask declaration. Gutted for autoconf. Split up for autoconf. Written at NRL for OPIE 2.0. + +$FreeBSD$ */ #ifndef _OPIE_CFG_H #define _OPIE_CFG_H 1 -#define VERSION "2.31" -#define DATE "Thursday, March 20, 1997" +#define VERSION "2.32" +#define DATE "Thursday, January 1, 1998" #ifndef unix #define unix 1 @@ -66,8 +70,8 @@ License Agreement applies to this software. #define DOUTMPX 0 #endif /* HAVE_GETUTXLINE && HAVE_UTMPX_H */ -/* Adapted from the Autoconf hypertext info pages */ #include +/* Adapted from the Autoconf hypertext info pages */ #if HAVE_DIRENT_H #include #else /* HAVE_DIRENT_H */ diff --git a/contrib/opie/opieftpd.c b/contrib/opie/opieftpd.c index ca346bd..b6e764d 100644 --- a/contrib/opie/opieftpd.c +++ b/contrib/opie/opieftpd.c @@ -1,7 +1,7 @@ /* opieftpd.c: Main program for an FTP daemon. %%% 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 @@ -14,6 +14,8 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.32. Remove include of dirent.h here; it's + done already (and conditionally) in opie_cfg.h. Modified by cmetz for OPIE 2.31. Merged in some 4.4BSD-Lite changes. Merged in a security fix to BSD-derived ftpds. Modified by cmetz for OPIE 2.3. Fixed the filename at the top. @@ -43,6 +45,8 @@ License Agreement applies to this software. Originally from BSD Net/2. There is some really, really ugly code in here. + +$FreeBSD$ */ /* * Copyright (c) 1985, 1988, 1990 Regents of the University of California. @@ -111,7 +115,6 @@ License Agreement applies to this software. #include #include -#include #include #if HAVE_TIME_H #include diff --git a/contrib/opie/opieinfo.1 b/contrib/opie/opieinfo.1 index b44ddf4..0b09455 100644 --- a/contrib/opie/opieinfo.1 +++ b/contrib/opie/opieinfo.1 @@ -1,7 +1,7 @@ .\" opieinfo.1: Manual page for the opieinfo(1) program. .\" .\" %%% 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 @@ -19,6 +19,7 @@ .\" Written at Bellcore for the S/Key Version 1 software distribution .\" (keyinfo.1). .\" +.\" $FreeBSD$ .ll 6i .pl 10.5i .lt 6.0i diff --git a/contrib/opie/opiekey.1 b/contrib/opie/opiekey.1 index 2dea07e..92a73ea 100644 --- a/contrib/opie/opiekey.1 +++ b/contrib/opie/opiekey.1 @@ -1,7 +1,7 @@ .\" opiekey.1: Manual page for the opiekey(1) program. .\" .\" %%% 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 @@ -25,6 +25,7 @@ .\" Written at Bellcore for the S/Key Version 1 software distribution .\" (key.1). .\" +.\" $FreeBSD$ .ll 6i .pl 10.5i .lt 6.0i diff --git a/contrib/opie/opiekeys.5 b/contrib/opie/opiekeys.5 index 09af0889..26f08ed 100644 --- a/contrib/opie/opiekeys.5 +++ b/contrib/opie/opiekeys.5 @@ -1,4 +1,4 @@ -.\" opieaccess.5: Manual page describing the /etc/opiekeys file. +.\" opiekeys.5: Manual page describing the /etc/opiekeys file. .\" .\" Portions of this software are Copyright 1995 by Randall Atkinson and Dan .\" McDonald, All Rights Reserved. All Rights under this copyright are assigned @@ -7,11 +7,14 @@ .\" .\" History: .\" +.\" Modified by cmetz for OPIE 2.32. This is opiekeys.5, not opiekeys.1 or +.\" opieaccess.5. .\" Written at NRL for OPIE 2.0. .\" .ll 6i .pl 10.5i .\" @(#)opiekeys.5 2.0 (NRL) 1/10/95 +.\" $FreeBSD$ .\" .lt 6.0i .TH OPIEKEYS 5 "January 10, 1995" diff --git a/contrib/opie/opiepasswd.1 b/contrib/opie/opiepasswd.1 index 1f9a9ee..d3fc5e3 100644 --- a/contrib/opie/opiepasswd.1 +++ b/contrib/opie/opiepasswd.1 @@ -1,7 +1,7 @@ .\" opiepasswd.1: Manual page for the opiepasswd(1) program. .\" .\" %%% 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 @@ -21,6 +21,7 @@ .\" Written at Bellcore for the S/Key Version 1 software distribution .\" (keyinit.1). .\" +.\" $FreeBSD$ .ll 6i .pl 10.5i .lt 6.0i -- cgit v1.1