{"action":"created","issue":{"url":"https://api.github.com/repos/opendnssec/SoftHSMv2/issues/199","repository_url":"https://api.github.com/repos/opendnssec/SoftHSMv2","labels_url":"https://api.github.com/repos/opendnssec/SoftHSMv2/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/opendnssec/SoftHSMv2/issues/199/comments","events_url":"https://api.github.com/repos/opendnssec/SoftHSMv2/issues/199/events","html_url":"https://github.com/opendnssec/SoftHSMv2/pull/199","id":139579164,"number":199,"title":"The slot ID of a token should always be the same","user":{"login":"larssilven","id":6523478,"avatar_url":"https://avatars.githubusercontent.com/u/6523478?v=3","gravatar_id":"","url":"https://api.github.com/users/larssilven","html_url":"https://github.com/larssilven","followers_url":"https://api.github.com/users/larssilven/followers","following_url":"https://api.github.com/users/larssilven/following{/other_user}","gists_url":"https://api.github.com/users/larssilven/gists{/gist_id}","starred_url":"https://api.github.com/users/larssilven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larssilven/subscriptions","organizations_url":"https://api.github.com/users/larssilven/orgs","repos_url":"https://api.github.com/users/larssilven/repos","events_url":"https://api.github.com/users/larssilven/events{/privacy}","received_events_url":"https://api.github.com/users/larssilven/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-03-09T13:38:57Z","updated_at":"2016-03-13T20:39:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opendnssec/SoftHSMv2/pulls/199","html_url":"https://github.com/opendnssec/SoftHSMv2/pull/199","diff_url":"https://github.com/opendnssec/SoftHSMv2/pull/199.diff","patch_url":"https://github.com/opendnssec/SoftHSMv2/pull/199.patch"},"body":"It would be good if a specific token always could be fetched from a slot with a specific ID.\r\nNow the slot ID where a specific token is found is often changed after a new token is initialized.\r\n\r\nThe reason is that there are applications that are not using C_GetSlotList but are assuming that a token will always be in a slot with the same ID. Of course the best thing should be to change the application to use C_GetSlotList  and then find the slotID with serial or label. But unfortunate you don't always have the possibility to change the code. An example is the [SunPKCS11 java provider](http://docs.oracle.com/javase/8/docs/technotes/guides/security/p11guide.html#Config). Most java application that are using p11 tokens are using this provider.\r\n\r\nThis patch sets the slot ID to the 31 LSBs (the ID is configured as a java int that can not be negative in SunPKCS11) of the token serial. Uninitialized tokens will get slot with ID as before.\r\n\r\nThe patch is also containing #198 since I need to have it in the branch that I am testing."},"comment":{"url":"https://api.github.com/repos/opendnssec/SoftHSMv2/issues/comments/196048557","html_url":"https://github.com/opendnssec/SoftHSMv2/pull/199#issuecomment-196048557","issue_url":"https://api.github.com/repos/opendnssec/SoftHSMv2/issues/199","id":196048557,"user":{"login":"bellgrim","id":820594,"avatar_url":"https://avatars.githubusercontent.com/u/820594?v=3","gravatar_id":"","url":"https://api.github.com/users/bellgrim","html_url":"https://github.com/bellgrim","followers_url":"https://api.github.com/users/bellgrim/followers","following_url":"https://api.github.com/users/bellgrim/following{/other_user}","gists_url":"https://api.github.com/users/bellgrim/gists{/gist_id}","starred_url":"https://api.github.com/users/bellgrim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bellgrim/subscriptions","organizations_url":"https://api.github.com/users/bellgrim/orgs","repos_url":"https://api.github.com/users/bellgrim/repos","events_url":"https://api.github.com/users/bellgrim/events{/privacy}","received_events_url":"https://api.github.com/users/bellgrim/received_events","type":"User","site_admin":false},"created_at":"2016-03-13T20:39:33Z","updated_at":"2016-03-13T20:39:33Z","body":"Ok, lets go with setting the slotID to the token serial.\r\n\r\nThis would also prioritize adding token label / serial support to the support tools. #143 "}}