[winpr,ncrypt] use preferably p11-kit-proxy.so

Currently, the opensc-pkcs11.so library is used for ncrypt support.
However, the p11-kit-proxy.so library is able to aggregate more pkcs11
modules at runtime (OpenSC is one of them, but also some third party
modules that are not supported by OpenSC). Let's use preferably
p11-kit-proxy.so if available.
This commit is contained in:
Ondrej Holy 2024-04-22 10:53:17 +02:00 committed by akallabeth
parent 5a28b046d5
commit 35d8bc1782
1 changed files with 3 additions and 3 deletions

View File

@ -1229,13 +1229,13 @@ SECURITY_STATUS NCryptOpenP11StorageProviderEx(NCRYPT_PROV_HANDLE* phProvider,
LPCSTR* modulePaths)
{
SECURITY_STATUS status = ERROR_INVALID_PARAMETER;
LPCSTR openscPaths[] = { "opensc-pkcs11.so", NULL };
LPCSTR defaultPaths[] = { "p11-kit-proxy.so", "opensc-pkcs11.so", NULL };
if (!phProvider)
return ERROR_INVALID_PARAMETER;
if (!modulePaths)
modulePaths = openscPaths;
modulePaths = defaultPaths;
while (*modulePaths)
{
@ -1244,7 +1244,7 @@ SECURITY_STATUS NCryptOpenP11StorageProviderEx(NCRYPT_PROV_HANDLE* phProvider,
c_get_function_list_t c_get_function_list = NULL;
NCryptP11ProviderHandle* provider = NULL;
WLog_DBG(TAG, "Trying pkcs11-helper module '%s'", *modulePaths);
WLog_DBG(TAG, "Trying pkcs11 module '%s'", *modulePaths);
if (!library)
{
status = NTE_PROV_DLL_NOT_FOUND;