{"comment":{"url":"https://api.github.com/repos/OpenSC/libp11/comments/17223633","html_url":"https://github.com/OpenSC/libp11/commit/874154bc49d28c1358037f923e8d773ba0472b9d#commitcomment-17223633","id":17223633,"user":{"login":"dengert","id":865329,"avatar_url":"https://avatars.githubusercontent.com/u/865329?v=3","gravatar_id":"","url":"https://api.github.com/users/dengert","html_url":"https://github.com/dengert","followers_url":"https://api.github.com/users/dengert/followers","following_url":"https://api.github.com/users/dengert/following{/other_user}","gists_url":"https://api.github.com/users/dengert/gists{/gist_id}","starred_url":"https://api.github.com/users/dengert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dengert/subscriptions","organizations_url":"https://api.github.com/users/dengert/orgs","repos_url":"https://api.github.com/users/dengert/repos","events_url":"https://api.github.com/users/dengert/events{/privacy}","received_events_url":"https://api.github.com/users/dengert/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"874154bc49d28c1358037f923e8d773ba0472b9d","created_at":"2016-04-23T12:05:31Z","updated_at":"2016-04-23T12:05:31Z","body":"When running in to problems like this with libp11, can you please specify what PKCS#11 module\nyou are using? The problems you are seeing may be an issue with the module and not libp11.\n\nAlso please provide the OpenSC SPY output to show what PKCS#11 functions are called are\nwhat the functions return. The OpenSC SPY can be used with *ANY* PKCS#11 module.\n\nThe OpenSC pkcs11 module goes to extra lengths to make sure the EC parameters\nare provided for both the pubkey and privkey. Libp11 will go as far as to read the pubkey\nto find the parameters when a request for the privkey is made.\n\nOn some cards, (PIV at least) the card does not contain a pubkey. The only way to find EC\nthe parameters is from the matching certificate on the card. The OpenSC card driver will\nread the certificate which contains the pubkey with the EC named curve.\n\nThe point I am trying to make is what you perceive to be a libp11 issue may be an issue with the\nPKCS#11 module you are using.\n\nSee how to use SPY here:\nhttps://github.com/OpenSC/OpenSC/wiki/Using-OpenSC\n\n\nOn 4/23/2016 4:50 AM, David von Oheimb wrote:\n> Nice that the new code also lincludes strictness on the EC params of public keys.\n>\n> For curiosity, I tested the above mentioned use cases on EC pubkeys having a point but no params:\n> The first one also crashes, while the latter returns the following neat OpenSSL error:\n>\n> |2675996:error:100DF07C:elliptic curve routines:ECKEY_PARAM2TYPE:missing parameters:ec_ameth.c:78: 2675996:error:100D8010:elliptic curve routines:ECKEY_PUB_ENCODE:EC lib:ec_ameth.c:114:\n> 2675996:error:0B07807E:x509 certificate routines:X509_PUBKEY_set:public key encode error:x_pubkey.c:103: |\n>\n> I just came across a related problem where points and params are expected also for EC private keys, but that's worth a new issue.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly or view it on GitHub <https://github.com/OpenSC/libp11/commit/874154bc49d28c1358037f923e8d773ba0472b9d#commitcomment-17223365>\n>\n\n-- \n\n  Douglas E. Engert  <DEEngert@gmail.com>\n\n"}}