Compare commits

...
Sign in to create a new pull request.

9 commits

Author SHA1 Message Date
Packit
a33bf8feb9 Update to 0.25.8 upstream release
Upstream tag: 0.25.8
Upstream commit: 2ee61264

Commit authored by Packit automation (https://packit.dev/)
2025-09-13 10:13:07 +09:00
Packit
6d11b1e9cb Update to 0.25.6 upstream release
- Resolves: rhbz#2394061

Upstream tag: 0.25.6
Upstream commit: 4f821372

Commit authored by Packit automation (https://packit.dev/)
2025-09-09 23:36:44 +09:00
Daiki Ueno
8a33186b2f rpc: Fix empty array attribute handling
Signed-off-by: Daiki Ueno <dueno@redhat.com>
2025-09-03 20:26:02 +09:00
Fedora Release Engineering
44c46c2705 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 23:50:34 +00:00
Debarshi Ray
27179e46de Split p11-kit-client.so into a separate sub-package
Strictly speaking, the same container or machine doesn't need to have
both the p11-kit-client.so module and the p11-kit-server executable.
eg., Flatpak and Toolbx need only the p11-kit-server executable to be
present on the host machine, and need only the p11-kit-client.so module
inside the container.

Therefore, splitting the 'server' sub-package [1] will avoid having
unexpected content in containers and machines.

A Release number of 8 was chosen for the Version-Release tuple in
'Obsoletes', because that will be the Release number of this commit
according to %{autorelease}:
  $ rpmautospec calculate-release
  Calculated release number: 8

[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/#_one_to_many_replacement

https://src.fedoraproject.org/rpms/p11-kit/pull-request/53
2025-05-15 13:46:54 +02:00
Debarshi Ray
509127e98c Move ownership of %{_libdir}/pkcs11 to the main package
Commit 35e6a95319 made the 'trust' sub-package own the
%{_libdir}/pkcs11 directory at a time when p11-kit-trust.so was the only
PKCS#11 module being shipped by p11-kit.

Since then, commit 7c8cb45032 or p11-kit-0.23.4 introduced the
p11-kit-client.so module.  It was initially part of the main package,
until was split into its own sub-package in commit adb7cbe63f.
Even though it doesn't depend directly on the 'trust' module, it
depended on it to own the %{_libdir}/pkcs11 directory.

It will be better if the main package owns the %{_libdir}/pkcs11
directory, just like it already owns %{_sysconfdir}/pkcs11, so that the
directory doesn't have to be separately owned by multiple sub-packages.

https://src.fedoraproject.org/rpms/p11-kit/pull-request/53
2025-05-15 13:41:15 +02:00
Debarshi Ray
a8fa1a940d Fix the MingGW build with GCC 15.1.1
Otherwise, it leads to:
  [22/338] Compiling C object common/libp11-library.a.p/library.c.obj
  FAILED: common/libp11-library.a.p/library.c.obj
  i686-w64-mingw32-gcc -Icommon/libp11-library.a.p -Icommon -I../common
      -I. -I.. -fvisibility=hidden -fdiagnostics-color=always
      -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -D_GNU_SOURCE
      -DP11_KIT_FUTURE_UNSTABLE_API -O2 -g -pipe -Wall
      -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -MD
      -MQ common/libp11-library.a.p/library.c.obj -MF
      common/libp11-library.a.p/library.c.obj.d -o
      common/libp11-library.a.p/library.c.obj -c ../common/library.c
  ../common/library.c:208:27: error: expected identifier or '(' before
      '=' token
    208 | static DWORD thread_local = TLS_OUT_OF_INDEXES;
        |                           ^
  ../common/library.c: In function '_p11_library_get_thread_local':
  ../common/library.c:217:26: error: expected identifier or '(' before
      '==' token
    217 |         if (thread_local == TLS_OUT_OF_INDEXES)
        |                          ^~
  ../common/library.c:217:13: error: declaration in the controlling
      expression must have an initializer
    217 |         if (thread_local == TLS_OUT_OF_INDEXES)
        |             ^~~~~~~~~~~~
  ../common/library.c:220:29: error: expected expression before
      'thread_local'
    220 |         data = TlsGetValue (thread_local);
        |                             ^~~~~~~~~~~~
  ../common/library.c:223:30: error: expected expression before
      'thread_local'
    223 |                 TlsSetValue (thread_local, data);
        |                              ^~~~~~~~~~~~
  ../common/library.c:223:17: error: too few arguments to function
      'TlsSetValue'; expected 2, have 1
    223 |                 TlsSetValue (thread_local, data);
        |                 ^~~~~~~~~~~

https://src.fedoraproject.org/rpms/p11-kit/pull-request/54
2025-05-14 18:39:18 +02:00
Fedora Release Engineering
b4943bcb3d Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 22:08:21 +00:00
Zoltan Fridrich
8a8660a738 Integrate mingw-p11-kit into spec file
Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
2024-10-08 11:07:04 +02:00
7 changed files with 343 additions and 9 deletions

4
.gitignore vendored
View file

@ -46,3 +46,7 @@
/p11-kit-0.25.3.tar.xz.sig
/p11-kit-0.25.5.tar.xz
/p11-kit-0.25.5.tar.xz.sig
/p11-kit-0.25.6.tar.xz
/p11-kit-0.25.6.tar.xz.sig
/p11-kit-0.25.8.tar.xz
/p11-kit-0.25.8.tar.xz.sig

View file

@ -1,3 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.97.3.post1.dev7+g1954e49a.
The file was generated using packit 1.11.0.post1.dev7+gfdcdf3a32.

View file

@ -0,0 +1,62 @@
From e94c1fb907546faafb3509615943776d1ea37eb8 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Wed, 3 Sep 2025 17:10:21 +0900
Subject: [PATCH] rpc: Fix empty array attribute handling
When an empty array attribute is exchanged at the RPC level, the
client previously sent the number of elements (= 0) even if it's
empty, while the server doesn't expect it. This fixes the client to
not send it.
Signed-off-by: Daiki Ueno <ueno@gnu.org>
---
p11-kit/rpc-message.c | 2 +-
p11-kit/test-mock.c | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/p11-kit/rpc-message.c b/p11-kit/rpc-message.c
index 049417f..5eaea61 100644
--- a/p11-kit/rpc-message.c
+++ b/p11-kit/rpc-message.c
@@ -266,7 +266,7 @@ p11_rpc_message_write_attribute_buffer_array (p11_rpc_message *msg,
/* And the attribute buffer length */
p11_rpc_buffer_add_uint32 (msg->output, attr->pValue ? attr->ulValueLen : 0);
- if (IS_ATTRIBUTE_ARRAY (attr))
+ if (attr->pValue && IS_ATTRIBUTE_ARRAY (attr))
p11_rpc_message_write_attribute_buffer_array (
msg, attr->pValue,
attr->ulValueLen / sizeof (CK_ATTRIBUTE));
diff --git a/p11-kit/test-mock.c b/p11-kit/test-mock.c
index b117b92..f174015 100644
--- a/p11-kit/test-mock.c
+++ b/p11-kit/test-mock.c
@@ -624,6 +624,12 @@ test_get_wrap_template (void)
{ CKA_WRAP_TEMPLATE, temp, sizeof (temp) },
};
CK_ULONG n_attrs = sizeof (attrs) / sizeof (attrs[0]);
+ CK_OBJECT_CLASS klass = -1ul;
+ CK_ATTRIBUTE attrs_empty_template[] = {
+ { CKA_WRAP_TEMPLATE, NULL, 0 },
+ { CKA_UNWRAP_TEMPLATE, NULL, 0 },
+ };
+ CK_ULONG n_attrs_empty_template = sizeof(attrs_empty_template) / sizeof(attrs_empty_template[0]);
module = setup_mock_module (&session);
@@ -664,6 +670,12 @@ test_get_wrap_template (void)
assert (verify == CK_TRUE);
assert (encrypt == CK_TRUE);
+ rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs_empty_template, n_attrs_empty_template);
+ assert (rv == CKR_ATTRIBUTE_TYPE_INVALID);
+ assert_num_eq (attrs_empty_template[0].type, CKA_WRAP_TEMPLATE);
+ assert_ptr_eq (attrs_empty_template[0].pValue, NULL);
+ assert_num_eq (attrs_empty_template[0].ulValueLen, (CK_ULONG)-1);
+
teardown_mock_module (module);
}
--
2.50.1

View file

@ -0,0 +1,18 @@
diff --git a/meson.build b/meson.build
index ab28396..b5829ca 100644
--- a/meson.build
+++ b/meson.build
@@ -459,6 +459,7 @@ with_systemd = false
systemd = dependency('systemd', required: get_option('systemd'))
if systemd.found()
systemduserunitdir = systemd.get_variable(pkgconfig : 'systemduserunitdir')
+ with_systemd = true
endif
configure_file(output: 'config.h', configuration: conf)
@@ -488,4 +489,4 @@ if get_option('nls')
subdir('po')
endif
subdir('bash-completion')
-subdir('zsh-completion')
+# subdir('zsh-completion')

View file

@ -0,0 +1,134 @@
From fd7ad3969f68ea24e54d242a08b089039555f7bb Mon Sep 17 00:00:00 2001
From: Brecht Sanders <brecht@sanders.org>
Date: Tue, 31 Dec 2024 16:28:31 +0100
Subject: [PATCH] avoid using already defined thread_local as variable name
Building p11-kit 0.25.5 with GCC15 on MinGW-w64 failed because `thread_local` is already defined for this platform.
Resolved by changing the variable name from `thread_local` to `threadlocal`.
---
common/library.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/common/library.c b/common/library.c
index 1581702b62db..723b05f33699 100644
--- a/common/library.c
+++ b/common/library.c
@@ -124,7 +124,7 @@ _p11_library_get_thread_local (void)
return &local;
}
#else
-static pthread_key_t thread_local = 0;
+static pthread_key_t threadlocal = 0;
static p11_local *
_p11_library_get_thread_local (void)
@@ -133,10 +133,10 @@ _p11_library_get_thread_local (void)
p11_library_init_once ();
- local = pthread_getspecific (thread_local);
+ local = pthread_getspecific (threadlocal);
if (local == NULL) {
local = calloc (1, sizeof (p11_local));
- pthread_setspecific (thread_local, local);
+ pthread_setspecific (threadlocal, local);
}
return local;
@@ -158,7 +158,7 @@ p11_library_init_impl (void)
P11_RECURSIVE_MUTEX_INIT (p11_library_mutex);
P11_RECURSIVE_MUTEX_INIT (p11_virtual_mutex);
#ifndef P11_TLS_KEYWORD
- pthread_key_create (&thread_local, free);
+ pthread_key_create (&threadlocal, free);
#endif
p11_message_storage = thread_local_message;
#ifdef HAVE_STRERROR_L
@@ -181,8 +181,8 @@ p11_library_uninit (void)
#ifndef P11_TLS_KEYWORD
/* Some cleanup to pacify valgrind */
- free (pthread_getspecific (thread_local));
- pthread_setspecific (thread_local, NULL);
+ free (pthread_getspecific (threadlocal));
+ pthread_setspecific (threadlocal, NULL);
#endif
#ifdef HAVE_STRERROR_L
@@ -191,7 +191,7 @@ p11_library_uninit (void)
#endif
p11_message_storage = dont_store_message;
#ifndef P11_TLS_KEYWORD
- pthread_key_delete (thread_local);
+ pthread_key_delete (threadlocal);
#endif
p11_mutex_uninit (&p11_virtual_mutex);
p11_mutex_uninit (&p11_library_mutex);
@@ -205,7 +205,7 @@ p11_library_uninit (void)
#ifdef OS_WIN32
-static DWORD thread_local = TLS_OUT_OF_INDEXES;
+static DWORD threadlocal = TLS_OUT_OF_INDEXES;
BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID);
@@ -214,13 +214,13 @@ _p11_library_get_thread_local (void)
{
LPVOID data;
- if (thread_local == TLS_OUT_OF_INDEXES)
+ if (threadlocal == TLS_OUT_OF_INDEXES)
return NULL;
- data = TlsGetValue (thread_local);
+ data = TlsGetValue (threadlocal);
if (data == NULL) {
data = LocalAlloc (LPTR, sizeof (p11_local));
- TlsSetValue (thread_local, data);
+ TlsSetValue (threadlocal, data);
}
return (p11_local *)data;
@@ -233,8 +233,8 @@ p11_library_init (void)
p11_debug ("initializing library");
P11_RECURSIVE_MUTEX_INIT (p11_library_mutex);
P11_RECURSIVE_MUTEX_INIT (p11_virtual_mutex);
- thread_local = TlsAlloc ();
- if (thread_local == TLS_OUT_OF_INDEXES)
+ threadlocal = TlsAlloc ();
+ if (threadlocal == TLS_OUT_OF_INDEXES)
p11_debug ("couldn't setup tls");
else
p11_message_storage = thread_local_message;
@@ -244,9 +244,9 @@ void
p11_library_thread_cleanup (void)
{
p11_local *local;
- if (thread_local != TLS_OUT_OF_INDEXES) {
+ if (threadlocal != TLS_OUT_OF_INDEXES) {
p11_debug ("thread stopped, freeing tls");
- local = TlsGetValue (thread_local);
+ local = TlsGetValue (threadlocal);
LocalFree (local);
}
}
@@ -258,11 +258,11 @@ p11_library_uninit (void)
uninit_common ();
- if (thread_local != TLS_OUT_OF_INDEXES) {
+ if (threadlocal != TLS_OUT_OF_INDEXES) {
p11_message_storage = dont_store_message;
- data = TlsGetValue (thread_local);
+ data = TlsGetValue (threadlocal);
LocalFree (data);
- TlsFree (thread_local);
+ TlsFree (threadlocal);
}
p11_mutex_uninit (&p11_virtual_mutex);
p11_mutex_uninit (&p11_library_mutex);
--
2.49.0

View file

@ -1,5 +1,12 @@
# This spec file has been automatically updated
Version: 0.25.5
%if 0%{?fedora}
%bcond_without mingw
%else
%bcond_with mingw
%endif
Version: 0.25.8
Release: %{?autorelease}%{!?autorelease:1%{?dist}}
Name: p11-kit
Summary: Library for loading and sharing PKCS#11 modules
@ -27,12 +34,40 @@ BuildRequires: pkgconfig(systemd)
BuildRequires: gnupg2
BuildRequires: /usr/bin/xsltproc
%if %{with mingw}
BuildRequires: ninja-build
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
BuildRequires: mingw32-libffi
BuildRequires: mingw32-libtasn1
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc
BuildRequires: mingw64-binutils
BuildRequires: mingw64-libffi
BuildRequires: mingw64-libtasn1
%endif
%description
p11-kit provides a way to load and enumerate PKCS#11 modules, as well
as a standard configuration setup for installing PKCS#11 modules in
such a way that they're discoverable.
%package client
Summary: Client module from %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-server < 0.25.5-8
%description client
The %{name}-client package contains a PKCS#11 module that enables
accessing other PKCS#11 modules over a Unix domain socket. Note that
this feature is still experimental.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -55,8 +90,9 @@ contains certificate anchors and blocklists.
%package server
Summary: Server and client commands for %{name}
Summary: Server command for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-server < 0.25.5-8
%description server
The %{name}-server package contains command line tools that enable to
@ -64,6 +100,33 @@ export PKCS#11 modules through a Unix domain socket. Note that this
feature is still experimental.
%if %{with mingw}
%package -n mingw32-%{name}
Summary: MinGW Library for loading and sharing PKCS#11 modules
Requires: pkgconfig
BuildArch: noarch
%description -n mingw32-%{name}
p11-kit provides a way to load and enumerate PKCS#11 modules, as well as
a standard configuration setup for installing PKCS#11 modules in such a
way that they're discoverable. This library is cross-compiled for MinGW.
%package -n mingw64-%{name}
Summary: MinGW Library for loading and sharing PKCS#11 modules
Requires: pkgconfig
BuildArch: noarch
%description -n mingw64-%{name}
p11-kit provides a way to load and enumerate PKCS#11 modules, as well as
a standard configuration setup for installing PKCS#11 modules in such a
way that they're discoverable. This library is cross-compiled for MinGW.
%{?mingw_debug_package}
%endif
# solution taken from icedtea-web.spec
%define multilib_arches ppc64 sparc64 x86_64 ppc64le
%ifarch %{multilib_arches}
@ -79,11 +142,16 @@ gpgv2 --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
%autosetup -p1
%build
# These paths are the source paths that come from the plan here:
# These paths are the source paths that come from the plan here:
# https://fedoraproject.org/wiki/Features/SharedSystemCertificates:SubTasks
%meson -Dgtk_doc=true -Dman=true -Dtrust_paths=%{_sysconfdir}/pki/ca-trust/source:%{_datadir}/pki/ca-trust-source
%meson_build
%if %{with mingw}
%mingw_meson -Dgtk_doc=false -Dman=false -Dnls=false -Dtrust_paths=%{_sysconfdir}/pki/ca-trust/source:%{_datadir}/pki/ca-trust-source -Dzsh_completion=disabled
%mingw_ninja
%endif
%install
%meson_install
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pkcs11/modules
@ -95,6 +163,12 @@ mkdir -p $RPM_BUILD_ROOT%{_userunitdir}
install -p -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_userunitdir}
%find_lang %{name}
%if %{with mingw}
%mingw_ninja_install
%{?mingw_debug_install_post}
%endif
%check
%meson_test
@ -118,6 +192,7 @@ fi
%dir %{_sysconfdir}/pkcs11/modules
%dir %{_datadir}/p11-kit
%dir %{_datadir}/p11-kit/modules
%dir %{_libdir}/pkcs11
%dir %{_libexecdir}/p11-kit
%{_bindir}/p11-kit
%{_libdir}/libp11-kit.so.*
@ -127,6 +202,11 @@ fi
%{_mandir}/man8/p11-kit.8.gz
%{_mandir}/man5/pkcs11.conf.5.gz
%{_datadir}/bash-completion/completions/p11-kit
%{_datadir}/zsh/site-functions/_p11-kit
%files client
%{_libdir}/pkcs11/p11-kit-client.so
%{_userunitdir}/p11-kit-client.service
%files devel
%{_includedir}/p11-kit-1/
@ -136,20 +216,56 @@ fi
%files trust
%{_bindir}/trust
%dir %{_libdir}/pkcs11
%ghost %{_libdir}/libnssckbi.so
%{_libdir}/pkcs11/p11-kit-trust.so
%{_datadir}/p11-kit/modules/p11-kit-trust.module
%{_libexecdir}/p11-kit/trust-extract-compat
%{_datadir}/bash-completion/completions/trust
%{_datadir}/zsh/site-functions/_trust
%files server
%{_libdir}/pkcs11/p11-kit-client.so
%{_userunitdir}/p11-kit-client.service
%{_libexecdir}/p11-kit/p11-kit-server
%{_userunitdir}/p11-kit-server.service
%{_userunitdir}/p11-kit-server.socket
%if %{with mingw}
%files -n mingw32-%{name}
%{!?_licensedir:%global license %%doc}
%license COPYING
%{mingw32_bindir}/libp11-kit-0.dll
%{mingw32_bindir}/p11-kit.exe
%{mingw32_bindir}/trust.exe
%{mingw32_libdir}/libp11-kit.dll.a
%dir %{mingw32_libdir}/pkcs11/
%{mingw32_libdir}/pkcs11/p11-kit-trust.dll
%{mingw32_libdir}/pkcs11/p11-kit-trust.dll.a
%{mingw32_libdir}/pkgconfig/p11-kit-1.pc
%dir %{mingw32_libexecdir}/p11-kit/
%{mingw32_libexecdir}/p11-kit/*.exe
%{mingw32_libexecdir}/p11-kit/trust-extract-compat
%{mingw32_includedir}/p11-kit-1/
%{mingw32_datadir}/p11-kit/
%{mingw32_sysconfdir}/pkcs11/
%files -n mingw64-%{name}
%{!?_licensedir:%global license %%doc}
%license COPYING
%{mingw64_bindir}/libp11-kit-0.dll
%{mingw64_bindir}/p11-kit.exe
%{mingw64_bindir}/trust.exe
%{mingw64_libdir}/libp11-kit.dll.a
%dir %{mingw64_libdir}/pkcs11/
%{mingw64_libdir}/pkcs11/p11-kit-trust.dll
%{mingw64_libdir}/pkcs11/p11-kit-trust.dll.a
%{mingw64_libdir}/pkgconfig/p11-kit-1.pc
%dir %{mingw64_libexecdir}/p11-kit/
%{mingw64_libexecdir}/p11-kit/*.exe
%{mingw64_libexecdir}/p11-kit/trust-extract-compat
%{mingw64_includedir}/p11-kit-1/
%{mingw64_datadir}/p11-kit/
%{mingw64_sysconfdir}/pkcs11/
%endif
%changelog
%autochangelog

View file

@ -1,3 +1,3 @@
SHA512 (p11-kit-0.25.5.tar.xz) = 177ec6ff5eb891901078306dce2bf3f5c1a0e5c2a8c493bdf5a08ae1ff1240fdf6952961e973c373f80ac3d1d5a9927e07f4da49e4ff92269d992e744889fc94
SHA512 (p11-kit-0.25.5.tar.xz.sig) = 2be5aa4ccbb889e32aed88fc1f7926c3ccaadc90cc6b15a187358c812eee4ce1712068d1f271766ac51366112c0619aad46cff345ed2edd009fb2fe7fb804493
SHA512 (p11-kit-0.25.8.tar.xz) = 4a3852459a4a5e4ea71eea5d23ef74deeb51c66b28d095be30a263f10d1f47853341f8628eb0c43c88247503059a4c1f67017965a70cd3c7df31d86e458a8162
SHA512 (p11-kit-0.25.8.tar.xz.sig) = 97f47324cd7578833b751ab1fee55a9a538ba94b52ec4729249a9e5494c60cceef6c60999b495299f2b9ae0d0cda60d5db713d82e0b7991112b7b4b46ad46d1d
SHA512 (p11-kit-release-keyring.gpg) = 9a832a8ac3a139cbbf1ecb66573f0709847ebfef4975777cf82b4dca09af1ad8e6400f0af0bcdb92860e7ed4fc05082ba1edda0238a21fe24d49555a1069e881