From Fedora Project Wiki
No edit summary
Line 14: Line 14:


* Packages providing PKCS#11 modules SHOULD also provide a corresponding module file in the directory specified by  <code>pkg-config p11-kit-1 --variable p11_module_configs</code> ''(currently <code>/usr/share/p11-kit/modules</code>)'' so that the new module is automatically visible in well-behaved applications.
* Packages providing PKCS#11 modules SHOULD also provide a corresponding module file in the directory specified by  <code>pkg-config p11-kit-1 --variable p11_module_configs</code> ''(currently <code>/usr/share/p11-kit/modules</code>)'' so that the new module is automatically visible in well-behaved applications.
* PKCS#11 modules SHOULD silently fail to load if their corresponding hardware is not present, or in the case of pure software tokens such as SoftHSM if there is no storage configured for the user in question.


=== Rationale ===
=== Rationale ===

Revision as of 14:57, 15 December 2014


Summary

Client applications

  • Packages which use SSL certificates/keys from a file or elsewhere SHOULD also support using certs/keys from PKCS#11 tokens.
  • Packages which can use PKCS#11 tokens SHOULD automatically use the tokens which are present in the system's p11-kit configuration, rather than needing to have a PKCS#11 provider explicitly specified.

PKCS#11 Providers

  • Packages providing PKCS#11 modules SHOULD also provide a corresponding module file in the directory specified by pkg-config p11-kit-1 --variable p11_module_configs (currently /usr/share/p11-kit/modules) so that the new module is automatically visible in well-behaved applications.

Rationale

PKCS#11 is much too hard to set up and use. You have to explicitly configure each application to know where to load the PKCS#11 module, and there are numerous different ways of specifying which certificate from the token you want to use.

By consistently using p11-kit for token configuration, and PKCS#11 URIs for specifying objects, we make things a lot simpler for users. If I want to use a certain certificate from my Yubikey, I should be able to use the URI pkcs11:manufacturer=piv_II;id=%01 consistently in *all* applications within Fedora and expect it to work.

Currently, there are many different ways to tell each application how to find the certificate. With OpenVPN it's: --pkcs11-providers=/usr/lib64/pkcs11/opensc-pkcs11.so --pkcs11-id=piv_II/PKCS\x2315\x20emulated/108421384210c3f5/PIV_II\x20\x28PIV\x20Card\x20Holder\x20pin\x29/01

With wpa_supplicant it's different again, as shown at http://w1.fi/cgit/hostap/plain/wpa_supplicant/examples/openCryptoki.conf

All of these should just take a simple PKCS#11 URI and Just Work™.


Expectations

Obviously, packagers are not always expected to be proficient coders in the langage their packages are written in. We don't necessarily expect packagers to fix software for themselves, although it's great when they can.

However, it is certainly within the purview of a packager to work with the upstream developers and ensure that the appropriate features are requested and given due consideration.

Most importantly, it is often the case that software can be built with more than one crypto library, and the feature set available will depend on that choice. For example the OpenConnect VPN client will comply with all of the above requirements when built with GnuTLS, but not when built with OpenSSL. This much certainly is within the direct control of the packager. Likewise, sometimes all that is required is to configure a piece of software to use p11-kit-proxy.so as its PKCS#11 provider module by default. Again, that's certainly something a packager can do.