head	1.1;
access;
symbols
	RELEASE_8_3_0:1.1
	RELEASE_9_0_0:1.1
	RELEASE_7_4_0:1.1
	RELEASE_8_2_0:1.1
	RELEASE_6_EOL:1.1
	RELEASE_8_1_0:1.1
	RELEASE_7_3_0:1.1
	RELEASE_8_0_0:1.1
	RELEASE_7_2_0:1.1
	RELEASE_7_1_0:1.1
	RELEASE_6_4_0:1.1
	RELEASE_5_EOL:1.1
	RELEASE_7_0_0:1.1
	RELEASE_6_3_0:1.1
	PRE_XORG_7:1.1
	RELEASE_4_EOL:1.1
	RELEASE_6_2_0:1.1
	RELEASE_6_1_0:1.1
	RELEASE_5_5_0:1.1
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1
	RELEASE_4_2_0:1.1
	RELEASE_4_1_1:1.1
	RELEASE_4_1_0:1.1
	RELEASE_3_5_0:1.1
	RELEASE_4_0_0:1.1;
locks; strict;
comment	@# @;


1.1
date	99.12.29.08.52.10;	author steve;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Honor PREFIX and split up patches one patch for each file.

PR:		12056
Submitted by:	Nick Hibma <nick.hibma@@jrc.it>
@
text
@--- keycvt/keycvt.c.orig	Fri Aug 13 15:06:28 1993
+++ keycvt/keycvt.c	Tue Dec 28 20:01:38 1999
@@@@ -582,11 +582,21 @@@@
 
 static void getPassword( void )
 	{
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+	int len;
+#endif
 	puts( "Please enter password for this private key." );
 	puts( "Warning: Password will be echoed to screen!" );
 	printf( "Password: " );
 	fflush( stdout );
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
 	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,27 +1030,46 @@@@
 
 	/* 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 ] != '.' )
+	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 != '/' )
+	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 != '/' )
+	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 )
+	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 */
@
