Jan Alexander Steffens (heftig) pushed to branch main at Arch Linux / Packaging 
/ Packages / p11-kit


Commits:
5faea955 by Jan Alexander Steffens (heftig) at 2023-09-15T22:15:43+02:00
0.25.0-2: fix libsoup testsuite

- - - - -


2 changed files:

- + 0001-Fix-probing-of-C_GetInterface.patch
- PKGBUILD


Changes:

=====================================
0001-Fix-probing-of-C_GetInterface.patch
=====================================
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Xi Ruoyao <[email protected]>
+Date: Thu, 27 Jul 2023 12:18:15 +0800
+Subject: [PATCH] Fix probing of C_GetInterface
+
+`p11_dl_symbol (dl, "C_GetInterface")` uses dlsym() to find
+C_GetInterface in the loaded pkcs11 module.  For legacy (pre-3.0) pkcs11
+modules, C_GetInterface is not defined in the module.  But according to
+the documentation of dlsym():
+
+    The search performed by dlsym() is breadth first through the
+    dependency tree of these shared objects.
+
+So if a pkcs11 module links to libp11-kit.so, the C_GetInterface
+implementation in libp11-kit.so itself will be found.  This
+C_GetInterface will return the metadata of p11-kit-proxy.so, causing
+"Refuse to load the p11-kit-proxy.so as a registered module".
+
+To solve the issue, if p11_dl_symbol() returns the C_GetInterface in
+libp11-kit.so itself, we should ignore it and continue trying
+C_GetFunctionList.
+---
+ p11-kit/modules.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/p11-kit/modules.c b/p11-kit/modules.c
+index 8ad88ae01d5d..da0a7f04d68f 100644
+--- a/p11-kit/modules.c
++++ b/p11-kit/modules.c
+@@ -383,6 +383,12 @@ dlopen_and_get_function_list (Module *mod,
+       mod->loaded_module = dl;
+ 
+       gi = p11_dl_symbol (dl, "C_GetInterface");
++
++#ifndef OS_WIN32
++      if (gi == C_GetInterface)
++              gi = NULL;
++#endif
++
+       if (gi) {
+               /* Get the default standard interface */
+               rv = gi ((unsigned char *)"PKCS 11", NULL, &interface, 0);


=====================================
PKGBUILD
=====================================
@@ -8,7 +8,7 @@ pkgname=(
   p11-kit-docs
 )
 pkgver=0.25.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Loads and enumerates PKCS#11 modules"
 url="https://p11-glue.freedesktop.org";
 arch=(x86_64)
@@ -24,9 +24,13 @@ makedepends=(
   meson
   systemd
 )
-source=(https://github.com/p11-glue/p11-kit/releases/download/$pkgver/p11-kit-$pkgver.tar.xz{,.sig})
+source=(
+  
https://github.com/p11-glue/p11-kit/releases/download/$pkgver/p11-kit-$pkgver.tar.xz{,.sig}
+  0001-Fix-probing-of-C_GetInterface.patch
+)
 
b2sums=('6ffce977f86c516a327afe50f4cc5a36e86ba7f43c6cb555db419d9e4ba7543a9f1847ba83da348cd6d7bbebe55dfa26cfe3a3aaa3e1d5420a4b8dc6cbbff088'
-        'SKIP')
+        'SKIP'
+        
'7d93f7bf86840e256480d6fa3efb5c933f8081fe7f64d803d44670724bc8171515474fe43f089e772a1207ba675149a040a8c07a3ba4dfe79bb9effd8e524648')
 validpgpkeys=(
   C0F67099B808FB063E2C81117BFB1108D92765AF  # Stef Walter <[email protected]>
   462225C3B46F34879FC8496CD605848ED7E69871  # Daiki Ueno <[email protected]>
@@ -35,6 +39,10 @@ validpgpkeys=(
 
 prepare() {
   cd p11-kit-$pkgver
+
+  # https://gitlab.gnome.org/GNOME/libsoup/-/issues/352
+  # https://github.com/p11-glue/p11-kit/pull/535
+  patch -Np1 -i ../0001-Fix-probing-of-C_GetInterface.patch
 }
 
 build() {



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/p11-kit/-/commit/5faea9553218996a2fd1ed21e17fa4d5d6aeb388

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/p11-kit/-/commit/5faea9553218996a2fd1ed21e17fa4d5d6aeb388
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to