After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755319 - configure: add --with-hls-crypto=auto|nettle|libgcrypt|openssl option
configure: add --with-hls-crypto=auto|nettle|libgcrypt|openssl option
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2015-09-20 18:23 UTC by Julian Bouzas
Modified: 2015-11-06 11:13 UTC
See Also:
GNOME target: ---
GNOME version: ---

Patch that adds --with-crypto=auto|nettle|libgcrypt|openssl option (2.41 KB, patch)
2015-09-20 18:23 UTC, Julian Bouzas
none Details | Review
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt option (2.30 KB, patch)
2015-09-20 20:54 UTC, Julian Bouzas
none Details | Review
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt|openssl option (2.48 KB, patch)
2015-11-04 17:59 UTC, Julian Bouzas
none Details | Review
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt|openssl option (2.68 KB, patch)
2015-11-04 23:30 UTC, Julian Bouzas
none Details | Review
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt|openssl option (2.80 KB, patch)
2015-11-05 11:28 UTC, Julian Bouzas
committed Details | Review

Description Julian Bouzas 2015-09-20 18:23:23 UTC
Created attachment 311717 [details] [review]
Patch that adds --with-crypto=auto|nettle|libgcrypt|openssl option

This patch adds a --with-crypto=auto|nettle|libgcrypt|openssl option in

At the moment, it is not possible to build the source using libgcrypt or openssl if the host machine has nettle library installed as it is picked up automatically. This option allows the user to select what cryptographic library the source will be compiled against.

For any questions, please feel free to contact me.

Julian Bouzas
<> <>
Comment 1 Sebastian Dröge (slomo) 2015-09-20 18:32:17 UTC
I don't think this patch makes sense as is. ext/dtls can currently *only* work with openssl (port to optionally use gnutls pending). ext/hls can work with nettle or libgcrypt, but not openssl.
Comment 2 Julian Bouzas 2015-09-20 20:54:53 UTC
Created attachment 311722 [details] [review]
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt option

This patch adds a --with-hls-crypto=auto|nettle|libgcrypt option in
Comment 3 Julian Bouzas 2015-09-20 20:56:39 UTC

Sorry, I thought ext/hls would also work with openssl as the code shows it is used if nettle and libgcrypt are not found.

Anyways, since openssl is not used for ext/hls, it would be nice to have an option to build hls from source using either nettle or libgcrypt. Something like that:


I have updated another patch just with that option.
Comment 4 Sebastian Dröge (slomo) 2015-09-21 08:23:15 UTC
Sorry my fault, hlsdemux indeed has openssl support. But having this configure option called --with-hls-crypto definitely makes more sense.
Comment 5 Julian Bouzas 2015-11-04 17:59:45 UTC
Created attachment 314847 [details] [review]
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt|openssl option


Sorry for the delay. Since hlsdemux has support for openssl, I have updated the patch to also accept openssl as a valid value:


Will that be merged into master?
Comment 6 Sebastian Dröge (slomo) 2015-11-04 21:29:12 UTC
Comment on attachment 314847 [details] [review]
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt|openssl option

Thanks for the new patch. Instead of AS_IF this should probably be an AS_CASE? The runaway indentation is a bit ugly :)

Also if you have suggestions how we can not duplicate each check for the auto case that would be great
Comment 7 Julian Bouzas 2015-11-04 23:30:21 UTC
Created attachment 314861 [details] [review]
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt|openssl option

Hi Sebastian,

Thanks for your review. I totally agree that the indentation looks ugly with so many AS_IF, but unfortunately, the logic is quite complex in that particular case. I Added an AS_CASE as you suggested and it definitely looks better.

I also tried to remove duplicate checks by doing something like:

    if ( with_hls_crypto=="nettle" || (with_hls_crypto=="auto" && PKG_CHECK_MODULES("nettle")) ) {
    } else if...

but, as far as I can tell, I think it is not possible to *compose* an AS_IF with a PKG_CHECK_MODULES together. To be honest, I am not really familiar with M4 and there is not much documentation out there :(
Comment 8 Sebastian Dröge (slomo) 2015-11-05 08:29:14 UTC
Review of attachment 314861 [details] [review]:

@@ +3042,3 @@
+    which cryptographic library version to compile against for hls (default: auto)
+  ]),
+    [case "$with_hls_crypto" in

You could use AS_CASE here too

@@ +3060,3 @@
+    [nettle], [
+      AC_DEFINE(HAVE_NETTLE, 1, [Define if nettle is available])
+      HAVE_HLS="yes"

Each of these cases should also check for the actual availability of the corresponding library, and if it does not exist error out.

I don't see a way either to not have the checks twice (here and then again for the auto case), so let's just go with that for now.
Comment 9 Julian Bouzas 2015-11-05 11:28:07 UTC
Created attachment 314904 [details] [review]
Patch that adds --with-hls-crypto=auto|nettle|libgcrypt|openssl option

OK, Here is a updated version of the patch with error checks and AS_CASE macro for the first case statement.

Let me know if it looks OK or you want me to add/change more things.
Comment 10 Sebastian Dröge (slomo) 2015-11-06 11:13:58 UTC
commit 44a5fbe8e0fa70747c7d191828d4822f82cea38a
Author: Julian Bouzas <>
Date:   Thu Nov 5 10:12:41 2015 +0000 Added --with-hls-crypto=auto|nettle|libgcrypt|openssl option to build the source using the desired cryptographic library for HLS