Skip to contentSkip to conversation

meson.build: re-add explicit gcrypt/nettle request check

PATCH Superseded Luc Michel 3 participants 3 messages Jul 10 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Luc Michel

author
#0 lore raw

PATCH 1/1 meson.build: re-add explicit gcrypt/nettle request check

c4b3d0074 removed the check that nettle or gcrypt were explicitly requested as the crypto library to use, breaking the --enable-nettle and --enable-gcrypt options. Re-add the check.

Fixes c4b3d0074 (crypto: bump min gnutls to 3.7.5)
---
 meson.build | 5 +++++
 1 file changed, 5 insertions(+)
meson.build +5 -0
index 164328ded83..475c5922030 100644
@@ -1809,10 +1809,15 @@ crypto_sm3 = not_found
 
 if get_option('nettle').enabled() and get_option('gcrypt').enabled()
   error('Only one of gcrypt & nettle can be enabled')
 endif
 
+# Explicit nettle/gcrypt request, so ignore gnutls for crypto
+if get_option('nettle').enabled() or get_option('gcrypt').enabled()
+  gnutls = not_found
+endif
+
 if not gnutls.found()
   if (not get_option('gcrypt').auto() or have_system) and not get_option('nettle').enabled()
     gcrypt = dependency('libgcrypt', version: '>=1.9.4',
                         required: get_option('gcrypt'))
     # Debian has removed -lgpg-error from libgcrypt-config
Signature · 1 line
2.53.0
#2 lore raw
In reply to Luc Michel
Quoted 16 lines · Luc Michel

c4b3d0074 removed the check that nettle or gcrypt were explicitly requested as the crypto library to use, breaking the --enable-nettle and --enable-gcrypt options. Re-add the check.

Fixes c4b3d0074 (crypto: bump min gnutls to 3.7.5)
---
 meson.build | 5 +++++
 1 file changed, 5 insertions(+)
meson.build +0 -0
index 164328ded83..475c5922030 100644
@@ -1809,10 +1809,15 @@ crypto_sm3 = not_found
 

meson.build crypto_sm3 = not_found · line 1819

Quoted 10 lines
meson.build +5 -0
 if get_option('nettle').enabled() and get_option('gcrypt').enabled()
   error('Only one of gcrypt & nettle can be enabled')
 endif
 
+# Explicit nettle/gcrypt request, so ignore gnutls for crypto
+if get_option('nettle').enabled() or get_option('gcrypt').enabled()
+  gnutls = not_found
+endif
+
 if not gnutls.found()

This is not sufficient - if --enable-nettle is given this logic will fully disable all use of gnutls. We need to retain the use of nettle for TLS APIs, but exclude it for crypto APIs.

IOW, we need to revert more of c4b3d0074 - can you also bring back the lines that set the 'gnutls_crypto' variable, so we can disable gnutls for crypto only, not TLS>

Quoted 7 lines
meson.build +0 -0
   if (not get_option('gcrypt').auto() or have_system) and not get_option('nettle').enabled()
     gcrypt = dependency('libgcrypt', version: '>=1.9.4',
                         required: get_option('gcrypt'))
     # Debian has removed -lgpg-error from libgcrypt-config
Signature · 1 line
2.53.0

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|