LWN.net Logo

PKCS#11 and GnuPG

PKCS#11 and GnuPG

Posted Aug 11, 2011 8:38 UTC (Thu) by dd9jn (subscriber, #4459)
Parent article: Desktop Summit: Crypto consolidation

PKCS#11 allows the use of proprietary tokens. In fact that is the sole reason why this API has been established a long time ago. It is designed as glue code between between different proprietary applications. Instead of supporting PKCS#11 tokens, the FS community should demand the release of the token's specs to the public. For almost all tokens this is not the case; for some you can get the specs with a bit of trouble but most vendors try to lock users in to their products. This is the reason why GnuPG does not support PKCS#11 tokens but requires that the host side of the token is being implemented in GnuPG.

PKCS#11 is not a well defined standard. Granted, since a few years it has changed to the better but nevertheless it is, as stated in the article, a baroque thing and very low-level. Part of the reason that it is nowdays a bit better might be that one large OS vendor has turned away from PCKS#11 as primary method to access tokens.

NSS is very closely controlled by one vendor and worse it is a library which has been hacked together by the words of some standards without much thinking on whether it could be done better than stated in the standards. I was once involved in a project were we tried to renew Mozilla's S/MIME infrastructure to a modern profile so that it would have been useful for European administrations. The Mozilla Foundation refused our offer to do that and sticked for many more years to their barely unusable S/MIME stuff. Without the option to get our code into Mozilla we implemented it from scratch for GnuPG/Kmail/Mutt.

Gnome-keyring has been mentioned: It is less known that it hijacks the GnuPG interprocess communication (between gpgsm/gpg and gpg-agent) which has been the cause for many false bug reports and trouble. This badly reflects on the repudiation of GnuPG-2 because users notice only that gpg2/gpgsm do not work properly but can't see the real cause for it.

Now for some shameless self-advertising: For many years GnuPG provides nearly all the features the desktop crypto consolidation demands: X.509 key store and generation, OpenPGP stuff of course, ssh-agent with and without smartcards, re-use of keys for different protocols (in particular important for smartcards), clean separation of private and public keys (with 2.1-beta also for OpenPGP), a well tested and easily available smartcard with an open specification, passphrase cache (persistance is missing but easy to add), even an PKCS#11 interface to use GnuPG as a token, etc. This code is available for all kinds of platforms: Unix, Windows, WindowsCE, VMS. We have no marketing department, though.


(Log in to post comments)

PKCS#11 and GnuPG

Posted Aug 11, 2011 10:42 UTC (Thu) by HelloWorld (guest, #56129) [Link]

GnuPG may well be the solution to the problems described in the article, but why do you tell us instead of the article's author?

PKCS#11 and GnuPG

Posted Aug 11, 2011 15:34 UTC (Thu) by shpedoikal (subscriber, #33369) [Link]

Free or proprietary PKCS#11 implementations can be used without modifying an the application. I'd consider that supporting evidence that PKCS#11 is in fact well defined and I'd consider that a strength (WRT proprietary tokens) as opposed to a weakness.

PKCS#11 and GnuPG

Posted Aug 11, 2011 16:35 UTC (Thu) by dd9jn (subscriber, #4459) [Link]

Indeed some very basic operations are now working more or less flawless. But again, very basic standard operations only. If you want to do something more complicated which might even be asking for a special PIN or presenting more information it turns out to be a problem. Vendors then stretch the interpretation of PKCS#11 or fall back to the proprietary pkcs#11 extensions those who have been the cause for all the problems in the past.

PKCS#11 and GnuPG

Posted Aug 11, 2011 16:51 UTC (Thu) by stefw (guest, #75025) [Link]

I can understand your concerns.

As far as using the gnupg architecture instead of libraries like NSS... That's interesting to imagine, but that would be a massive undertaking (think army of developers, years of work).

There's really limited developer interest in the usability aspect of crypto, so we're working on gluing together libraries and stuff that already exists like NSS and GnuTLS. This means apps can work together with pretty minimal code and integration changes.

Part of the reason that I'm working on this is to make crypto more accessible and usable on the Desktop. I hope this will make it more interesting to get involved with. With the resulting interest and developer manpower, it's possible that a move to an architecture that's 'better' than PKCS#11 could take place.

As an aside, I think it'd be really cool to see someone work on a backend for Glib GIO TLS based around gnupg.

PKCS#11 and GnuPG

Posted Aug 11, 2011 17:13 UTC (Thu) by dd9jn (subscriber, #4459) [Link]

AFAIR, RedHat pushed for NSS because it has a FIPS certification and thus would make it easy to get RHEL FIPS certified. I don't know whether this is still the plan; I heard that they now plan to move all crypto into the Linux kernel to satisfy newer FIPS requirements.

Crypto usability is more important than discussions on whether SHA-1 or SHA-256 is appropriate. Actually everything should work without any user interactions. We are far away from such a goal.

For what do you really need PKCS#11? Shall we discuss this on a ML and see whether we can do something about it?

PKCS#11 and GnuPG

Posted Aug 11, 2011 19:06 UTC (Thu) by stefw (guest, #75025) [Link]

Yes, a great place to discuss it would be p11-glue@lists.freedesktop.org

http://lists.freedesktop.org/mailman/listinfo/p11-glue

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds