{"action":"created","issue":{"url":"https://api.github.com/repos/OpenSC/OpenSC/issues/804","repository_url":"https://api.github.com/repos/OpenSC/OpenSC","labels_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/804/labels{/name}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/804/comments","events_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/804/events","html_url":"https://github.com/OpenSC/OpenSC/pull/804","id":161200040,"number":804,"title":"Improve file caching","user":{"login":"frankmorgner","id":1266577,"avatar_url":"https://avatars.githubusercontent.com/u/1266577?v=3","gravatar_id":"","url":"https://api.github.com/users/frankmorgner","html_url":"https://github.com/frankmorgner","followers_url":"https://api.github.com/users/frankmorgner/followers","following_url":"https://api.github.com/users/frankmorgner/following{/other_user}","gists_url":"https://api.github.com/users/frankmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/frankmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankmorgner/subscriptions","organizations_url":"https://api.github.com/users/frankmorgner/orgs","repos_url":"https://api.github.com/users/frankmorgner/repos","events_url":"https://api.github.com/users/frankmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/frankmorgner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-20T13:52:44Z","updated_at":"2016-06-29T15:35:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenSC/OpenSC/pulls/804","html_url":"https://github.com/OpenSC/OpenSC/pull/804","diff_url":"https://github.com/OpenSC/OpenSC/pull/804.diff","patch_url":"https://github.com/OpenSC/OpenSC/pull/804.patch"},"body":"- uses the static UID of a contactless card for caching if a serial number in EF.TokenInfo is not (yet) available\r\n- uses caching transparently. i.e. the user only needs to change the configuration file without calling `pkcs15-tool -L` anymore. @martinpaljak are there any historic reasons why this has never been done before?"},"comment":{"url":"https://api.github.com/repos/OpenSC/OpenSC/issues/comments/229395152","html_url":"https://github.com/OpenSC/OpenSC/pull/804#issuecomment-229395152","issue_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/804","id":229395152,"user":{"login":"viktorTarasov","id":250674,"avatar_url":"https://avatars.githubusercontent.com/u/250674?v=3","gravatar_id":"","url":"https://api.github.com/users/viktorTarasov","html_url":"https://github.com/viktorTarasov","followers_url":"https://api.github.com/users/viktorTarasov/followers","following_url":"https://api.github.com/users/viktorTarasov/following{/other_user}","gists_url":"https://api.github.com/users/viktorTarasov/gists{/gist_id}","starred_url":"https://api.github.com/users/viktorTarasov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viktorTarasov/subscriptions","organizations_url":"https://api.github.com/users/viktorTarasov/orgs","repos_url":"https://api.github.com/users/viktorTarasov/repos","events_url":"https://api.github.com/users/viktorTarasov/events{/privacy}","received_events_url":"https://api.github.com/users/viktorTarasov/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T15:35:17Z","updated_at":"2016-06-29T15:35:17Z","body":">>why file-cache and use-uid are in the same PR?\r\n\r\n>Do you mean to create a separate PR for 40ce9300ef63e1ff850d6009f77633dc5aa8a9b5? I could do that, if you think this will receive more peer review, if you like. It's just something that I wrote and tested together.\r\n\r\nOk, I see, no need to split,\r\nknowing your sensibility to the purity of commits or PRs, I've imagined that there is some deep hidden sense in that.\r\n\r\n>>why uid is the attribute of reader and not of card?\r\n\r\n>Because the attribute is technically fetched *from the reader* with a pseudo-APDU (CLA=0xFF). It's the same mimic as with ATR. The UID is then copied to the card, which is just what we are doing with the ATR.\r\n\r\nDoes UID is used somehow on the reader level?\r\nATR contains the communication details that are directly used by reader to adjust electric interface with card. And UID?\r\n\r\n>>- do we need to treat situation when both serial-number and uid are available?\r\n\r\n>With my PR, if  a serial-number is available it supersedes the UID. This allows\r\n- backward compatibility with the previous implementation, i.e. previously cached files by S/N are still valid.\r\n- caching files when the S/N is not yet available, e.g. the PKCS#15 meta data.\r\n\r\nSo, the answer is _not_. UID is used only when SN is absent, and it's role is limited by the role of SN. Isn't it?\r\n\r\n\r\n>>why to not simply preset the UID as serial-number, if the last one is not available. And do it on the pkcs15 emulation level, without introducing a new global data members.\r\n\r\n>The only new global attribute that is introduced is the UID. As a matter of fact it *is a global card property*, just like the ATR. Caching (by UID/file) is still treated on the PKCS#15 layer.\r\n\r\nBeside the _unique-identifier_ role does _UID_ have any other ? If not, there is already placehold for the _unique-identifier_ -- serial number. Afaiu, the absent SN can be replaced by UID very early, on the card level, during the card connection. \r\n\r\n>But indeed, i thought of moving file caching to the card driver level, because this would allow caching files in the card's `init` callback, where PKCS#15 (emulation) is not yet initialized. But, to be honest, I was a bit too lazy to do so much refactoring :wink: . Nevertheless, I think this could actually be very useful in the future if someone finds time to implement this.\r\n\r\nMy questions were not about file caching, but about the role of UID .\r\n\r\n"}}
{"actor":{"display_login":"viktorTarasov"}}