*** ./crypt/keymgmt.c.old Wed Aug 18 01:56:14 1993 --- ./crypt/keymgmt.c Sat Jan 7 18:09:29 1995 *************** *** 495,505 **** FD keyFileFD, savedInFD = getInputFD(); BOOLEAN matched, firstTime = TRUE; char *matchID, firstChar; ! char *keyFilePath; int userIDlength, i; /* Use the keyID to get the public key from a key file */ ! keyFilePath = getFirstKeyPath( getenv( PGPPATH ), keyFileName ); while( keyFilePath != NULL ) { /* Open key file */ --- 495,518 ---- FD keyFileFD, savedInFD = getInputFD(); BOOLEAN matched, firstTime = TRUE; char *matchID, firstChar; ! char *keyFilePath, *s; int userIDlength, i; + #ifdef __UNIX__ + char *h, buf[ MAX_PATH ]; + #endif + if ((s = getenv( PGPPATH )) == NULL) + #ifdef __UNIX__ + if ((h = getenv( "HOME" )) != NULL) { + strcpy(buf, h); + strcat(buf, "/.pgp"); + s = buf; + } + #else + ; + #endif /* Use the keyID to get the public key from a key file */ ! keyFilePath = getFirstKeyPath( s, keyFileName ); while( keyFilePath != NULL ) { /* Open key file */ *** ./keycvt/makefile.old Tue May 18 01:43:30 1993 --- ./keycvt/makefile Sat Jan 7 17:06:02 1995 *************** *** 60,65 **** --- 60,66 ---- LS = ls -l # Directory command ECHO = echo # Echo to screen command MAKE = make # The make command + PREFIX = /usr/local #**************************************************************************** #* * *************** *** 71,77 **** @$(ECHO) @$(ECHO) "To create KEYCVT you have to enter the Unix system type you want to build" @$(ECHO) "KEYCVT for. Possible options are: aix (RS6000), aix370, aix386, convex," ! @$(ECHO) "irix, hpux, isc, linux, mint, next, qnx, sun, svr4, ultrix, ultrix_old" @$(ECHO) "(Ultrix 3.x or earlier), and uts4. If none of the above fit, try" @$(ECHO) "'make generic', and send a copy of any changes necessary to the author," @$(ECHO) "pgut1@cs.aukuni.ac.nz" --- 72,78 ---- @$(ECHO) @$(ECHO) "To create KEYCVT you have to enter the Unix system type you want to build" @$(ECHO) "KEYCVT for. Possible options are: aix (RS6000), aix370, aix386, convex," ! @$(ECHO) "freebsd, irix, hpux, isc, linux, mint, next, qnx, sun, svr4, ultrix, ultrix_old" @$(ECHO) "(Ultrix 3.x or earlier), and uts4. If none of the above fit, try" @$(ECHO) "'make generic', and send a copy of any changes necessary to the author," @$(ECHO) "pgut1@cs.aukuni.ac.nz" *************** *** 128,133 **** --- 129,140 ---- convex: @$(MAKE) keycvt CC="cc" + + freebsd: + @$(MAKE) $(PROJ) CMDC="-O2" + + freebsd.install: + $(INSTALL) $(COPY) $(STRIP) -o $(BINOWN) -g $(BINGRP) $(PROJ) $(PREFIX)/bin # Generic: Generic BSD-ish system running gcc. Can't continue, we really # need user intervention here. *** ./keycvt/keycvt.c.old Sat Aug 14 00:06:28 1993 --- ./keycvt/keycvt.c Sat Jan 7 18:28:53 1995 *************** *** 582,592 **** --- 582,602 ---- static void getPassword( void ) { + #ifdef __FreeBSD__ + int len; + #endif puts( "Please enter password for this private key." ); puts( "Warning: Password will be echoed to screen!" ); printf( "Password: " ); fflush( stdout ); + #ifndef __FreeBSD__ gets( password ); + #else /* gets depricated in FreeBSD */ + fgets( password, sizeof(password), stdin); + len = strlen(password); + if (password[len - 1] == '\n') + password[len - 1] = '\0'; + #endif } void initCrypt( void ) *************** *** 1020,1046 **** /* Try and find the PGP seed file */ if( ( pgpPath = getenv( "PGPPATH" ) ) == NULL ) pgpPath = ""; pathLen = strlen( pgpPath ); strcpy( tempFileName, pgpPath ); #if defined( __ARC__ ) ! if( pathLen && tempFileName[ pathLen - 1 ] != '.' ) /* Add directory seperator if necessary */ tempFileName[ pathLen++ ] = '.'; strcat( tempFileName, "randseed" ); #elif defined( __AMIGA__ ) ! if( pathLen && ( ch = tempFileName[ pathLen - 1 ] ) != ':' && ch != '/' ) /* Add directory seperator if necessary */ tempFileName[ pathLen++ ] = '/'; strcat( tempFileName, "randseed.bin" ); #else ! if( pathLen && ( ch = tempFileName[ pathLen - 1 ] ) != '\\' && ch != '/' ) /* Add directory seperator if necessary */ tempFileName[ pathLen++ ] = '/'; strcat( tempFileName, "randseed.bin" ); #endif /* __ARC__ */ ! if( ( inFilePtr = fopen( tempFileName, "rb" ) ) == NULL ) puts( "Cannot find PGP seed file, HPACK seed file not created" ); else { /* See if the output file exists */ --- 1030,1075 ---- /* Try and find the PGP seed file */ if( ( pgpPath = getenv( "PGPPATH" ) ) == NULL ) + #ifdef __UNIX__ + if( ( pgpPath = getenv( "HOME" ) ) != NULL ) { + strcpy( tempFileName, pgpPath ); + strcat( tempFileName, "/.pgp"); + pgpPath = tempFileName; + } + else + #endif pgpPath = ""; pathLen = strlen( pgpPath ); + #ifdef __UNIX__ + if (pgpPath != tempFileName) + #endif strcpy( tempFileName, pgpPath ); #if defined( __ARC__ ) ! if( pathLen && tempFileName[ pathLen - 1 ] != '.' ) { /* Add directory seperator if necessary */ tempFileName[ pathLen++ ] = '.'; + tempFileName[ pathLen ] = '\0'; + } strcat( tempFileName, "randseed" ); #elif defined( __AMIGA__ ) ! if( pathLen && ( ch = tempFileName[ pathLen - 1 ] ) != ':' && ch != '/' ) { /* Add directory seperator if necessary */ tempFileName[ pathLen++ ] = '/'; + tempFileName[ pathLen ] = '\0'; + } strcat( tempFileName, "randseed.bin" ); #else ! if( pathLen && ( ch = tempFileName[ pathLen - 1 ] ) != '\\' && ch != '/' ) { /* Add directory seperator if necessary */ tempFileName[ pathLen++ ] = '/'; + tempFileName[ pathLen ] = '\0'; + } strcat( tempFileName, "randseed.bin" ); #endif /* __ARC__ */ ! if( ( inFilePtr = fopen( tempFileName, "rb" ) ) == NULL ) { ! perror( tempFileName ); puts( "Cannot find PGP seed file, HPACK seed file not created" ); + } else { /* See if the output file exists */ *** ./language/language.c.old Thu Sep 23 06:23:20 1993 --- ./language/language.c Sat Jan 7 18:44:56 1995 *************** *** 188,194 **** /* Process user response */ response = hgetch(); response = toupper( response ); /* Damn macros */ ! blankLine( screenWidth ); if( response == RESPONSE_QUIT ) return; lineNo -= ( response == ' ' ) ? screenHeight : 1; --- 188,194 ---- /* Process user response */ response = hgetch(); response = toupper( response ); /* Damn macros */ ! blankLine( screenWidth - 1 ); if( response == RESPONSE_QUIT ) return; lineNo -= ( response == ' ' ) ? screenHeight : 1; *************** *** 268,273 **** --- 268,276 ---- if( ( inFD = hopen( fileNamePtr, O_RDONLY | S_DENYWR | A_RANDSEQ ) ) == ERROR ) return( ERROR ); #elif defined( __UNIX__ ) + fileNamePtr = getFirstKeyPath( "/usr/local/lib/hpack", DATA_FILENAME ); + if( ( inFD = hopen( fileNamePtr, O_RDONLY | S_DENYWR | A_RANDSEQ ) ) != ERROR ) + goto found; /* Build path to language file and try and process it */ fileNamePtr = getFirstKeyPath( getenv( "PATH" ), DATA_FILENAME ); while( fileNamePtr != NULL ) *************** *** 290,295 **** --- 293,301 ---- return( ERROR ); /* Couldn't find/open input file */ } #endif /* System-specific handling of how to find language defn.file */ + #ifdef __FreeBSD__ + found: + #endif setInputFD( inFD ); resetFastIn(); *** ./system/unix.c.old Fri Aug 27 21:20:56 1993 --- ./system/unix.c Sat Jan 7 16:48:30 1995 *************** *** 123,129 **** #if defined( BSD386 ) || defined( CONVEX ) || defined( HPUX ) || \ defined( IRIX ) || defined( LINUX ) || defined( POSIX ) || \ ! defined( SVR4 ) || defined( UTS4 ) #include --- 123,129 ---- #if defined( BSD386 ) || defined( CONVEX ) || defined( HPUX ) || \ defined( IRIX ) || defined( LINUX ) || defined( POSIX ) || \ ! defined( SVR4 ) || defined( UTS4 ) || defined( __FreeBSD__ ) #include *************** *** 144,150 **** tcgetattr( ttyFD, &ttyInfo ); #if defined( BSD386 ) || defined( CONVEX ) || defined( HPUX ) || \ defined( IRIX ) || defined( LINUX ) || defined( POSIX ) || \ ! defined( UTS4 ) ttyInfo.c_lflag &= ~ECHO; ttyInfo.c_lflag &= ~ICANON; #else --- 144,150 ---- tcgetattr( ttyFD, &ttyInfo ); #if defined( BSD386 ) || defined( CONVEX ) || defined( HPUX ) || \ defined( IRIX ) || defined( LINUX ) || defined( POSIX ) || \ ! defined( UTS4 ) || defined( __FreeBSD__ ) ttyInfo.c_lflag &= ~ECHO; ttyInfo.c_lflag &= ~ICANON; #else *************** *** 183,189 **** tcgetattr( ttyFD, &ttyInfo ); #if defined( BSD386 ) || defined( CONVEX ) || defined( HPUX ) || \ defined( IRIX ) || defined( LINUX ) || defined( POSIX ) || \ ! defined( UTS4 ) ttyInfo.c_lflag |= ECHO; ttyInfo.c_lflag |= ICANON; #else --- 183,189 ---- tcgetattr( ttyFD, &ttyInfo ); #if defined( BSD386 ) || defined( CONVEX ) || defined( HPUX ) || \ defined( IRIX ) || defined( LINUX ) || defined( POSIX ) || \ ! defined( UTS4 ) || defined( __FreeBSD__ ) ttyInfo.c_lflag |= ECHO; ttyInfo.c_lflag |= ICANON; #else *************** *** 728,734 **** defined( HPUX ) || defined( IRIX ) || defined( LINUX ) || \ defined( NEXT ) || defined( OSF1 ) || defined( SUNOS ) || \ defined( SVR4 ) || defined( ULTRIX ) || defined( ULTRIX_OLD ) || \ ! defined( UTS4 ) int htruncate( const FD theFD ) { --- 728,734 ---- defined( HPUX ) || defined( IRIX ) || defined( LINUX ) || \ defined( NEXT ) || defined( OSF1 ) || defined( SUNOS ) || \ defined( SVR4 ) || defined( ULTRIX ) || defined( ULTRIX_OLD ) || \ ! defined( UTS4 ) || defined( __FreeBSD__ ) int htruncate( const FD theFD ) { *** ./defs.h.old Mon May 31 19:17:00 1993 --- ./defs.h Sat Jan 7 16:44:02 1995 *************** *** 43,49 **** /* 'inline' patch for compilers which can't handle this */ ! #if !( defined( __CPLUSPLUS__ ) || defined( __cplusplus ) ) || defined( __TSC__ ) #define inline #endif /* !( __CPLUSPLUS__ || __cplusplus ) */ --- 43,49 ---- /* 'inline' patch for compilers which can't handle this */ ! #if !( defined( __GNUC__ ) || defined( __CPLUSPLUS__ ) || defined( __cplusplus ) ) || defined( __TSC__ ) #define inline #endif /* !( __CPLUSPLUS__ || __cplusplus ) */ *** ./hpacklib.h.old Thu Aug 5 13:10:40 1993 --- ./hpacklib.h Sat Jan 7 16:52:54 1995 *************** *** 26,37 **** #include /* Prototypes for generic functions */ #if defined( __UNIX__ ) && !( defined( BSD386 ) || defined( CONVEX ) || \ ! defined( NEXT ) || defined( ULTRIX_OLD ) ) #include /* Needed for mem.functions on some systems */ #endif /* __UNIX__ && !( BSD386 || CONVEX || NEXT || ULTRIX_OLD ) */ #if defined( AIX386 ) || ( defined( __AMIGA__ ) && !defined( LATTICE ) ) || \ defined( __ARC__ ) || defined( __ATARI__ ) || defined( __MSDOS16__ ) || \ ! defined( __MSDOS32__ ) #include /* Needed for mem.functions */ #endif /* AIX386 || ( __AMIGA__ && !LATTICE ) || __ARC__ || __ATARI__ || __MSDOS16__ || __MSDOS32__ */ #if defined( __ATARI__ ) || ( defined( __OS2__ ) && !defined( __GCC__ ) ) --- 26,37 ---- #include /* Prototypes for generic functions */ #if defined( __UNIX__ ) && !( defined( BSD386 ) || defined( CONVEX ) || \ ! defined( NEXT ) || defined( ULTRIX_OLD ) || defined( __FreeBSD__ )) #include /* Needed for mem.functions on some systems */ #endif /* __UNIX__ && !( BSD386 || CONVEX || NEXT || ULTRIX_OLD ) */ #if defined( AIX386 ) || ( defined( __AMIGA__ ) && !defined( LATTICE ) ) || \ defined( __ARC__ ) || defined( __ATARI__ ) || defined( __MSDOS16__ ) || \ ! defined( __MSDOS32__ ) || defined( __FreeBSD__ ) #include /* Needed for mem.functions */ #endif /* AIX386 || ( __AMIGA__ && !LATTICE ) || __ARC__ || __ATARI__ || __MSDOS16__ || __MSDOS32__ */ #if defined( __ATARI__ ) || ( defined( __OS2__ ) && !defined( __GCC__ ) ) *** ./system.h.old Fri Aug 27 21:16:40 1993 --- ./system.h Sat Jan 7 16:55:56 1995 *************** *** 788,794 **** #elif defined( CONVEX ) #define MAX_PATH ( _POSIX_PATH_MAX + 1 ) #define MAX_FILENAME ( 254 + 1 ) ! #elif defined( POSIX ) #define MAX_PATH ( _POSIX_PATH_MAX + 1 ) #define MAX_FILENAME ( NAME_MAX + 1 ) #elif defined( SVR4 ) --- 788,797 ---- #elif defined( CONVEX ) #define MAX_PATH ( _POSIX_PATH_MAX + 1 ) #define MAX_FILENAME ( 254 + 1 ) ! #elif defined( POSIX ) || defined(__FreeBSD__) ! #ifdef __FreeBSD__ ! #include ! #endif #define MAX_PATH ( _POSIX_PATH_MAX + 1 ) #define MAX_FILENAME ( NAME_MAX + 1 ) #elif defined( SVR4 ) *************** *** 875,881 **** #if defined( AIX ) || defined( AIX386 ) || defined( AIX370 ) || \ defined( BSD386 ) || defined( GENERIC ) || defined( HPUX ) || \ defined( IRIX ) || defined( NEXT ) || defined( OSF1 ) || \ ! defined( ULTRIX ) || defined( ULTRIX_OLD ) || defined( UTS4 ) #define SPACE_OK TRUE #else #define SPACE_OK FALSE --- 878,885 ---- #if defined( AIX ) || defined( AIX386 ) || defined( AIX370 ) || \ defined( BSD386 ) || defined( GENERIC ) || defined( HPUX ) || \ defined( IRIX ) || defined( NEXT ) || defined( OSF1 ) || \ ! defined( ULTRIX ) || defined( ULTRIX_OLD ) || defined( UTS4 ) || \ ! defined( __FreeBSD__ ) #define SPACE_OK TRUE #else #define SPACE_OK FALSE *************** *** 948,953 **** --- 952,964 ---- #elif defined( UTS4 ) /* Amdahl UTS4 */ #define NEED_STRLWR #define NEED_STRICMP + #elif defined( __FreeBSD__ ) /* Amdahl UTS4 */ + #include + #define tell(fd) lseek((fd),(off_t)0,SEEK_CUR) + #define NEED_STRLWR + #define stricmp strcasecmp + #define strnicmp strncasecmp + #define USE_TERMCAP #elif defined( ESIX ) /* Esix */ #define NEED_HELP #endif /* Various mutation-specific defines */ *** ./makefile.old Tue Aug 10 19:47:06 1993 --- ./makefile Sat Jan 7 18:20:34 1995 *************** *** 55,60 **** --- 55,61 ---- ECHO = echo # Echo to screen command MAKE = make # The make command MV = mv # Rename command + PREFIX = /usr/local #**************************************************************************** #* * *************** *** 68,74 **** @$(ECHO) @$(ECHO) "To create HPACK, you have to enter the Unix system type you want to build it" @$(ECHO) "for. Possible options are: aix (RS6000), aix370, aix386, bsd386, convex," ! @$(ECHO) "irix, hpux, hpux-gcc, isc, linux, mint, next, osf1, qnx, sun, svr4, ultrix," @$(ECHO) "ultrix_old (Ultrix 3.x or earlier), and uts4. If none of the above fit," @$(ECHO) "try 'make generic', and send a copy of any changes necessary to the author," @$(ECHO) "pgut1@cs.aukuni.ac.nz" --- 69,75 ---- @$(ECHO) @$(ECHO) "To create HPACK, you have to enter the Unix system type you want to build it" @$(ECHO) "for. Possible options are: aix (RS6000), aix370, aix386, bsd386, convex," ! @$(ECHO) "freebsd, irix, hpux, hpux-gcc, isc, linux, mint, next, osf1, qnx, sun, svr4, ultrix," @$(ECHO) "ultrix_old (Ultrix 3.x or earlier), and uts4. If none of the above fit," @$(ECHO) "try 'make generic', and send a copy of any changes necessary to the author," @$(ECHO) "pgut1@cs.aukuni.ac.nz" *************** *** 317,322 **** --- 318,338 ---- convex: @$(MAKE) hpack CMDC="-DCONVEX" CC="cc" + + freebsd: + @$(MAKE) $(PROJ) CMDC="-O2" LFLAGS="-o $(PROJ) -ltermcap" + cd keycvt; $(MAKE) freebsd + + freebsd.install: + -@mkdir -p ${PREFIX}/bin + -@mkdir -p ${PREFIX}/etc + -@mkdir -p ${PREFIX}/lib/hpack + -@mkdir -p ${PREFIX}/man/man1 + $(INSTALL) $(COPY) $(STRIP) -o $(BINOWN) -g $(BINGRP) -m $(BINMODE) $(PROJ) $(PREFIX)/bin + $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m 444 language.dat $(PREFIX)/lib/hpack + $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m 444 docs/$(PROJ).1 $(PREFIX)/man/man1 + -[ ! -f $(PREFIX)/etc/hpack.cfg ] && $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m 644 docs/hpack.cfg $(PREFIX)/etc + cd keycvt; $(MAKE) freebsd.install # Generic: Generic BSD-ish system running gcc *** ./cli.c.old Sun Sep 5 07:23:48 1993 --- ./cli.c Sat Jan 7 17:48:20 1995 *************** *** 724,735 **** void doConfigFile( void ) { ! char *configFileName; FD configFileFD; WORD oldFlags = flags; /* Build path to config file and try and process it */ ! configFileName = getFirstKeyPath( getenv( HPACKPATH ), CONFIGFILENAME ); while( configFileName != NULL ) { /* Try and read the seed from the seedfile */ --- 724,741 ---- void doConfigFile( void ) { ! char *configFileName, *s; FD configFileFD; WORD oldFlags = flags; + if (( s = getenv( HPACKPATH )) == NULL) + #ifdef __UNIX__ + s = "/usr/local/etc:/usr/local/lib/hpack"; + #else + ; + #endif /* Build path to config file and try and process it */ ! configFileName = getFirstKeyPath( s, CONFIGFILENAME ); while( configFileName != NULL ) { /* Try and read the seed from the seedfile */ *** ./archive.c.old Tue Jun 29 14:27:52 1993 --- ./archive.c Sat Jan 7 17:33:34 1995 *************** *** 326,337 **** --- 326,347 ---- void getFileName( char *fileName ) { + #ifdef __FreeBSD__ + int len; + #endif hprintf( MESG_s_ALREADY_EXISTS_ENTER_NEW_NAME, fileName ); /* Nasty input routine - should check for illegal chars and suchlike. Will also overflow if anyone enters more than 16K chars */ hflush( stdout ); + #ifndef __FreeBSD__ hgets( ( char * ) mrglBuffer ); + #else /* gets depricated in FreeBSD */ + fgets( mrglBuffer, MAX_PATH, stdin ); + len = strlen(mrglBuffer); + if (mrglBuffer[len - 1] == '\n') + mrglBuffer[len - 1] = '\0'; + #endif mrglBuffer[ MAX_PATH - 1 ] = '\0'; strcpy( fileName, ( char * ) mrglBuffer );