Re: Relicence explicit_bzero to GPL2+/LGPL3 dual

2020-04-11 Thread Bruno Haible
Paul, Can you agree to this license change (nearly equivalent to what Bastien asked for)? > diff --git a/modules/explicit_bzero b/modules/explicit_bzero > index 81d41d1..08fd3e4 100644 > --- a/modules/explicit_bzero > +++ b/modules/explicit_bzero > @@ -23,7 +23,7 @@ Include: > > > License:

Re: [PATCH 1/5] Use memset_s if possible for explicit_bzero

2020-04-11 Thread Bastien ROUCARIES
Ok, I will do that. On Sun, Apr 12, 2020 at 12:13 AM Bruno Haible wrote: > > Hello Bastien, > > Allow me a couple of comments, to make you more familiar with gnulib > coding conventions. > > > Some OS define memset_s instead of explicit_bzero. Use it. > > Indeed, FreeBSD 12 and Solaris 11.4

[V2][PATH 0/6] Explicit_bzero improvement

2020-04-11 Thread roucaries . bastien
This is the version 2 of explicit bzero [PATCH 1/6] Use memset_s if possible for explicit_bzero [PATCH 2/6] Use SecureZeroMemory on windows for explicit_bzero [PATCH 3/6] Support clang for explicit_bzero [PATCH 4/6] Implement fallback for explicit_bzero using jump to [PATCH 5/6] Improve styling

[PATCH 2/6] Use SecureZeroMemory on windows for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 2168a5285..489732791 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@

[PATCH 3/6] Support clang for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès According to https://bugs.llvm.org/show_bug.cgi?id=15495#c11 llvm need g type constraint Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 2/5] Use SecureZeroMemory on windows for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 7 +++ m4/explicit_bzero.m4 | 5 + 2 files changed, 12 insertions(+) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 862855421..b355f9bdf 100644 --- a/lib/explicit_bzero.c +++

[patch] Improve explicit_bzero

2020-04-11 Thread roucaries . bastien
Hi, I realease under LGPL2+ improvment of explicit_bzero module. Could you review please [PATCH 1/5] Use memset_s if possible for explicit_bzero [PATCH 2/5] Use SecureZeroMemory on windows for explicit_bzero [PATCH 3/5] Support clang for explicit_bzero [PATCH 4/5] Use volatile trick for

[PATCH 1/5] Use memset_s if possible for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Some OS define memset_s instead of explicit_bzero. Use it. Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 7 +++ m4/explicit_bzero.m4 | 5 + 2 files changed, 12 insertions(+) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 3/5] Support clang for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès According to https://bugs.llvm.org/show_bug.cgi?id=15495#c11 llvm need g type constraint Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/explicit_bzero.c

[PATCH 4/5] Use volatile trick for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Use a volatile pointer to memset function to avoid dead end optimization Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 5/5] Fix styling in explicit bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 59215852c..21f42292d 100644 --- a/lib/explicit_bzero.c +++ b/lib/explicit_bzero.c @@ -53,7

Re: [PATCH 3/5] Support clang for explicit_bzero

2020-04-11 Thread Bruno Haible
Hi Bastien, > diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c > index b355f9bdf..21bbd67e8 100644 > --- a/lib/explicit_bzero.c > +++ b/lib/explicit_bzero.c > @@ -56,9 +56,15 @@ explicit_bzero (void *s, size_t len) >(void) SecureZeroMemory(s,len); > #else >memset (s, '\0', len);

Re: Relicence explicit_bzero to GPL2+/LGPL3 dual

2020-04-11 Thread Paul Eggert
On 4/11/20 2:46 PM, Bruno Haible wrote: Paul, Can you agree to this license change (nearly equivalent to what Bastien asked for)? Yes, that's fine.

Re: [patch] Improve explicit_bzero

2020-04-11 Thread Bruno Haible
Hi Bastien, > [PATCH 1/5] Use memset_s if possible for explicit_bzero > [PATCH 2/5] Use SecureZeroMemory on windows for explicit_bzero > [PATCH 3/5] Support clang for explicit_bzero > [PATCH 4/5] Use volatile trick for explicit_bzero With the added complexity of this module, especially with the

[PATCH 1/6] Use memset_s if possible for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Some OS define memset_s instead of explicit_bzero. Use it. Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 7 +++ m4/explicit_bzero.m4 | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index

[PATCH 5/6] Improve styling in explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Use '\0' instead of 0 Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c index 09907..7eff7f2a7 100644 --- a/lib/explicit_bzero.c +++

[PATCH 6/6] Add test for explicit_bzero

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Simple test Signed-off-by: Bastien Roucariès --- tests/test-explicit_bzero.c | 34 ++ 1 file changed, 34 insertions(+) create mode 100644 tests/test-explicit_bzero.c diff --git a/tests/test-explicit_bzero.c

[PATCH 4/6] Implement fallback for explicit_bzero using jump to volatile pointer

2020-04-11 Thread roucaries . bastien
From: Bastien Roucariès Add some resistance against compiler optimization by doing pointer arithmetic with parameter of the function, therefore avoid dead branch optimization Signed-off-by: Bastien Roucariès --- lib/explicit_bzero.c | 56 ++-- 1 file

Re: [PATCH 2/5] Use SecureZeroMemory on windows for explicit_bzero

2020-04-11 Thread Bruno Haible
Hello Bastien, Same comments about preprocessor directive indentation, GNU style, and the autoconf/shell variables. > diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c > index 862855421..b355f9bdf 100644 > --- a/lib/explicit_bzero.c > +++ b/lib/explicit_bzero.c > @@ -32,6 +32,11 @@ > >

Re: Relicence explicit_bzero to GPL2+/LGPL3 dual

2020-04-11 Thread Bruno Haible
Paul Eggert wrote: > > Can you agree to this license change (nearly equivalent to what Bastien > > asked for)? > > Yes, that's fine. Thanks. I pushed the license change. Bruno

Re: [PATCH 5/5] Fix styling in explicit bzero

2020-04-11 Thread Bruno Haible
> diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c > index 59215852c..21f42292d 100644 > --- a/lib/explicit_bzero.c > +++ b/lib/explicit_bzero.c > @@ -53,7 +53,7 @@ void > explicit_bzero (void *s, size_t len) > { > #ifdef HAVE_EXPLICIT_MEMSET > - explicit_memset (s, 0, len); > +

Re: [PATCH 4/5] Use volatile trick for explicit_bzero

2020-04-11 Thread Bruno Haible
Hi Bastien, > diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c > index 21bbd67e8..59215852c 100644 > --- a/lib/explicit_bzero.c > +++ b/lib/explicit_bzero.c > @@ -43,6 +43,10 @@ > # undef explicit_bzero > #endif > > +#if !defined __GNUC__ > +static void * (* const volatile

Re: [PATCH 1/5] Use memset_s if possible for explicit_bzero

2020-04-11 Thread Bruno Haible
Hello Bastien, Allow me a couple of comments, to make you more familiar with gnulib coding conventions. > Some OS define memset_s instead of explicit_bzero. Use it. Indeed, FreeBSD 12 and Solaris 11.4 provide 'memset_s'. > --- a/lib/explicit_bzero.c > +++ b/lib/explicit_bzero.c > @@ -25,6