Projects
openEuler:24.03:SP1:Everything
p11-kit
_service:tar_scm:backport-Fix-probing-of-C_GetI...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-Fix-probing-of-C_GetInterface.patch of Package p11-kit
From d1d4b0ac316a27c739ff91e6c4153f1154e96e5a Mon Sep 17 00:00:00 2001 From: Xi Ruoyao <xry111@xry111.site> 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 8ad88ae..da0a7f0 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); -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2