Jan Alexander Steffens (heftig) pushed to branch main at Arch Linux / Packaging / Packages / lib32-p11-kit
Commits: 9bbacfaa by Jan Alexander Steffens (heftig) at 2023-09-15T22:15:26+02:00 0.25.0-2 - - - - - 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 ===================================== @@ -7,7 +7,7 @@ pkgname=( lib32-p11-kit ) pkgver=0.25.0 -pkgrel=1 +pkgrel=2 pkgdesc="Loads and enumerates PKCS#11 modules (32-bit library)" url="https://p11-glue.freedesktop.org" arch=(x86_64) @@ -23,9 +23,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]> @@ -38,19 +42,19 @@ prepare() { ln -sf /usr/bin/false path/p11tool 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() { local meson_options=( - --libdir /usr/lib32 + --cross-file lib32 -D bash_completion=disabled -D trust_paths=/etc/ca-certificates/trust-source:/usr/share/ca-certificates/trust-source ) - export CC="gcc -m32" - export CXX="g++ -m32" - export PKG_CONFIG="i686-pc-linux-gnu-pkg-config" - arch-meson p11-kit-$pkgver build "${meson_options[@]}" meson compile -C build } View it on GitLab: https://gitlab.archlinux.org/archlinux/packaging/packages/lib32-p11-kit/-/commit/9bbacfaa0ec3d8477d31498e6330c96d232b6023 -- View it on GitLab: https://gitlab.archlinux.org/archlinux/packaging/packages/lib32-p11-kit/-/commit/9bbacfaa0ec3d8477d31498e6330c96d232b6023 You're receiving this email because of your account on gitlab.archlinux.org.
