-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ykcs11 performance problem #94
Comments
Semi-on-topic: how do you use OpenSSL with YKCS11? |
Um, as shown above? ☺ Although first I had to fix:
You might not need the last two, but you probably will need the first two. |
And now it should fairly much Just Work™ with any application in the system:
Note that I need to build curl against GnuTLS for it to work correctly. For curl built with OpenSSL you have to manually tell it to use engine_pkcs11 — although I'm about to fix that because it should work that out for itself if you give it a PKCS#11 URI, of course. And for NSS there are these two bugs with patches attached, after which it works. If you find any application in Fedora which doesn't Just Work™ then please file bugs. Other distributions are... distinctly less coherent about all this crypto stuff and many don't even have system-wide CA trust sorted out so that you trust a CA just once and it works for everyone. But why not file bugs there too :) |
No, not quite. In my system that would get Also, what does specifying |
This is what ticket #92 is about — on a modern system, p11-kit covers fairly much all of this for you. You install an appropriate module file to either the directory indicated by Now your PKCS#11 provider module is visible to well-behaved applications automatically. OpenSC is correctly packaged and does that for itself, of course. Having done the same for YKCS11, I now have both OpenSC and YKCS11 available (as well as the default trust roots and GNOME keyring's PKCS#11 module which are there by default):
So the There's nothing new here; this ought to be exactly how you use OpenSC or any other provider, surely? |
Getting back on-topic for this ticket, it looks like even for producing the output above, it's iterating over all the objects in the card twice. If I enable the
|
And back off-topic. :-) I've added the appropriate (?) modules to the directories you mentioned (checked with
I added two modules:
What seems to be wrong, in your opinion? |
What is engine_pkcs11 using as its default provider? It should be using |
Hmm... On Mac p11-kit does not seem to build
So in order to be able to use OpenSC and YKCS11 as you do, I have to have a working p11-kit? |
Perhaps it only builds if you have libffi? |
??? |
@martinpaljak did you ever resolve https://lists.freedesktop.org/archives/p11-glue/2014-December/000550.html |
@mouse07410 let's move the p11-kit discussion to OpenSC/libp11#117 In the meantime you can continue by using the
It looks like we're reading all the objects on the card, the moment each session is opened. Perhaps we could read them only on demand? |
@dwmw2 thanks for all your work on this stuff! In principle I am in favor of incorporating most of the changes you have had to implement. I see some of these are self-contained small diffs. If you want to take the credit for them you are welcome to submit a bunch of pull requests and I'll be merging them, otherwise I'll add them myself. For the "bigger" changes, as I said I agree with them in principle, but I think we should have a slightly different implementation. For example regarding #93 linking against zlib is fine, but I think that that part should be moved from the module into So, to make a long story short, what I'm trying to say is that this suggestions are valuable and will be addressed, alas not now. If in the meanwhile you are willing to contribute some time and code to the project pull requests are always welcome :) |
May I ask without offending, what was the "very specific problem" that YKCS11 addresses? I've been using the OpenSC support for a while, and using the Yubikey as the poster child for PKCS#11 support in places such as the OpenConnect PKCS#11 documentation and the Fedora packaging guidelines which say that any package accepting keys/certs on the command line or in a config file SHOULD also accept a PKCS#11 URI such as In that time, I haven't had cause even to file a bug against OpenSC, let alone to want a whole new PKCS#11 provider :) Regarding the specific fixes... I think I only filed one patch that wasn't an incompete proof-of-concept, to fix #91. I'm not too bothered about attribution, and it's almost a one-liner so it's probably as easy for you to fix that yourself, as it is for me to set about submitting it in a PR and having you merge it. |
Basically generating and importing keys, while also exposing the possibility of adding vendor specific flags to enable things like touch to sign on the YubiKey. And signing data. As I said before I think most of the suggestions make sense, being able to use ykcs11 as an OpenSSL engine is a nice addition. All right then, I'll try to incorporate some of your fixes and when I have more time to dedicate to this project improve it general. I just didn't want you (or anybody) to have the impression that this is considered dead. |
FYI: p11-kit-proxy.so was not being built on OS X due to a Makefile bug that has been reported at https://bugs.freedesktop.org/show_bug.cgi?id=98022 and fixed today. But you don't really need the proxy because it's just a symlink to |
You may well find that OpenSC would be interested in accepting that the Yubikey is a "PIV-like" device, not actually PIV, and supporting all of those directly. Thus excusing you from reimplementing all the external support gubbins, just for a few extra features :) |
I confirm the timing difference. YKCS11 takes roughly 3.5 times longer than OpenSC for the same (signing) operation (3.0 seconds vs. 0.85 seconds). Update
Actually, I think we both successfully use PIV-II driver of OpenSC to use Yubikey (and this driver already has some accommodations for some peculiarities of Yubico implementation of NIST SP 800-73-3), so I'm not sure what you mean by "PIV-like" as opposed to "PIV". And I think that signing data works fine now using Yubikey with OpenSC, unless I misunderstand what "sign data" means. |
yubico-piv-tool 2.0.0 contains a major upgrade to ykcs11. Please try with that version. |
In various usage, ykcs11 seems fairly slow. For a simple
openssl pkeyutl -sign
operation, ykcs11 seems to take quite a lot longer than OpenSC does...vs. OpenSC:
The text was updated successfully, but these errors were encountered: