Skip to contentSkip to conversation

package/libxcrypt: fix conversion error

Buildroot guillaume.bressaix at gmail.com 2 participants 4 messages Feb 20, 2021 – Feb 21, 2021 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

From: "Guillaume W. Bres" <[email protected]>

Some sensitive compilers may raise a warning that turns into an error on this line.

Patch submitted to mainline, waiting for approval, see:
https://github.com/besser82/libxcrypt/pull/119

---
 ...gost3411-core.c-fix-conversion-error.patch | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch
package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch new file +26 -0
new file mode 100644
index 0000000000..5488d15a3d
@@ -0,0 +1,26 @@
+From c7bf2cf8e610bb26bece7f3a2bc5b47d7c659c7d Mon Sep 17 00:00:00 2001
+From: "Guillaume W. Bres" <[email protected]>
+Date: Sat, 20 Feb 2021 16:51:04 +0100
+Subject: [PATCH] lib/alg-gost3411-core.c: fix conversion error
+
+Signed-off-by: Guillaume W. Bres <[email protected]>
+---
+ lib/alg-gost3411-2012-core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/alg-gost3411-2012-core.c b/lib/alg-gost3411-2012-core.c
+index 13bb493..af3a36e 100644
+--- a/lib/alg-gost3411-2012-core.c
++++ b/lib/alg-gost3411-2012-core.c
+@@ -92,7 +92,7 @@ add512(const uint512_u *x, const uint512_u *y, uint512_u *r)
+     for (i = 0; i < 64; i++)
+     {
+         buf = xp[i] + yp[i] + (buf >> 8);
+-        rp[i] = (unsigned char) buf & 0xFF;
++        rp[i] = (unsigned char) (buf & 0xFF);
+     }
+ #endif
+ }
+--
+2.20.1
+
Signature · 1 line
2.20.1
#1 lore raw

Guillaume, All,

On 2021-02-20 17:29 +0100, guillaume.bressaix at gmail.com spake thusly:

Quoted 5 lines

From: "Guillaume W. Bres" <[email protected]>

Some sensitive compilers may raise a warning that turns into an error on this line.

We usually do not like much that -Werror is used unconditionally, because newer compiler will inevitably add new warnings that were unknown at the time the code is written.

Fortunately, libxcrypt has an option to disable it: --disable-werror

Care to send a patch to use it?

Quoted 2 lines

Patch submitted to mainline, waiting for approval, see:
https://github.com/besser82/libxcrypt/pull/119

As for all things crypto, I'll be waiting for upstream to report, or for someone more knowledgeable than I to assess this change (I think it is OK, but the Debian fix in openssl taught me to be warry of fixes that look OK ;-] )

Thanks, I'm keeping a tab on this one for a few more days...

Regards,
Yann E. MORIN.

Quoted 45 lines
---
 ...gost3411-core.c-fix-conversion-error.patch | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch
package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch new file +26 -0
new file mode 100644
index 0000000000..5488d15a3d
@@ -0,0 +1,26 @@
+From c7bf2cf8e610bb26bece7f3a2bc5b47d7c659c7d Mon Sep 17 00:00:00 2001
+From: "Guillaume W. Bres" <[email protected]>
+Date: Sat, 20 Feb 2021 16:51:04 +0100
+Subject: [PATCH] lib/alg-gost3411-core.c: fix conversion error
+
+Signed-off-by: Guillaume W. Bres <[email protected]>
+---
+ lib/alg-gost3411-2012-core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/alg-gost3411-2012-core.c b/lib/alg-gost3411-2012-core.c
+index 13bb493..af3a36e 100644
+--- a/lib/alg-gost3411-2012-core.c
++++ b/lib/alg-gost3411-2012-core.c
+@@ -92,7 +92,7 @@ add512(const uint512_u *x, const uint512_u *y, uint512_u *r)
+     for (i = 0; i < 64; i++)
+     {
+         buf = xp[i] + yp[i] + (buf >> 8);
+-        rp[i] = (unsigned char) buf & 0xFF;
++        rp[i] = (unsigned char) (buf & 0xFF);
+     }
+ #endif
+ }
+--
+2.20.1
+
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

A message that is not in the archive (sent off-list or not yet received): CAJe0E3cteL=MS4=Zauzu9yJJ2xCOt=ymxEmDzRtQbfO6yEdqiA@mail.gmail.com

#3 lore raw

Yann,

Quoted 1 line

Fortunately, libxcrypt has an option to disable it: --disable-werror

I confirm that it works, thank you, I did not know of this feature

Quoted 1 line

Care to send a patch to use it?

I just did, also, thanks for merging my other patch (*staging*)

a+
Guillaume W. Bres
Software engineer
<[email protected]>

Le sam. 20 f?vr. 2021 ? 18:17, Yann E. MORIN <[email protected]> a ?crit :

Quoted 95 lines

Guillaume, All,

On 2021-02-20 17:29 +0100, guillaume.bressaix at gmail.com spake thusly:

Quoted 3 lines

From: "Guillaume W. Bres" <[email protected]>

Fixes:

http://autobuild.buildroot.net/results/e9a058a8c98daf197cd9d7ac632e0cb5707d524f

Quoted 2 lines

Some sensitive compilers may raise a warning that turns into an error on

this line.

We usually do not like much that -Werror is used unconditionally, because newer compiler will inevitably add new warnings that were unknown at the time the code is written.

Fortunately, libxcrypt has an option to disable it: --disable-werror

Care to send a patch to use it?

Quoted 2 lines

Patch submitted to mainline, waiting for approval, see:
https://github.com/besser82/libxcrypt/pull/119

As for all things crypto, I'll be waiting for upstream to report, or for someone more knowledgeable than I to assess this change (I think it is OK, but the Debian fix in openssl taught me to be warry of fixes that look OK ;-] )

Thanks, I'm keeping a tab on this one for a few more days...

Regards,
Yann E. MORIN.

Quoted 5 lines
---
 ...gost3411-core.c-fix-conversion-error.patch | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644

package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch

Quoted 2 lines

diff --git

a/package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch b/package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch

Quoted 4 lines

new file mode 100644
index 0000000000..5488d15a3d
--- /dev/null
+++

b/package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch

Quoted 6 lines
package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch new file +5 -0
@@ -0,0 +1,26 @@
+From c7bf2cf8e610bb26bece7f3a2bc5b47d7c659c7d Mon Sep 17 00:00:00 2001
+From: "Guillaume W. Bres" <[email protected]>
+Date: Sat, 20 Feb 2021 16:51:04 +0100
+Subject: [PATCH] lib/alg-gost3411-core.c: fix conversion error
+

package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch line 15

Quoted 10 lines
package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch new file +10 -0
+Signed-off-by: Guillaume W. Bres <[email protected]>
+---
+ lib/alg-gost3411-2012-core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/alg-gost3411-2012-core.c b/lib/alg-gost3411-2012-core.c
+index 13bb493..af3a36e 100644
+--- a/lib/alg-gost3411-2012-core.c
++++ b/lib/alg-gost3411-2012-core.c
+@@ -92,7 +92,7 @@ add512(const uint512_u *x, const uint512_u *y,

uint512_u *r)

Quoted 14 lines
package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch new file +11 -1
+     for (i = 0; i < 64; i++)
+     {
+         buf = xp[i] + yp[i] + (buf >> 8);
+-        rp[i] = (unsigned char) buf & 0xFF;
++        rp[i] = (unsigned char) (buf & 0xFF);
+     }
+ #endif
+ }
+--
+2.20.1
+
--

2.20.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--

.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
     |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
 conspiracy.  |
Quoted 2 lines

'------------------------------^-------^------------------^--------------------'

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210220/a92a9caf/attachment.html>

#4 lore raw
In reply to guillaume.bressaix at gmail.com

Guillaume, All,

On 2021-02-20 17:29 +0100, guillaume.bressaix at gmail.com spake thusly:

Quoted 10 lines

From: "Guillaume W. Bres" <[email protected]>

Some sensitive compilers may raise a warning that turns into an error on this line.

Patch submitted to mainline, waiting for approval, see:
https://github.com/besser82/libxcrypt/pull/119

Upstream has now applied it, so: applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 44 lines
---
 ...gost3411-core.c-fix-conversion-error.patch | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch
package/libxcrypt/0001-lib-alg-gost3411-core.c-fix-conversion-error.patch new file +26 -0
new file mode 100644
index 0000000000..5488d15a3d
@@ -0,0 +1,26 @@
+From c7bf2cf8e610bb26bece7f3a2bc5b47d7c659c7d Mon Sep 17 00:00:00 2001
+From: "Guillaume W. Bres" <[email protected]>
+Date: Sat, 20 Feb 2021 16:51:04 +0100
+Subject: [PATCH] lib/alg-gost3411-core.c: fix conversion error
+
+Signed-off-by: Guillaume W. Bres <[email protected]>
+---
+ lib/alg-gost3411-2012-core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/alg-gost3411-2012-core.c b/lib/alg-gost3411-2012-core.c
+index 13bb493..af3a36e 100644
+--- a/lib/alg-gost3411-2012-core.c
++++ b/lib/alg-gost3411-2012-core.c
+@@ -92,7 +92,7 @@ add512(const uint512_u *x, const uint512_u *y, uint512_u *r)
+     for (i = 0; i < 64; i++)
+     {
+         buf = xp[i] + yp[i] + (buf >> 8);
+-        rp[i] = (unsigned char) buf & 0xFF;
++        rp[i] = (unsigned char) (buf & 0xFF);
+     }
+ #endif
+ }
+--
+2.20.1
+
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'