summaryrefslogtreecommitdiff
path: root/news/slrn/patches
diff options
context:
space:
mode:
Diffstat (limited to 'news/slrn/patches')
-rw-r--r--news/slrn/patches/patch-changes.txt29
-rw-r--r--news/slrn/patches/patch-doc_manual.txt32
-rw-r--r--news/slrn/patches/patch-doc_slrn.rc28
-rw-r--r--news/slrn/patches/patch-po_Makefile.in.in (renamed from news/slrn/patches/patch-af)4
-rw-r--r--news/slrn/patches/patch-src_art.c60
-rw-r--r--news/slrn/patches/patch-src_misc.c15
-rw-r--r--news/slrn/patches/patch-src_misc.h14
-rw-r--r--news/slrn/patches/patch-src_post.c66
-rw-r--r--news/slrn/patches/patch-src_slrnfeat.hin2
-rw-r--r--news/slrn/patches/patch-src_startup.c17
-rw-r--r--news/slrn/patches/patch-src_version.c18
11 files changed, 282 insertions, 3 deletions
diff --git a/news/slrn/patches/patch-changes.txt b/news/slrn/patches/patch-changes.txt
new file mode 100644
index 00000000000..86fe12cdd40
--- /dev/null
+++ b/news/slrn/patches/patch-changes.txt
@@ -0,0 +1,29 @@
+$NetBSD: patch-changes.txt,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Changelog updated.
+
+--- changes.txt.orig 2016-10-23 22:34:16.000000000 +0000
++++ changes.txt
+@@ -1,4 +1,12 @@
+ -*- mode: text; mode: fold -*-
++
++Changes since 1.0.3
++1. Cancel-Locks now using API version 3 of the canlock library (--with-canlock).
++ The hash algorithm can be configured with the new variable "canlock_algo".
++ (Michael Baeuerle)
++
++{{{ Previous Versions
++
+ Changes since 1.0.2
+ 1. src/parse2822.c: A quoted-string in the display portion of an
+ address was not being marked as allowing mime-encoded text.
+@@ -30,9 +38,6 @@ Changes since 1.0.2
+ 15. Updates for mingw and cygwin 32 and 64 bit systems.
+ 16. src/mime.c: rfc1522_encode_word: max_nbytes was not being properly
+ limit checked.
+-
+-{{{ Previous Versions
+-
+ Changes since 1.0.1
+ 1. src/misc.c: slrn_verror needed va_copy when writing to the log file.
+ 2. src/post.c: Move the cursor to the end of the line when querying
diff --git a/news/slrn/patches/patch-doc_manual.txt b/news/slrn/patches/patch-doc_manual.txt
new file mode 100644
index 00000000000..2de763dacc5
--- /dev/null
+++ b/news/slrn/patches/patch-doc_manual.txt
@@ -0,0 +1,32 @@
+$NetBSD: patch-doc_manual.txt,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Added documentation for new config option "canlock_algo".
+
+--- doc/manual.txt.orig 2016-10-23 22:34:16.000000000 +0000
++++ doc/manual.txt
+@@ -63,6 +63,7 @@
+ 6.5 beep
+ 6.6 broken_xref
+ 6.7 cansecret_file
++ 6.7.1 canlock_algo
+ 6.8 cc_followup
+ 6.9 cc_post_string
+ 6.10 charset
+@@ -1652,6 +1653,17 @@
+ canlock) and that cancel locks only have an effect if the server
+ supports them.
+
++ 6.7.1. canlock_algo
++
++ Type: string
++ Default: "SHA256"
++
++ If slrn is configured to put cancel-locks into the articles you post,
++ then this variable is used to select the hash algorithm for <scheme>
++ and HMAC (used as recommended in Section 4 of RFC 8315).
++
++ The default value is the mandatory hash algorithm defined by RFC 8315.
++
+ 6.8. cc_followup
+
+ Type: integer
diff --git a/news/slrn/patches/patch-doc_slrn.rc b/news/slrn/patches/patch-doc_slrn.rc
new file mode 100644
index 00000000000..a9790a92f4b
--- /dev/null
+++ b/news/slrn/patches/patch-doc_slrn.rc
@@ -0,0 +1,28 @@
+$NetBSD: patch-doc_slrn.rc,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Example rc file extended with Cancel-Lock related options.
+
+--- doc/slrn.rc.orig 2016-10-23 22:34:16.000000000 +0000
++++ doc/slrn.rc
+@@ -540,3 +540,21 @@ setkey readline trim "<Esc>/" % Trim w
+ setkey readline quoted_insert "^Q" % Quoted insert
+ setkey readline complete "<Tab>" % Complete filename
+ setkey readline cycle " " % Cycle among filenames
++
++%
++%% Cancel-Lock related
++%
++
++% The Message-ID is required to calculate Cancel-Locks. One option is to enable
++% "generate_message_id" option above. "posting_host" can be set if your machine
++% has no FQDN.
++%posting_host "domain.example" % Domain under your control
++
++% File containing the secret. This file can be shared with other newsreaders
++% that use the recommended algorithm from Section 4 of RFC 8315.
++%set cansecret_file "/home/user/.cancelsecret"
++
++% Hash algorithm to use for <scheme> and HMAC according to RFC 8315.
++% Supported values: "SHA1", "SHA256", "SHA512".
++% If this option is not specified, "SHA256" is used as default.
++%set canlock_algo "SHA256"
diff --git a/news/slrn/patches/patch-af b/news/slrn/patches/patch-po_Makefile.in.in
index 2aba5fa768a..e924d2211a2 100644
--- a/news/slrn/patches/patch-af
+++ b/news/slrn/patches/patch-po_Makefile.in.in
@@ -1,10 +1,10 @@
-$NetBSD: patch-af,v 1.2 2014/08/23 09:34:48 obache Exp $
+$NetBSD: patch-po_Makefile.in.in,v 1.1 2018/09/21 14:27:37 wiz Exp $
Directly use INSTALL_DATA as ${mkdir_p}.
--- po/Makefile.in.in.orig 2008-02-11 19:04:23.000000000 +0100
+++ po/Makefile.in.in
-@@ -46,7 +46,7 @@ INSTALL_DATA = @INSTALL_DATA@
+@@ -47,7 +47,7 @@ INSTALL_DATA = @INSTALL_DATA@
# versions, $(mkinstalldirs) and $(install_sh) are unused.
#mkinstalldirs = $(SHELL) @install_sh@ -d
#install_sh = $(SHELL) @install_sh@
diff --git a/news/slrn/patches/patch-src_art.c b/news/slrn/patches/patch-src_art.c
new file mode 100644
index 00000000000..a3e977b5b18
--- /dev/null
+++ b/news/slrn/patches/patch-src_art.c
@@ -0,0 +1,60 @@
+$NetBSD: patch-src_art.c,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Switched <c-key> element generation to libcanlock API V3.
+
+--- src/art.c.orig 2016-10-23 22:34:16.000000000 +0000
++++ src/art.c
+@@ -74,7 +74,7 @@
+ #include "decode.h"
+
+ #if SLRN_HAS_CANLOCK
+-# include <canlock.h>
++# include <libcanlock-3/canlock.h>
+ #endif
+
+ #if SLRN_HAS_GROUPLENS
+@@ -3660,6 +3660,7 @@ static char* gen_cancel_key (char* msgid
+ char *buf, *cankey;
+ unsigned int filelen;
+ char canfile[SLRN_MAX_PATH_LEN];
++ cl_hash_version algo;
+
+ if (0 == *Slrn_User_Info.cancelsecret)
+ return NULL;
+@@ -3686,14 +3687,30 @@ static char* gen_cancel_key (char* msgid
+ }
+ (void) fseek (cansecret, 0, SEEK_SET);
+ (void) fread (buf, filelen, 1, cansecret);
++ (void) fclose (cansecret);
+
+-# if 0
+- cankey = md5_key (buf, filelen, msgid, strlen(msgid));
+-# else /* by default we use SHA-1 */
+- cankey = sha_key ((unsigned char *) buf, filelen, (unsigned char *)msgid, strlen(msgid));
+-# endif
++ /* Fixme: This check is used twice, should be moved to a central location */
++ if (0 == slrn_case_strcmp (Slrn_User_Info.canlock_algo, "SHA1"))
++ {
++ algo = CL_SHA1;
++ }
++ else if (0 == slrn_case_strcmp (Slrn_User_Info.canlock_algo, "SHA256"))
++ {
++ algo = CL_SHA256;
++ }
++ else if (0 == slrn_case_strcmp (Slrn_User_Info.canlock_algo, "SHA512"))
++ {
++ algo = CL_SHA512;
++ }
++ else
++ {
++ slrn_error (_("Cancel-Lock algorithm not supported: %s"), Slrn_User_Info.canlock_algo);
++ return NULL;
++ }
++ cankey = cl_get_key (algo, (unsigned char *) buf, filelen, (unsigned char *)msgid, strlen(msgid));
++ /* Try to overwrite secret in memory */
++ cl_clear_secret((void *) buf, filelen, filelen+1);
+
+- fclose (cansecret);
+ slrn_free (buf);
+ return cankey;
+ }
diff --git a/news/slrn/patches/patch-src_misc.c b/news/slrn/patches/patch-src_misc.c
new file mode 100644
index 00000000000..dad15dd6fab
--- /dev/null
+++ b/news/slrn/patches/patch-src_misc.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_misc.c,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Added default value for new config option "canlock_algo".
+
+--- src/misc.c.orig 2016-10-23 22:34:16.000000000 +0000
++++ src/misc.c
+@@ -2828,6 +2828,8 @@ void slrn_get_user_info (void) /*{{{*/
+
+ #if SLRN_HAS_CANLOCK
+ Slrn_User_Info.cancelsecret = slrn_safe_strmalloc ("");
++ /* SHA256 ist the mandatory algorithm defined by RFC 8315 */
++ Slrn_User_Info.canlock_algo = slrn_safe_strmalloc ("SHA256");
+ #endif
+ #ifdef SLRN_SENDMAIL_COMMAND
+ Slrn_SendMail_Command = slrn_safe_strmalloc (SLRN_SENDMAIL_COMMAND);
diff --git a/news/slrn/patches/patch-src_misc.h b/news/slrn/patches/patch-src_misc.h
new file mode 100644
index 00000000000..12262c5db13
--- /dev/null
+++ b/news/slrn/patches/patch-src_misc.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_misc.h,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Added config structure element for Cancel-Lock hash algorithm.
+
+--- src/misc.h.orig 2016-10-23 22:34:16.000000000 +0000
++++ src/misc.h
+@@ -80,6 +80,7 @@ typedef struct
+ char *signature;
+ #if SLRN_HAS_CANLOCK
+ char *cancelsecret;
++ char *canlock_algo;
+ #endif
+ char *posting_host; /* FQDN or NULL */
+ char *login_name;
diff --git a/news/slrn/patches/patch-src_post.c b/news/slrn/patches/patch-src_post.c
new file mode 100644
index 00000000000..29eb742259f
--- /dev/null
+++ b/news/slrn/patches/patch-src_post.c
@@ -0,0 +1,66 @@
+$NetBSD: patch-src_post.c,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Switched <c-lock> element generation to libcanlock API V3.
+
+--- src/post.c.orig 2016-10-23 22:34:16.000000000 +0000
++++ src/post.c
+@@ -50,7 +50,7 @@
+ #endif
+
+ #if SLRN_HAS_CANLOCK
+-# include <canlock.h>
++# include <libcanlock-3/canlock.h>
+ #endif
+
+ #include "slrn.h"
+@@ -821,7 +821,7 @@ static int prepare_header (VFILE *vp, un
+
+ if ((NULL == (tmp = slrn_gen_date_header ()))
+ || (NULL == slrn_append_to_header (a, tmp, 1))
+- || (NULL == (tmp = slrn_strdup_printf("User-Agent: slrn/%s (%s)", Slrn_Version_String, system_os_name)))
++ || (NULL == (tmp = slrn_strdup_printf("User-Agent: slrn/%s (Patched for libcanlock3) (%s)", Slrn_Version_String, system_os_name)))
+ || (NULL == slrn_append_to_header (a, tmp, 1))
+ || (NULL == slrn_append_to_header (a, NULL,0))) /* separator */
+ {
+@@ -1297,6 +1297,7 @@ static char *gen_cancel_lock (char *msgi
+ char *buf, *canlock;
+ unsigned int filelen;
+ char canfile[SLRN_MAX_PATH_LEN];
++ cl_hash_version algo;
+
+ cansecret = slrn_open_home_file (file, "r", canfile, SLRN_MAX_PATH_LEN, 0);
+ if (cansecret == NULL)
+@@ -1323,11 +1324,28 @@ static char *gen_cancel_lock (char *msgi
+ (void) fread (buf, filelen, 1, cansecret);
+ (void) fclose(cansecret);
+
+-# if 0
+- canlock = md5_lock(buf, filelen, msgid, strlen(msgid));
+-# else /* by default we use SHA-1 */
+- canlock = sha_lock ((unsigned char *) buf, filelen, (unsigned char *)msgid, strlen(msgid));
+-# endif
++ /* Fixme: This check is used twice, should be moved to a central location */
++ if (0 == slrn_case_strcmp (Slrn_User_Info.canlock_algo, "SHA1"))
++ {
++ algo = CL_SHA1;
++ }
++ else if (0 == slrn_case_strcmp (Slrn_User_Info.canlock_algo, "SHA256"))
++ {
++ algo = CL_SHA256;
++ }
++ else if (0 == slrn_case_strcmp (Slrn_User_Info.canlock_algo, "SHA512"))
++ {
++ algo = CL_SHA512;
++ }
++ else
++ {
++ slrn_error (_("Cancel-Lock algorithm not supported: %s"), Slrn_User_Info.canlock_algo);
++ return NULL;
++ }
++ canlock = cl_get_lock (algo, (unsigned char *) buf, filelen, (unsigned char *)msgid, strlen(msgid));
++ /* Try to overwrite secret in memory */
++ cl_clear_secret((void *) buf, filelen, filelen+1);
++
+ slrn_free (buf);
+ return canlock;
+ }
diff --git a/news/slrn/patches/patch-src_slrnfeat.hin b/news/slrn/patches/patch-src_slrnfeat.hin
index 3dceb450928..f108c2d442f 100644
--- a/news/slrn/patches/patch-src_slrnfeat.hin
+++ b/news/slrn/patches/patch-src_slrnfeat.hin
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_slrnfeat.hin,v 1.2 2014/08/23 09:34:48 obache Exp $
+$NetBSD: patch-src_slrnfeat.hin,v 1.3 2018/09/21 14:27:37 wiz Exp $
Fix compiled-in default path to sendmail; it should be /usr/sbin/sendmail
on essentially all even halfway modern systems.
diff --git a/news/slrn/patches/patch-src_startup.c b/news/slrn/patches/patch-src_startup.c
new file mode 100644
index 00000000000..cfba0e44094
--- /dev/null
+++ b/news/slrn/patches/patch-src_startup.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_startup.c,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Added variable for Cancel-Lock hash algorithm.
+
+--- src/startup.c.orig 2016-10-23 22:34:16.000000000 +0000
++++ src/startup.c
+@@ -731,8 +731,10 @@ Slrn_Str_Var_Type Slrn_Str_Variables []
+ #endif
+ #if SLRN_HAS_CANLOCK
+ {"cansecret_file", &Slrn_User_Info.cancelsecret, NULL},
++ {"canlock_algo", &Slrn_User_Info.canlock_algo, NULL},
+ #else
+ {"cansecret_file", NULL, NULL},
++ {"canlock_algo", NULL, NULL},
+ #endif
+ {"art_help_line", &Slrn_Art_Help_Line, NULL},
+ {"art_status_line", &Slrn_Art_Status_Line, NULL},
diff --git a/news/slrn/patches/patch-src_version.c b/news/slrn/patches/patch-src_version.c
new file mode 100644
index 00000000000..4535bc46efc
--- /dev/null
+++ b/news/slrn/patches/patch-src_version.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_version.c,v 1.1 2018/09/21 14:27:37 wiz Exp $
+
+Added notes that this is a modified version.
+
+--- src/version.c.orig 2016-10-23 22:34:16.000000000 +0000
++++ src/version.c
+@@ -132,6 +132,11 @@ void slrn_show_version (FILE *fp) /*{{{*
+ fprintf (fp, "slrn %s\n", Slrn_Version_String);
+ if (*Slrn_Version_String == 'p')
+ fprintf (fp, _("\t* Note: This version is a developer preview.\n"));
++
++ /* To be removed if patch is accepted upstream */
++ fprintf (fp, _("\t* Note: This is a modified version! (do not bother the author with questions)\n"));
++ fprintf (fp, _("\t* Patched to support libcanlock3 (see documentation)\n"));
++
+ fprintf (fp, _("S-Lang Library Version: %s\n"), SLang_Version_String);
+ if (SLANG_VERSION != SLang_Version)
+ {