Build and run the provider on a Windows system #177
Replies: 6 comments 2 replies
-
I will accept non-invasive patches to build on Windows but it is not a primary target for me at the moment. |
Beta Was this translation helpful? Give feedback.
-
I maintain Windows/Visual Studio support in my fork of pkcs11-provider. This contains potentially invasive patches however. |
Beta Was this translation helpful? Give feedback.
-
Excluding the VS project files stuff that would not be appropriate (because I would not be able to keep up to date anyway), I think most other changes are reasonable. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to build it on Windows using msys2. It builds alright, however I'm getting SEGFAULT using it. Any insight?
err.txt (Click me)
Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff8c1b2edf1 in p11prov_Initialize (ctx=0x7b9970, pInitArgs=0x5ff840)
at ../pkcs11-provider-0.5/src/interface.gen.c:18
18 ret = intf->Initialize(pInitArgs);
(gdb) bt
#0 0x00007ff8c1b2edf1 in p11prov_Initialize (ctx=0x7b9970, pInitArgs=0x5ff840)
at ../pkcs11-provider-0.5/src/interface.gen.c:18
#1 0x00007ff8c1b34fb4 in p11prov_module_init (mctx=0x7dc470)
at ../pkcs11-provider-0.5/src/interface.c:309
#2 0x00007ff8c1b41508 in p11prov_ctx_status (ctx=0x7b9970)
at ../pkcs11-provider-0.5/src/provider.c:474
#3 0x00007ff8c1b5193f in p11prov_store_open (pctx=0x7b9970, uri=0x75b750 "pkcs11:")
at ../pkcs11-provider-0.5/src/store.c:200
#4 0x00007ff8c2f7bd41 in ?? () from C:\msys64\ucrt64\bin\libcrypto-3-x64.dll
#5 0x00007ff7de5239ec in ?? ()
#6 0x00007ff7de52459c in ?? ()
#7 0x00007ff7de4ed348 in ?? ()
#8 0x00007ff7de5429ad in ?? ()
#9 0x00007ff7de4c12e9 in ?? ()
#10 0x00007ff7de4c13f6 in ?? ()
#11 0x00007ff9a9f253e0 in KERNEL32!BaseThreadInitThunk () from C:\Windows\System32\kernel32.dll
#12 0x00007ff9aad6485b in ntdll!RtlUserThreadStart () from C:\Windows\SYSTEM32\ntdll.dll
#13 0x0000000000000000 in ?? () openssl.cnf
I tried explicit YubiKey module as well as implicit OpenSC proxied via p11-kit. Both work fine with libp11 engine. |
Beta Was this translation helpful? Give feedback.
-
I do not think we set the correct pragma and alignment compiler option for the pkcs11 headers for windows builds, so when trying to call into a pkcs11 module built for windows data structures are probably out of alignment and not packed and cause crashes. See the comments in the Oasis header file: https://github.com/oasis-tcs/pkcs11/blob/master/published/3-01/pkcs11.h That stuff (#pragma pack) need to be done before including our own pkcs11.h as well for windows builds... |
Beta Was this translation helpful? Give feedback.
-
If the patch you have works and is small feel free to contribute it so we get it fixed for all. |
Beta Was this translation helpful? Give feedback.
-
I would like to build and run the provider on a Windows system.
Is Windows compatibility planned in the near future?
Beta Was this translation helpful? Give feedback.
All reactions