Skip to contentSkip to conversation

package/opensc: fix libressl build

PATCH Applied Fabrice Fontaine 2 participants 2 messages Nov 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/opensc: fix libressl build

Fix the following build failure with libressl >= 3.8 raised since bump of libressl to version 3.8.2 in commit 21eca49ed5110872407b76ab9337d2877c4cda24:

In file included from card-westcos.c:37:
/home/autobuild/autobuild/instance-11/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/openssl/evp.h:627:32: error: macro "EVP_sha3_224" passed 1 arguments, but takes just 0
627 | const EVP_MD *EVP_sha3_224(void);
| ^

Fixes:
- http://autobuild.buildroot.org/results/cecee659371f370bf4bd2b27a4752bf20ceff326

---
 ...L-does-provide-EVP_sha3_-after-3-7-3.patch | 32 +++++++++++++++++++
 ...ixed-detection-of-SHA3-compatibility.patch | 27 ++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 package/opensc/0005-LibreSSL-does-provide-EVP_sha3_-after-3-7-3.patch
 create mode 100644 package/opensc/0006-fixed-detection-of-SHA3-compatibility.patch
package/opensc/0005-LibreSSL-does-provide-EVP_sha3_-after-3-7-3.patch new file +32 -0
new file mode 100644
index 0000000000..80c19a3f5f
@@ -0,0 +1,32 @@
+From e015242590ad9131e124232cc5a2fd02d525ef2c Mon Sep 17 00:00:00 2001
+From: Klemens Nanni <[email protected]>
+Date: Thu, 29 Jun 2023 02:41:43 +0300
+Subject: [PATCH] LibreSSL does provide EVP_sha3_*() after 3.7.3
+
+Support was added in 16.04.2023.
+
+Compile- and run-tested on OpenBSD/amd64 7.3-current.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+Upstream: https://github.com/OpenSC/OpenSC/commit/e015242590ad9131e124232cc5a2fd02d525ef2c
+---
+ src/libopensc/sc-ossl-compat.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/libopensc/sc-ossl-compat.h b/src/libopensc/sc-ossl-compat.h
+index df0cebbce2..8012cd4c0f 100644
+--- a/src/libopensc/sc-ossl-compat.h
++++ b/src/libopensc/sc-ossl-compat.h
+@@ -50,10 +50,12 @@ extern "C" {
+ #if LIBRESSL_VERSION_NUMBER < 0x30500000L
+ #define FIPS_mode()                             (0)
+ #endif
++#ifndef EVP_sha3_224
+ #define EVP_sha3_224()                          (NULL)
+ #define EVP_sha3_256()                          (NULL)
+ #define EVP_sha3_384()                          (NULL)
+ #define EVP_sha3_512()                          (NULL)
++#endif
+ #if LIBRESSL_VERSION_NUMBER < 0x3070000fL
+ #define EVP_PKEY_new_raw_public_key(t, e, p, l) (NULL)
+ #define EVP_PKEY_get_raw_public_key(p, pu, l)   (0)
package/opensc/0006-fixed-detection-of-SHA3-compatibility.patch new file +27 -0
new file mode 100644
index 0000000000..3d8aa7e4ef
@@ -0,0 +1,27 @@
+From 33351d91aa22fa8077847ba3f19abb5a00b04600 Mon Sep 17 00:00:00 2001
+From: Frank Morgner <[email protected]>
+Date: Tue, 15 Aug 2023 17:58:21 +0200
+Subject: [PATCH] fixed detection of SHA3 compatibility
+
+fixes https://github.com/OpenSC/OpenSC/issues/2836
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+Upstream: https://github.com/OpenSC/OpenSC/commit/33351d91aa22fa8077847ba3f19abb5a00b04600
+---
+ src/libopensc/sc-ossl-compat.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/libopensc/sc-ossl-compat.h b/src/libopensc/sc-ossl-compat.h
+index 8012cd4c0f..96ec4bd736 100644
+--- a/src/libopensc/sc-ossl-compat.h
++++ b/src/libopensc/sc-ossl-compat.h
+@@ -50,7 +50,8 @@ extern "C" {
+ #if LIBRESSL_VERSION_NUMBER < 0x30500000L
+ #define FIPS_mode()                             (0)
+ #endif
+-#ifndef EVP_sha3_224
++/* OpenSSL 1.1.1 has EVP_sha3_* */
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30800000L
+ #define EVP_sha3_224()                          (NULL)
+ #define EVP_sha3_256()                          (NULL)
+ #define EVP_sha3_384()                          (NULL)
Signature · 6 lines
2.42.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Fabrice, All,

On 2023-11-26 18:45 +0100, Fabrice Fontaine spake thusly:

Quoted 9 lines

Fix the following build failure with libressl >= 3.8 raised since bump of libressl to version 3.8.2 in commit 21eca49ed5110872407b76ab9337d2877c4cda24:

In file included from card-westcos.c:37:
/home/autobuild/autobuild/instance-11/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/openssl/evp.h:627:32: error: macro "EVP_sha3_224" passed 1 arguments, but takes just 0
627 | const EVP_MD *EVP_sha3_224(void);
| ^

Quoted 4 lines

Fixes:
- http://autobuild.buildroot.org/results/cecee659371f370bf4bd2b27a4752bf20ceff326

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 85 lines
---
 ...L-does-provide-EVP_sha3_-after-3-7-3.patch | 32 +++++++++++++++++++
 ...ixed-detection-of-SHA3-compatibility.patch | 27 ++++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 package/opensc/0005-LibreSSL-does-provide-EVP_sha3_-after-3-7-3.patch
 create mode 100644 package/opensc/0006-fixed-detection-of-SHA3-compatibility.patch
package/opensc/0005-LibreSSL-does-provide-EVP_sha3_-after-3-7-3.patch new file +32 -0
new file mode 100644
index 0000000000..80c19a3f5f
@@ -0,0 +1,32 @@
+From e015242590ad9131e124232cc5a2fd02d525ef2c Mon Sep 17 00:00:00 2001
+From: Klemens Nanni <[email protected]>
+Date: Thu, 29 Jun 2023 02:41:43 +0300
+Subject: [PATCH] LibreSSL does provide EVP_sha3_*() after 3.7.3
+
+Support was added in 16.04.2023.
+
+Compile- and run-tested on OpenBSD/amd64 7.3-current.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+Upstream: https://github.com/OpenSC/OpenSC/commit/e015242590ad9131e124232cc5a2fd02d525ef2c
+---
+ src/libopensc/sc-ossl-compat.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/libopensc/sc-ossl-compat.h b/src/libopensc/sc-ossl-compat.h
+index df0cebbce2..8012cd4c0f 100644
+--- a/src/libopensc/sc-ossl-compat.h
++++ b/src/libopensc/sc-ossl-compat.h
+@@ -50,10 +50,12 @@ extern "C" {
+ #if LIBRESSL_VERSION_NUMBER < 0x30500000L
+ #define FIPS_mode()                             (0)
+ #endif
++#ifndef EVP_sha3_224
+ #define EVP_sha3_224()                          (NULL)
+ #define EVP_sha3_256()                          (NULL)
+ #define EVP_sha3_384()                          (NULL)
+ #define EVP_sha3_512()                          (NULL)
++#endif
+ #if LIBRESSL_VERSION_NUMBER < 0x3070000fL
+ #define EVP_PKEY_new_raw_public_key(t, e, p, l) (NULL)
+ #define EVP_PKEY_get_raw_public_key(p, pu, l)   (0)
package/opensc/0006-fixed-detection-of-SHA3-compatibility.patch new file +27 -0
new file mode 100644
index 0000000000..3d8aa7e4ef
@@ -0,0 +1,27 @@
+From 33351d91aa22fa8077847ba3f19abb5a00b04600 Mon Sep 17 00:00:00 2001
+From: Frank Morgner <[email protected]>
+Date: Tue, 15 Aug 2023 17:58:21 +0200
+Subject: [PATCH] fixed detection of SHA3 compatibility
+
+fixes https://github.com/OpenSC/OpenSC/issues/2836
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+Upstream: https://github.com/OpenSC/OpenSC/commit/33351d91aa22fa8077847ba3f19abb5a00b04600
+---
+ src/libopensc/sc-ossl-compat.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/libopensc/sc-ossl-compat.h b/src/libopensc/sc-ossl-compat.h
+index 8012cd4c0f..96ec4bd736 100644
+--- a/src/libopensc/sc-ossl-compat.h
++++ b/src/libopensc/sc-ossl-compat.h
+@@ -50,7 +50,8 @@ extern "C" {
+ #if LIBRESSL_VERSION_NUMBER < 0x30500000L
+ #define FIPS_mode()                             (0)
+ #endif
+-#ifndef EVP_sha3_224
++/* OpenSSL 1.1.1 has EVP_sha3_* */
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30800000L
+ #define EVP_sha3_224()                          (NULL)
+ #define EVP_sha3_256()                          (NULL)
+ #define EVP_sha3_384()                          (NULL)
Signature · 6 lines
2.42.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot