🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #283930

Attn: Elvis - SECRINGNEW Patch

#283930
From: Zax
Date: Sat, 13 Aug 2016 19:16
92 lines
4113 bytes
Hi,

Here's a small Mixmaster patch for consideration.  This allows the
operator to define the path for the secring.mix.new file rather than it
being hardcoded to the Mix directory.  The reasoning is that some
operators, might prefer to write secret keys to an encrypted filesystem.
The benefit of doing this is defeated if Mixmaster keeps writing the
secring.mix.new file to an unencrypted volume.


diff -uNr ../mixmaster-elvis/Src/config.h Src/config.h
--- ../mixmaster-elvis/Src/config.h	2015-11-06 23:50:15.963341336 +0000
+++ Src/config.h	2016-08-13 19:24:15.755105799 +0100
@@ -215,6 +215,7 @@
 #define DEFAULT_DHPARAMS "dhparam.mix"
 #define DEFAULT_MIXRAND "mixrand.bin"
 #define DEFAULT_SECRING "secring.mix"
+#define DEFAULT_SECRINGNEW "secring.mix.new"
 #define DEFAULT_PUBRING "pubring.mix"
 #define DEFAULT_IDLOG "id.log"
 #define DEFAULT_STATS "stats.log"
@@ -262,6 +263,7 @@
 extern char DHPARAMS[];
 extern char MIXRAND[];
 extern char SECRING[];
+extern char SECRINGNEW[];
 extern char PUBRING[];
 extern char IDLOG[];
 extern char STATS[];
diff -uNr ../mixmaster-elvis/Src/keymgt.c Src/keymgt.c
--- ../mixmaster-elvis/Src/keymgt.c	2016-06-29 22:33:13.129533140 +0100
+++ Src/keymgt.c	2016-08-13 19:30:47.964404415 +0100
@@ -454,9 +454,11 @@
     keyring = mix_openfile(SECRING, "r");
     if (!keyring)
         return -1;
-    newsecring = mix_openfile("secring.mix.new", "w");
-    if (!newsecring)
-        return -1;
+    newsecring = mix_openfile(SECRINGNEW, "w");
+    if (!newsecring) {
+            errlog(ERRORMSG, "Unable to create new secring: %s\n", SECRINGNEW);
+            return -1;
+    }
 
     while (res) {
         linecount++;
@@ -508,9 +510,10 @@
     /* replace the file and wipe the old one */
     keyring = mix_openfile(SECRING, "r+");
     {
-    /* rename the "secring.mix.new" in the MIXDIR not CWD */
+    // Rename SECRINGNEW to SECRING
     char path1[PATHMAX], path2[PATHMAX];
-    mixfile(path1, "secring.mix.new");
+    errlog(LOG, "Renaming %s to %s.\n", SECRINGNEW, SECRING);
+    mixfile(path1, SECRINGNEW);
     mixfile(path2, SECRING);
     if (rename(path1, path2)) return -14;
     }
diff -uNr ../mixmaster-elvis/Src/mix.c Src/mix.c
--- ../mixmaster-elvis/Src/mix.c	2015-11-06 23:50:15.971341278 +0000
+++ Src/mix.c	2016-08-13 19:33:08.351472573 +0100
@@ -57,6 +57,7 @@
 char DHPARAMS[PATHMAX];
 char MIXRAND[PATHMAX];
 char SECRING[PATHMAX];
+char SECRINGNEW[PATHMAX];
 char PUBRING[PATHMAX];
 char IDLOG[PATHMAX];
 char STATS[PATHMAX];
@@ -397,6 +398,7 @@
 	strnncpy(DHPARAMS     , DEFAULT_DHPARAMS);
 	strnncpy(MIXRAND      , DEFAULT_MIXRAND);
 	strnncpy(SECRING      , DEFAULT_SECRING);
+	strnncpy(SECRINGNEW   , DEFAULT_SECRINGNEW);
 	strnncpy(PUBRING      , DEFAULT_PUBRING);
 	strnncpy(IDLOG        , DEFAULT_IDLOG);
 	strnncpy(STATS        , DEFAULT_STATS);
@@ -601,6 +603,7 @@
 	  read_conf(KEYFILE) || read_conf(PGPKEY) ||
 	  read_conf(DSAPARAMS) || read_conf(DHPARAMS) ||
 	  read_conf(MIXRAND) || read_conf(SECRING) ||
+	  read_conf(SECRINGNEW) ||
 	  read_conf(PUBRING) || read_conf(IDLOG) ||
 	  read_conf(STATS) || read_conf(DESTBLOCK) ||
 	  read_conf(PGPMAXCOUNT) ||

-- 
pub   1024D/228761E7 2003-06-04 Steven Crook <steve@mixmin.net>
      Key fingerprint = 1CD9 95E1 E9CE 80D6 C885  B7EB B471 80D5 2287 61E7
sub  4096R/BE3EFAA7  created: 2014-11-14  expires: 2016-11-13  usage: S
Technical Details
Message-ID: <slrnnqusfm.1iv.admin@fleegle.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <slrnnqusfm.1iv.admin@fleegle.mixmin.net>
Subject: Attn: Elvis - SECRINGNEW Patch
Date: Sat, 13 Aug 2016 19:16:06 +0000
From: Zax <admin@mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail
Newsgroups: alt.privacy.anon-server
Organization: Mixmin
Injection-Date: Sat, 13 Aug 2016 19:16:06 -0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="a24c8ad88825aa1ac75ec689c3f66a7e162d60a5";
User-Agent: slrn/pre1.0.3-10 (Linux)
Lines: 91