{"action":"created","issue":{"url":"https://api.github.com/repos/Yubico/yubico-piv-tool/issues/94","repository_url":"https://api.github.com/repos/Yubico/yubico-piv-tool","labels_url":"https://api.github.com/repos/Yubico/yubico-piv-tool/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/Yubico/yubico-piv-tool/issues/94/comments","events_url":"https://api.github.com/repos/Yubico/yubico-piv-tool/issues/94/events","html_url":"https://github.com/Yubico/yubico-piv-tool/issues/94","id":180486871,"number":94,"title":"ykcs11 performance problem","user":{"login":"dwmw2","id":911239,"avatar_url":"https://avatars.githubusercontent.com/u/911239?v=3","gravatar_id":"","url":"https://api.github.com/users/dwmw2","html_url":"https://github.com/dwmw2","followers_url":"https://api.github.com/users/dwmw2/followers","following_url":"https://api.github.com/users/dwmw2/following{/other_user}","gists_url":"https://api.github.com/users/dwmw2/gists{/gist_id}","starred_url":"https://api.github.com/users/dwmw2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwmw2/subscriptions","organizations_url":"https://api.github.com/users/dwmw2/orgs","repos_url":"https://api.github.com/users/dwmw2/repos","events_url":"https://api.github.com/users/dwmw2/events{/privacy}","received_events_url":"https://api.github.com/users/dwmw2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-01T23:58:36Z","updated_at":"2016-10-02T16:59:59Z","closed_at":null,"body":"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...\r\n\r\n```\r\n$ time openssl pkeyutl -engine pkcs11 -keyform engine -sign -in foo -out bar \\\r\n        -inkey 'pkcs11:model=YubiKey%20NEO;id=%01;pin-value=1234' \r\n#engine \"pkcs11\" set.\r\n\r\nreal\t0m3.771s\r\nuser\t0m0.033s\r\nsys\t0m0.019s\r\n```\r\nvs. OpenSC:\r\n```\r\n$ time openssl pkeyutl -engine pkcs11 -keyform engine -sign -in foo -out bar \\\r\n        -inkey 'pkcs11:manufacturer=piv_II;id=%01;pin-value=1234'\r\nengine \"pkcs11\" set.\r\n\r\nreal\t0m1.763s\r\nuser\t0m0.024s\r\nsys\t0m0.020s\r\n```"},"comment":{"url":"https://api.github.com/repos/Yubico/yubico-piv-tool/issues/comments/250981804","html_url":"https://github.com/Yubico/yubico-piv-tool/issues/94#issuecomment-250981804","issue_url":"https://api.github.com/repos/Yubico/yubico-piv-tool/issues/94","id":250981804,"user":{"login":"mouse07410","id":5923577,"avatar_url":"https://avatars.githubusercontent.com/u/5923577?v=3","gravatar_id":"","url":"https://api.github.com/users/mouse07410","html_url":"https://github.com/mouse07410","followers_url":"https://api.github.com/users/mouse07410/followers","following_url":"https://api.github.com/users/mouse07410/following{/other_user}","gists_url":"https://api.github.com/users/mouse07410/gists{/gist_id}","starred_url":"https://api.github.com/users/mouse07410/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mouse07410/subscriptions","organizations_url":"https://api.github.com/users/mouse07410/orgs","repos_url":"https://api.github.com/users/mouse07410/repos","events_url":"https://api.github.com/users/mouse07410/events{/privacy}","received_events_url":"https://api.github.com/users/mouse07410/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T16:59:59Z","updated_at":"2016-10-02T16:59:59Z","body":"And back off-topic. :-)\r\n\r\nI've added the appropriate (?) modules to the directories you mentioned (checked with `pkg-config` to make sure I'm not missing what p11tool` needs), but seem unable to get YKCS11 to work:\r\n```\r\n$ p11tool --list-all\r\nwarning: no token URL was provided for this operation; the available tokens are (with the NEO inserted):\r\n\r\npkcs11:model=p11-kit-trust;manufacturer=PKCS%2311%20Kit;serial=1;token=Default%20Trust\r\npkcs11:model=p11-kit-trust;manufacturer=PKCS%2311%20Kit;serial=1;token=System%20Trust\r\npkcs11:model=PKCS%2315%20emulated;manufacturer=piv_II;serial=a0fxxxxxx;token=PIV%20Card%20Holder%20pin%20%28PIV_II%29\r\npkcs11:model=YubiKey%20NEO;manufacturer=Yubico;serial=1234;token=YubiKey%20PIV\r\npkcs11:model=YubiKey%20NEO;manufacturer=Yubico;serial=1234;token=YubiKey%20PIV\r\npkcs11:model=YubiKey%20NEO;manufacturer=Yubico;serial=1234;token=YubiKey%20PIV\r\npkcs11:model=PKCS%2315%20emulated;manufacturer=piv_II;serial=a0fxxxxxx;token=PIV%20Card%20Holder%20pin%20%28PIV_II%29\r\n$  $ openssl pkeyutl -engine pkcs11 -keyform engine -sign -in t256.dat -out t256.dat.sig -inkey 'pkcs11:model=YubiKey%20NEO;id=%02;object-type=private'\r\nengine \"pkcs11\" set.\r\nSpecified object not found\r\nPKCS11_get_private_key returned NULL\r\ncannot load Private Key from engine\r\n140735271227472:error:26096080:engine routines:ENGINE_load_private_key:failed loading private key:eng_pkey.c:124:\r\nunable to load Private Key\r\nError initializing context\r\n$ openssl pkeyutl -engine pkcs11 -keyform engine -sign -in t256.dat -out t256.dat.sig -inkey 'pkcs11:id=%02;object-type=private'\r\nengine \"pkcs11\" set.\r\nPKCS#11 token PIN: \r\n$ \r\n```\r\n\r\nI have two modules:\r\n```\r\n$ cat /opt/local/share/p11-kit/modules/pkcs11.module \r\nmodule: /Library/OpenSC/lib/opensc-pkcs11.dylib\r\n$ cat /opt/local/share/p11-kit/modules/ykcs11.module \r\nmodule: /usr/local/lib/libykcs11.dylib\r\n$ \r\n```\r\n\r\nWhat seems to be wrong, in your opinion?"}}
{"actor":{"display_login":"mouse07410"}}