On Thu, Jun 18, 2020 at 02:08:20AM +0200, Klemens Nanni wrote:
> Fix the following, I can still split and combine secrets with it (as is
> expected):
>
> ===> Building for ssss-0.5p1
> cc -W -Wall -O2 -pipe -I/usr/local/include -L/usr/local/lib -lgmp -o
> ssss-split ssss.c
> ssss.c:174:33: warning: 'size' argument to memset is '0'; did you mean
> to transpose the last two arguments? [-Wmemset-transposed-args]
> memset(buf, degree / 8 + 1, 0);
> ^
> ssss.c:174:33: note: parenthesize the third argument to silence
>
> Comment patch while here.
> OK?
>
OK denis@
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/security/ssss/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- Makefile 12 Jul 2019 20:49:37 -0000 1.3
> +++ Makefile 18 Jun 2020 00:03:28 -0000
> @@ -3,7 +3,7 @@
> COMMENT= split secrets using Shamir's Secret Sharing Scheme
>
> DISTNAME= ssss-0.5
> -REVISION= 0
> +REVISION= 1
>
> CATEGORIES= security
>
> Index: patches/patch-Makefile
> ===================================================================
> RCS file: /cvs/ports/security/ssss/patches/patch-Makefile,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-Makefile
> --- patches/patch-Makefile 1 Oct 2018 11:39:44 -0000 1.1.1.1
> +++ patches/patch-Makefile 17 Jun 2020 23:56:28 -0000
> @@ -1,5 +1,7 @@
> $OpenBSD: patch-Makefile,v 1.1.1.1 2018/10/01 11:39:44 denis Exp $
>
> +Honour CFLAGS, do not strip during build.
> +
> Index: Makefile
> --- Makefile.orig
> +++ Makefile
> Index: patches/patch-ssss_c
> ===================================================================
> RCS file: patches/patch-ssss_c
> diff -N patches/patch-ssss_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-ssss_c 17 Jun 2020 23:54:58 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +Transpose memset(3) arguments, noted by clang.
> +
> +Index: ssss.c
> +--- ssss.c.orig
> ++++ ssss.c
> +@@ -171,7 +171,7 @@ void field_print(FILE* stream, const mpz_t x, int hexm
> + size_t t;
> + unsigned int i;
> + int printable, warn = 0;
> +- memset(buf, degree / 8 + 1, 0);
> ++ memset(buf, 0, degree / 8 + 1);
> + mpz_export(buf, &t, 1, 1, 0, 0, x);
> + for(i = 0; i < t; i++) {
> + printable = (buf[i] >= 32) && (buf[i] < 127);
>