{"action":"closed","issue":{"url":"https://api.github.com/repos/OpenSC/libp11/issues/245","repository_url":"https://api.github.com/repos/OpenSC/libp11","labels_url":"https://api.github.com/repos/OpenSC/libp11/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/OpenSC/libp11/issues/245/comments","events_url":"https://api.github.com/repos/OpenSC/libp11/issues/245/events","html_url":"https://github.com/OpenSC/libp11/issues/245","id":355130484,"node_id":"MDU6SXNzdWUzNTUxMzA0ODQ=","number":245,"title":"Should libp11 call C_Initialize when being forked?","user":{"login":"jschmidb","id":34024122,"node_id":"MDQ6VXNlcjM0MDI0MTIy","avatar_url":"https://avatars1.githubusercontent.com/u/34024122?v=4","gravatar_id":"","url":"https://api.github.com/users/jschmidb","html_url":"https://github.com/jschmidb","followers_url":"https://api.github.com/users/jschmidb/followers","following_url":"https://api.github.com/users/jschmidb/following{/other_user}","gists_url":"https://api.github.com/users/jschmidb/gists{/gist_id}","starred_url":"https://api.github.com/users/jschmidb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jschmidb/subscriptions","organizations_url":"https://api.github.com/users/jschmidb/orgs","repos_url":"https://api.github.com/users/jschmidb/repos","events_url":"https://api.github.com/users/jschmidb/events{/privacy}","received_events_url":"https://api.github.com/users/jschmidb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"mtrojnar","id":13538198,"node_id":"MDQ6VXNlcjEzNTM4MTk4","avatar_url":"https://avatars3.githubusercontent.com/u/13538198?v=4","gravatar_id":"","url":"https://api.github.com/users/mtrojnar","html_url":"https://github.com/mtrojnar","followers_url":"https://api.github.com/users/mtrojnar/followers","following_url":"https://api.github.com/users/mtrojnar/following{/other_user}","gists_url":"https://api.github.com/users/mtrojnar/gists{/gist_id}","starred_url":"https://api.github.com/users/mtrojnar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtrojnar/subscriptions","organizations_url":"https://api.github.com/users/mtrojnar/orgs","repos_url":"https://api.github.com/users/mtrojnar/repos","events_url":"https://api.github.com/users/mtrojnar/events{/privacy}","received_events_url":"https://api.github.com/users/mtrojnar/received_events","type":"User","site_admin":false},"assignees":[{"login":"mtrojnar","id":13538198,"node_id":"MDQ6VXNlcjEzNTM4MTk4","avatar_url":"https://avatars3.githubusercontent.com/u/13538198?v=4","gravatar_id":"","url":"https://api.github.com/users/mtrojnar","html_url":"https://github.com/mtrojnar","followers_url":"https://api.github.com/users/mtrojnar/followers","following_url":"https://api.github.com/users/mtrojnar/following{/other_user}","gists_url":"https://api.github.com/users/mtrojnar/gists{/gist_id}","starred_url":"https://api.github.com/users/mtrojnar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtrojnar/subscriptions","organizations_url":"https://api.github.com/users/mtrojnar/orgs","repos_url":"https://api.github.com/users/mtrojnar/repos","events_url":"https://api.github.com/users/mtrojnar/events{/privacy}","received_events_url":"https://api.github.com/users/mtrojnar/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2018-08-29T12:09:59Z","updated_at":"2018-08-30T18:00:04Z","closed_at":"2018-08-30T18:00:04Z","author_association":"NONE","body":"I have a setup with Apache, mod_ssl, libp11, and opencryptoki. I see that C_Initialize is not called when libp11 is being forked by Apache. Refer to the standard here:\r\nhttp://docs.oasis-open.org/pkcs11/pkcs11-ug/v2.40/cn02/pkcs11-ug-v2.40-cn02.html#_Toc406759985\r\n\r\n> Consider a UNIX process P which becomes a Cryptoki application by calling C_Initialize, and then uses the fork() system call to create a child process C.  Since P and C have separate address spaces (or will when one of them performs a write operation, if the operating system follows the copy-on-write paradigm), they are not part of the same application.  **Therefore, if C needs to use Cryptoki, it needs to perform its own C_Initialize call**.  Furthermore, if C needs to be logged into the token(s) that it will access via Cryptoki, it needs to log into them even if P is already logged in, since P and C are completely separate applications.\r\n\r\nOpencryptoki cannot be used in the fork unless C_Initialize is called again in the forked process. "}}
{"actor":{"display_login":"mtrojnar"}}