New option -E to specify EGD/PRNGD socket

Albert Chin gnupg-devel at thewrittenword.com
Tue Sep 2 20:04:03 CEST 2003


Addition of a new option, -E, to specify an alternate path to the
EGD/PRNGD socket.

-- 
albert chin (china at thewrittenword.com)

-- snip snip
2003-09-02  Albert Chin-A-Young <china at thewrittenword.com>

	* cipher/rndegd.c, cipher/Makefile.am, g10/options.h,
	g10/g10.c, doc/gpg.1: Add '-E' option to specify an
	alternate path to the EGD/PRNGD socket.

--- cipher/rndegd.c.orig	Tue Sep  2 11:17:59 2003
+++ cipher/rndegd.c	Tue Sep  2 11:18:34 2003
@@ -38,6 +38,7 @@
 #include "ttyio.h"
 #include "algorithms.h"
 #include "cipher.h"
+#include "options.h"
 #include "i18n.h"
 
 
@@ -108,7 +109,10 @@
     }
 
 #ifdef EGD_SOCKET_NAME
-  bname = EGD_SOCKET_NAME;
+  if (opt.egd_socket)
+    bname = opt.egd_socket;
+  else
+    bname = EGD_SOCKET_NAME;
 #endif
   if ( !bname || !*bname )
     bname = "=entropy";
--- cipher/Makefile.am.orig	Tue Sep  2 11:18:46 2003
+++ cipher/Makefile.am	Tue Sep  2 11:19:48 2003
@@ -18,7 +18,8 @@
 
 ## Process this file with automake to produce Makefile.in
 
-INCLUDES = -I.. -I$(top_srcdir)/include -I$(top_srcdir)/intl
+INCLUDES = -I.. -I$(top_srcdir)/include -I$(top_srcdir)/intl \
+	-I$(top_srcdir)/g10
 
 noinst_LIBRARIES = libcipher.a
 
--- g10/options.h.orig	Tue Sep  2 11:20:00 2003
+++ g10/options.h	Tue Sep  2 11:20:10 2003
@@ -178,6 +178,7 @@
     struct groupitem *grouplist;
     int mangle_dos_filenames;
     int enable_progress_filter;
+    const char *egd_socket; /* override pre-compiled path to EGD socket */
 } opt;
 
 
--- g10/g10.c.orig	Tue Sep  2 11:26:19 2003
+++ g10/g10.c	Tue Sep  2 11:27:12 2003
@@ -69,6 +69,7 @@
     oUser	  = 'u',
     oVerbose	  = 'v',
     oCompress	  = 'z',
+    oEgdSocket	  = 'E',
     oSetNotation  = 'N',
     oBatch	  = 500,
     oSigNotation,
@@ -465,6 +466,7 @@
     { oPhotoViewer,  "photo-viewer", 2, N_("Set command line to view Photo IDs")},
     { oSetNotation,  "set-notation", 2, "@" },
     { oSetNotation,  "notation-data", 2, "@" }, /* Alias */
+    { oEgdSocket, "egd-socket", 2, N_("|PATH|override pre-compiled PATH to EGD socket")},
     { oSigNotation,  "sig-notation", 2, "@" },
     { oCertNotation, "cert-notation", 2, "@" },
 
@@ -1667,6 +1669,7 @@
           case oAllowSecretKeyImport: /* obsolete */ break;
 	  case oTryAllSecrets: opt.try_all_secrets = 1; break;
           case oTrustedKey: register_trusted_key( pargs.r.ret_str ); break;
+          case oEgdSocket: opt.egd_socket = m_strdup(pargs.r.ret_str); break;
           case oEnableSpecialFilenames:
             iobuf_enable_special_filenames (1);
             break;
--- doc/gpg.1.orig	Tue Sep  2 11:28:26 2003
+++ doc/gpg.1	Tue Sep  2 11:28:43 2003
@@ -423,6 +423,9 @@
 or zero, an endless sequence of random bytes will be emitted. 
 PLEASE, don't use this command unless you know what you are doing; it may 
 remove precious entropy from the system! 
+.IP "-E, --egd-socket \fBpath\fR" 10
+Use \fBpath\fR as the path to the entropy socket rather than the
+compiled-in default.
 .IP "--gen-prime \fBmode\fR 		  \fBbits\fR 		   [\fBqbits\fR]" 10 
 Use the source, Luke :-). The output format is still subject to change. 
 .IP "--version" 10 




More information about the Gnupg-devel mailing list