Skip to contentSkip to conversation

package/asterisk: fix build caused by libjwt bump

PATCH In review Bernd Kuhls 2 participants 4 messages Oct 3, 2025 – Oct 10, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/asterisk: fix build caused by libjwt bump

From: Thomas Petazzoni <[email protected]>

In commit 770f9154978c40ce5b7718174108b37c5310869d, libjwt was bumped from 1.17.2 to 3.2.0, which is a big bump. And the libjwt website states "Version 3 of LibJWT is a complete overhaul of the code. Please see documentation for usage."

And indeed, this version bump breaks the build of Asterisk:

res_stir_shaken/attestation.c: In function 'pack_payload':
res_stir_shaken/attestation.c:357:9: error: implicit declaration of function 'jwt_add_grants_json' [-Wimplicit-function-declaration]

  357 |         jwt_add_grants_json(jwt, payload_str);
      |         ^~~~~~~~~~~~~~~~~~~

In file included from /home/autobuild/autobuild/instance-11/output-1/build/asterisk-22.3.0/include/asterisk/module.h:39,
from res_stir_shaken/attestation.c:24:
res_stir_shaken/attestation.c: In function '_dtor_jwt':
res_stir_shaken/attestation.c:367:38: error: implicit declaration of function 'jwt_free'; did you mean 'jwks_free'? [-Wimplicit-function-declaration]
367 | RAII_VAR(jwt_t *, jwt, NULL, jwt_free);
| ^~~~~~~~

To fix this, let's use the bundled version of libjwt in Asterisk, since even Asterisk master hasn't been fixed to be compatible with libjwt 3.x.

Of course, this raises the question of whether the separate libjwt package should be removed, as it is anyway only used by Asterisk.

Fixes:

http://autobuild.buildroot.net/results/2d39791c65c5b71b0533d4b2bce5f073f5919552/

---
 package/asterisk/Config.in     | 1 -
 package/asterisk/asterisk.hash | 2 ++
 package/asterisk/asterisk.mk   | 7 ++++---
 3 files changed, 6 insertions(+), 4 deletions(-)
package/asterisk/Config.in +0 -1
index 71c741acfd..c7101d70f4 100644
@@ -10,7 +10,6 @@ config BR2_PACKAGE_ASTERISK
 	select BR2_PACKAGE_LIBCURL
 	select BR2_PACKAGE_LIBEDIT
 	select BR2_PACKAGE_LIBILBC
-	select BR2_PACKAGE_LIBJWT
 	select BR2_PACKAGE_LIBPJSIP
 	select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
 	select BR2_PACKAGE_LIBXML2
package/asterisk/asterisk.hash +2 -0
index 7b28624921..f11ed08ef4 100644
@@ -3,6 +3,8 @@ sha256  4cc403c8885d4aed3956dfb75d315d3e5bcc129eb9cd47c156d3b12ecceed1ba  asteri
 
 # Locally computed
 sha256  58bb83cec4d431f48d006e455d821668450f8cf6b6c95f090def47062fa3a60c  pjproject-2.15.1.tar.bz2
+sha256  6775095bcd417d375faddc1f17cdd7706ad8aa9b9b02404990c4b0ee218ee379  libjwt-1.15.3.tar.gz
+
 # sha1 from: http://downloads.asterisk.org/pub/telephony/sounds/releases
 # sha256 locally computed
 sha1  721c512feaea102700d5bdce952fdc0bb29dc640  asterisk-core-sounds-en-gsm-1.6.1.tar.gz
package/asterisk/asterisk.mk +4 -3
index 18af217129..e7e802aa45 100644
@@ -13,11 +13,13 @@ ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))
 # segfaults. The reason behind this is unclear.
 # https://github.com/asterisk/asterisk/issues/671
 ASTERISK_PJSIP_URL = https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/2.15.1/
+ASTERISK_LIBJWT_URL = https://raw.githubusercontent.com/asterisk/third-party/master/libjwt/1.15.3/
 ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases
 ASTERISK_EXTRA_DOWNLOADS = \
 	$(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.6.1.tar.gz \
 	$(ASTERISK_SOUNDS_BASE_URL)/asterisk-moh-opsound-wav-2.03.tar.gz \
-	$(ASTERISK_PJSIP_URL)/pjproject-2.15.1.tar.bz2
+	$(ASTERISK_PJSIP_URL)/pjproject-2.15.1.tar.bz2 \
+	$(ASTERISK_LIBJWT_URL)/libjwt-1.15.3.tar.gz
 
 ASTERISK_LICENSE = GPL-2.0, BSD-3-Clause (SHA1, resample), BSD-4-Clause (db1-ast)
 ASTERISK_LICENSE_FILES = \
@@ -39,7 +41,6 @@ ASTERISK_DEPENDENCIES = \
 	jansson \
 	libcurl \
 	libedit \
-	libjwt \
 	libpjsip \
 	libxml2 \
 	sqlite \
@@ -94,7 +95,7 @@ ASTERISK_CONF_OPTS = \
 	--with-jansson \
 	--with-libcurl \
 	--with-ilbc \
-	--with-libjwt="$(STAGING_DIR)/usr" \
+	--with-libjwt-bundled \
 	--with-libxml2 \
 	--with-libedit="$(STAGING_DIR)/usr" \
 	--with-pjproject-bundled \
Signature · 6 lines
2.47.3

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

PATCH 2/3 package/libjwt: remove package

In commit 770f9154978c40ce5b7718174108b37c5310869d, libjwt was bumped from 1.17.2 to 3.2.0, which is a big bump. And the libjwt website states "Version 3 of LibJWT is a complete overhaul of the code. Please see documentation for usage."

And indeed, this version bump breaks the build of Asterisk. Therefore asterisk uses its bundled version of libjwt now and this package can be removed as no other package depends on it.

---
Waldemar agreed to remove the libjwt package:
https://patchwork.ozlabs.org/comment/3570243/

 Config.in.legacy           |  8 ++++++++
 DEVELOPERS                 |  1 -
 package/Config.in          |  1 -
 package/libjwt/Config.in   | 10 ----------
 package/libjwt/libjwt.hash |  3 ---
 package/libjwt/libjwt.mk   | 19 -------------------
 6 files changed, 8 insertions(+), 34 deletions(-)
 delete mode 100644 package/libjwt/Config.in
 delete mode 100644 package/libjwt/libjwt.hash
 delete mode 100644 package/libjwt/libjwt.mk
Config.in.legacy +8 -0
index 277d2b8b2a..adbcf0eaa3 100644
@@ -146,6 +146,14 @@ endif
 
 comment "Legacy options removed in 2025.11"
 
+config BR2_PACKAGE_LIBJWT
+	bool "libjwt has been removed"
+	select BR2_LEGACY
+	help
+	  The only dependee of libjwt, asterisk, is incompatible with
+	  version 3 so the version bundled with asterisk is used and
+	  this package can be removed.
+
 config BR2_TARGET_ROOTFS_AXFS
 	bool "AXFS root filesystem has been removed"
 	select BR2_LEGACY
DEVELOPERS +0 -1
index 3e8bfd69d6..c2c867263a 100644
@@ -3401,7 +3401,6 @@ F:	configs/stm32f746_disco_sd_defconfig
 F:	package/asterisk/
 F:	package/evilwm/
 F:	package/fbv/
-F:	package/libjwt/
 F:	package/mksh/
 F:	package/ruby/
 F:	package/uclibc/
package/Config.in +0 -1
index 65e358e1e9..a88f254be5 100644
@@ -1925,7 +1925,6 @@ menu "JSON/XML"
 	source "package/libbson/Config.in"
 	source "package/libfastjson/Config.in"
 	source "package/libjson/Config.in"
-	source "package/libjwt/Config.in"
 	source "package/libroxml/Config.in"
 	source "package/libucl/Config.in"
 	source "package/libxml2/Config.in"
package/libjwt/Config.in deleted +0 -10
deleted file mode 100644
index 47eb0882a3..0000000000
@@ -1,10 +0,0 @@
-config BR2_PACKAGE_LIBJWT
-	bool "libjwt"
-	select BR2_PACKAGE_OPENSSL
-	select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
-	select BR2_PACKAGE_JANSSON
-	help
-	  JSON Web Tokens are an open, industry standard RFC 7519
-	  method for representing claims securely between two parties.
-
-	  https://github.com/benmcollins/libjwt
package/libjwt/libjwt.hash deleted +0 -3
deleted file mode 100644
index 8e59d2284b..0000000000
@@ -1,3 +0,0 @@
-# Locally computed
-sha256  17ee4e25adfbb91003946af967ff04068a5c93d6b51ad7ad892f1441736b71b9  libjwt-3.2.0.tar.xz
-sha256  3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779b9d04  LICENSE
package/libjwt/libjwt.mk deleted +0 -19
deleted file mode 100644
index d20067de24..0000000000
@@ -1,19 +0,0 @@
-################################################################################
-#
-# libjwt
-#
-################################################################################
-
-LIBJWT_VERSION = 3.2.0
-LIBJWT_SITE = https://github.com/benmcollins/libjwt/releases/download/v$(LIBJWT_VERSION)
-LIBJWT_SOURCE = libjwt-$(LIBJWT_VERSION).tar.xz
-LIBJWT_DEPENDENCIES = host-pkgconf jansson openssl
-LIBJWT_INSTALL_STAGING = YES
-LIBJWT_LICENSE = MPL-2.0
-LIBJWT_LICENSE_FILES = LICENSE
-LIBJWT_CPE_ID_VENDOR = bencollins
-LIBJWT_CPE_ID_PRODUCT = jwt_c_library
-
-LIBJWT_CONF_OPTS += -DWITH_TESTS=OFF -DWITH_GNUTLS=OFF
-
-$(eval $(cmake-package))
Signature · 6 lines
2.47.3

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

PATCH 3/3 package/asterisk: bump version to 22.5.2

In reply to Bernd Kuhls
---
 package/asterisk/asterisk.hash | 2 +-
 package/asterisk/asterisk.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/asterisk/asterisk.hash +1 -1
index f11ed08ef4..26175667c3 100644
@@ -1,5 +1,5 @@
 # Locally computed
-sha256  4cc403c8885d4aed3956dfb75d315d3e5bcc129eb9cd47c156d3b12ecceed1ba  asterisk-22.3.0.tar.gz
+sha256  8a94650b6f348af1f1c9cce7ed3585d280f3a31b0d3820084a42b03712df95d5  asterisk-22.5.2.tar.gz
 
 # Locally computed
 sha256  58bb83cec4d431f48d006e455d821668450f8cf6b6c95f090def47062fa3a60c  pjproject-2.15.1.tar.bz2
package/asterisk/asterisk.mk +1 -1
index e7e802aa45..9a071fb8e0 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-ASTERISK_VERSION = 22.3.0
+ASTERISK_VERSION = 22.5.2
 # Use the github mirror: it's an official mirror maintained by Digium, and
 # provides tarballs, which the main Asterisk git tree (behind Gerrit) does not.
 ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Acked-by Titouan Christophe on v1 3/3
#3 lore raw

Re: [Buildroot] [PATCH 3/3] package/asterisk: bump version to 22.5.2

Hello Bernd and all,

Please also note that this is a security bump for CVE-2025-1131, see https://github.com/asterisk/asterisk/security/advisories/GHSA-v9q8-9j8m-5xwp

Quoted 1 line · Bernd Kuhls
Quoted 21 lines
---
  package/asterisk/asterisk.hash | 2 +-
  package/asterisk/asterisk.mk   | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
package/asterisk/asterisk.hash +1 -1
index f11ed08ef4..26175667c3 100644
@@ -1,5 +1,5 @@
  # Locally computed
-sha256  4cc403c8885d4aed3956dfb75d315d3e5bcc129eb9cd47c156d3b12ecceed1ba  asterisk-22.3.0.tar.gz
+sha256  8a94650b6f348af1f1c9cce7ed3585d280f3a31b0d3820084a42b03712df95d5  asterisk-22.5.2.tar.gz
 
  # Locally computed
  sha256  58bb83cec4d431f48d006e455d821668450f8cf6b6c95f090def47062fa3a60c  pjproject-2.15.1.tar.bz2
package/asterisk/asterisk.mk +0 -0
index e7e802aa45..9a071fb8e0 100644

package/asterisk/asterisk.mk line 10

Quoted 8 lines
package/asterisk/asterisk.mk +1 -1
@@ -4,7 +4,7 @@
  #
  ################################################################################
 
-ASTERISK_VERSION = 22.3.0
+ASTERISK_VERSION = 22.5.2
  # Use the github mirror: it's an official mirror maintained by Digium, and
  # provides tarballs, which the main Asterisk git tree (behind Gerrit) does not.
  ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))

Regards,
Titouan
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot