MINGW-packages/mingw-w64-libp11
Mikhail Titov 905d75dbc3
Add libp11 (#22589)
* Add libp11

* libp11: somewhat more correct way to fix enginesdir detection

We are installing into a different prefix than our depenencies are
during makepkg, so fix the pkg-config calls to relocate. This is in theory
correct for all platforms.

Since that kicks in our path conversion, disable it so the passed install
prefix isn't converted via MSYS2_ARG_CONV_EXCL.

* libp11: fix pkgver

---------

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
2024-11-30 22:04:24 +01:00
..

This package is built to leverage p11-kit proxy.

Normally, one would specify PKCS#11 module to use explicitly, e.g. for YubiKey

  $ PKCS11_MODULE_PATH=libykcs11.dll openssl pkeyutl -engine pkcs11 -keyform engine \
  -inkey "pkcs11:object=Private key for PIV Authentication;type=private;pin-value=123456" \
  -sign -in data.txt -out data.sig

Note that libykcs11.dll along with its dependencies has to be on the PATH.

However, this package is built with default PKCS#11 module libp11-kit-0.dll. That is if you
have YOUR-ENV-p11-kit package installed, and say you use OpenSC installed in its default
location along with a properly configured module, e.g. by creating a file
/ucrt64/etc/pkcs11/modules/opensc.module with a single line

  module: C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll

then you would be able to use it implicitly, e.g.

  $ openssl pkeyutl -engine pkcs11 -keyform engine \
  -inkey "pkcs11:token=some_cn;type=private;pin-value=123456" \
  -sign -in data.txt -out data.sig

You should be able to check whether your module is set up properly by running

  p11-kit list-modules

You should see opensc module in there as well as your token.

Note that pkg-config has an incorrect information about proxy on msys2. The following line
will result in an error.

  $ ls -l $(pkg-config.exe --variable=proxy_module p11-kit-1)
  ls: cannot access 'C:/msys64/ucrt64/bin/../lib/p11-kit-proxy.dll': No such file or directory

However the proxy and the main library (libp11-kit-0.dll) are essentially the same.  This is a
bug in p11-kit packaging.