{"action":"created","issue":{"url":"https://api.github.com/repos/tpm2-software/tpm2-pkcs11/issues/81","repository_url":"https://api.github.com/repos/tpm2-software/tpm2-pkcs11","labels_url":"https://api.github.com/repos/tpm2-software/tpm2-pkcs11/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/tpm2-software/tpm2-pkcs11/issues/81/comments","events_url":"https://api.github.com/repos/tpm2-software/tpm2-pkcs11/issues/81/events","html_url":"https://github.com/tpm2-software/tpm2-pkcs11/issues/81","id":381306209,"node_id":"MDU6SXNzdWUzODEzMDYyMDk=","number":81,"title":"Login to two sessions raises assertion `t->login_session_ctx == NULL' failed.","user":{"login":"PeterHuewe","id":1458946,"node_id":"MDQ6VXNlcjE0NTg5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1458946?v=4","gravatar_id":"","url":"https://api.github.com/users/PeterHuewe","html_url":"https://github.com/PeterHuewe","followers_url":"https://api.github.com/users/PeterHuewe/followers","following_url":"https://api.github.com/users/PeterHuewe/following{/other_user}","gists_url":"https://api.github.com/users/PeterHuewe/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterHuewe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterHuewe/subscriptions","organizations_url":"https://api.github.com/users/PeterHuewe/orgs","repos_url":"https://api.github.com/users/PeterHuewe/repos","events_url":"https://api.github.com/users/PeterHuewe/events{/privacy}","received_events_url":"https://api.github.com/users/PeterHuewe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-15T19:28:12Z","updated_at":"2018-11-15T20:19:14Z","closed_at":null,"author_association":"MEMBER","body":"Full pkcs11 log:\r\n```\r\n0: C_GetFunctionList\r\n2018-11-15 20:19:38.963\r\nReturned:  0 CKR_OK\r\n\r\n1: C_Initialize\r\n2018-11-15 20:19:38.963\r\n[in] pInitArgs = 0x7e8c2d08\r\n     flags: 2\r\n       CKF_OS_LOCKING_OK\r\nReturned:  0 CKR_OK\r\n\r\n2: C_GetSlotList\r\n2018-11-15 20:19:38.972\r\n[in] tokenPresent = 0x1\r\n[out] pSlotList: \r\nCount is 1\r\n[out] *pulCount = 0x1\r\nReturned:  0 CKR_OK\r\n\r\n3: C_GetSlotList\r\n2018-11-15 20:19:38.973\r\n[in] tokenPresent = 0x1\r\n[out] pSlotList: \r\nSlot 1\r\n[out] *pulCount = 0x1\r\nReturned:  0 CKR_OK\r\n\r\n4: C_GetTokenInfo\r\n2018-11-15 20:19:38.974\r\n[in] slotID = 0x1\r\n[out] pInfo: \r\n      label:                  'testtokens                      '\r\n      manufacturerID:         'Intel                           '\r\n      model:                  'TPM2 PKCS#11    '\r\n      serialNumber:           '0000000000000000'\r\n      ulMaxSessionCount:       1024\r\n      ulSessionCount:          0\r\n      ulMaxRwSessionCount:     1024\r\n      ulRwSessionCount:        0\r\n      ulMaxPinLen:             128\r\n      ulMinPinLen:             5\r\n      ulTotalPublicMemory:     -1\r\n      ulFreePublicMemory:      -1\r\n      ulTotalPrivateMemory:    -1\r\n      ulFreePrivateMemory:     -1\r\n      hardwareVersion:         0.0\r\n      firmwareVersion:         0.0\r\n      time:                   '  20181115191938'\r\n      flags:                   405\r\n        CKF_RNG                          \r\n        CKF_LOGIN_REQUIRED               \r\n        CKF_TOKEN_INITIALIZED            \r\nReturned:  0 CKR_OK\r\n\r\n5: C_OpenSession\r\n2018-11-15 20:19:38.976\r\n[in] slotID = 0x1\r\n[in] flags = 0x6\r\npApplication=(nil)\r\nNotify=(nil)\r\n[out] *phSession = 0x1000000\r\nReturned:  0 CKR_OK\r\n\r\n6: C_Login\r\n2018-11-15 20:19:39.046\r\n[in] hSession = 0x1000000\r\n[in] userType = CKU_USER\r\n[in] pPin[ulPinLen] 01a8ae20 / 6\r\n    00000000  31 32 33 34 35 36                                123456          \r\nReturned:  0 CKR_OK\r\n\r\n7: C_GetSlotList\r\n2018-11-15 20:19:40.538\r\n[in] tokenPresent = 0x1\r\n[out] pSlotList: \r\nCount is 1\r\n[out] *pulCount = 0x1\r\nReturned:  0 CKR_OK\r\n\r\n8: C_GetSlotList\r\n2018-11-15 20:19:40.538\r\n[in] tokenPresent = 0x1\r\n[out] pSlotList: \r\nSlot 1\r\n[out] *pulCount = 0x1\r\nReturned:  0 CKR_OK\r\n\r\n9: C_GetSlotInfo\r\n2018-11-15 20:19:40.539\r\n[in] slotID = 0x1\r\n[out] pInfo: \r\n      slotDescription:        'bar                             '\r\n                              '                                '\r\n      manufacturerID:         'foo                             '\r\n      hardwareVersion:         42.42\r\n      firmwareVersion:         13.13\r\n      flags:                   5\r\n        CKF_TOKEN_PRESENT                \r\n        CKF_HW_SLOT                      \r\nReturned:  0 CKR_OK\r\n\r\n10: C_GetTokenInfo\r\n2018-11-15 20:19:40.539\r\n[in] slotID = 0x1\r\n[out] pInfo: \r\n      label:                  'testtokens                      '\r\n      manufacturerID:         'Intel                           '\r\n      model:                  'TPM2 PKCS#11    '\r\n      serialNumber:           '0000000000000000'\r\n      ulMaxSessionCount:       1024\r\n      ulSessionCount:          1\r\n      ulMaxRwSessionCount:     1024\r\n      ulRwSessionCount:        1\r\n      ulMaxPinLen:             128\r\n      ulMinPinLen:             5\r\n      ulTotalPublicMemory:     -1\r\n      ulFreePublicMemory:      -1\r\n      ulTotalPrivateMemory:    -1\r\n      ulFreePrivateMemory:     -1\r\n      hardwareVersion:         0.0\r\n      firmwareVersion:         0.0\r\n      time:                   '  20181115191940'\r\n      flags:                   405\r\n        CKF_RNG                          \r\n        CKF_LOGIN_REQUIRED               \r\n        CKF_TOKEN_INITIALIZED            \r\nReturned:  0 CKR_OK\r\n\r\n11: C_OpenSession\r\n2018-11-15 20:19:40.539\r\n[in] slotID = 0x1\r\n[in] flags = 0x6\r\npApplication=(nil)\r\nNotify=(nil)\r\n[out] *phSession = 0x1000001\r\nReturned:  0 CKR_OK\r\n\r\n12: C_Login\r\n2018-11-15 20:19:40.540\r\n[in] hSession = 0x1000001\r\n[in] userType = CKU_USER\r\n[in] pPin[ulPinLen] 01a8ae20 / 6\r\n    00000000  31 32 33 34 35 36                                123456          \r\npkcs11app: src/lib/session_ctx.c:310: session_ctx_login: Assertion `t->login_session_ctx == NULL' failed.\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tpm2-software/tpm2-pkcs11/issues/comments/439176492","html_url":"https://github.com/tpm2-software/tpm2-pkcs11/issues/81#issuecomment-439176492","issue_url":"https://api.github.com/repos/tpm2-software/tpm2-pkcs11/issues/81","id":439176492,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTE3NjQ5Mg==","user":{"login":"williamcroberts","id":17750791,"node_id":"MDQ6VXNlcjE3NzUwNzkx","avatar_url":"https://avatars0.githubusercontent.com/u/17750791?v=4","gravatar_id":"","url":"https://api.github.com/users/williamcroberts","html_url":"https://github.com/williamcroberts","followers_url":"https://api.github.com/users/williamcroberts/followers","following_url":"https://api.github.com/users/williamcroberts/following{/other_user}","gists_url":"https://api.github.com/users/williamcroberts/gists{/gist_id}","starred_url":"https://api.github.com/users/williamcroberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamcroberts/subscriptions","organizations_url":"https://api.github.com/users/williamcroberts/orgs","repos_url":"https://api.github.com/users/williamcroberts/repos","events_url":"https://api.github.com/users/williamcroberts/events{/privacy}","received_events_url":"https://api.github.com/users/williamcroberts/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T20:19:14Z","updated_at":"2018-11-15T20:19:14Z","author_association":"MEMBER","body":"> The is any_user_logged_in works only if the two sessions are created BEFORE the first login,\r\n> as the login event is propagated through all existing sessions.\r\n> \r\n> In my case unfortunately the second session is created after the login, and session open does not care whether the user is already logged in.\r\n> \r\n> Maybe the login state should be moved to the token/slot.\r\n\r\nOh jeez, I thought I had this covered it must have slipped my mind as I was doing it. I wanted to\r\ntwiddle a token level state variable at login and use that to initialize session state. Ill add it with a test\r\n\r\n> \r\n> > Can we replicate in the integration tests?\r\n> > I can try - should be easy with the log above\r\n\r\nAlready adding it.\r\n"}}
{"actor":{"display_login":"williamcroberts"}}