{"action":"created","issue":{"url":"https://api.github.com/repos/OpenSC/OpenSC/issues/882","repository_url":"https://api.github.com/repos/OpenSC/OpenSC","labels_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/882/labels{/name}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/882/comments","events_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/882/events","html_url":"https://github.com/OpenSC/OpenSC/pull/882","id":180929758,"number":882,"title":"libopensc: allow setting driver via OPENSC_DRIVER environment variable","user":{"login":"lbschenkel","id":1428661,"avatar_url":"https://avatars.githubusercontent.com/u/1428661?v=3","gravatar_id":"","url":"https://api.github.com/users/lbschenkel","html_url":"https://github.com/lbschenkel","followers_url":"https://api.github.com/users/lbschenkel/followers","following_url":"https://api.github.com/users/lbschenkel/following{/other_user}","gists_url":"https://api.github.com/users/lbschenkel/gists{/gist_id}","starred_url":"https://api.github.com/users/lbschenkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbschenkel/subscriptions","organizations_url":"https://api.github.com/users/lbschenkel/orgs","repos_url":"https://api.github.com/users/lbschenkel/repos","events_url":"https://api.github.com/users/lbschenkel/events{/privacy}","received_events_url":"https://api.github.com/users/lbschenkel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-04T15:41:10Z","updated_at":"2016-10-06T14:35:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/882","html_url":"https://github.com/OpenSC/OpenSC/pull/882","diff_url":"https://github.com/OpenSC/OpenSC/pull/882.diff","patch_url":"https://github.com/OpenSC/OpenSC/pull/882.patch"},"body":"When you have cards with multiple supported applets (such as the YubiKey with OpenPGP+PIV and any other GlobalPlatform card) it is very convenient to be able to temporarily override the selected card driver and use a different applet than it would be selected by default without having to create and maintain a completely separate config file.\r\n\r\nI'm proposing that the driver name could be specified via an environment variable, so in case the driver is not forced by the client the variable would override the auto-selection mechanism. I have been trying this for a while and it proved to be very useful, especially when using the PKCS#11 module: I can easily use the OpenPGP keys in one program and the PIV certificates in another. The change is so small and localized that I feel it is worth to incorporate that into the codebase. \r\n\r\nThis PR is for mostly to start this conversation and for feedback. The proposed variable name is just a suggestion."},"comment":{"url":"https://api.github.com/repos/OpenSC/OpenSC/issues/comments/251981681","html_url":"https://github.com/OpenSC/OpenSC/pull/882#issuecomment-251981681","issue_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/882","id":251981681,"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},"created_at":"2016-10-06T14:35:38Z","updated_at":"2016-10-06T14:35:38Z","body":"You may call that flawed, but that is what people want to happen. Insert card, enter PIN once (maybe by pin pad reader which means the PIN can not be cached) and have access to it from all their applications. The software today can almost support this for read only cards used in PCSC shared mode, as long as only one applet used on the card and all host applications are careful to test if the card state is unlocked, and they don't reset or lose the login state. Even the OS can cause problems they may time out operations or power down the USB reader! See the opensc.conf  \"reader_driver pcsc\" to use exclusive mode, or shared mode. \r\n  "}}
{"actor":{"display_login":"dengert"}}