From: Douglas E E. <dee...@gm...> - 2015-12-01 04:29:26
|
On 11/30/2015 3:57 PM, Vincent Le Toux wrote: > Hi, > > I'm working on adding GIDS cards. This card is defined in a Microsoft specification. > https://msdn.microsoft.com/en-us/library/windows/hardware/dn642100%28v=vs.85%29.aspx > > The main advantage of this card is that it is the only card (except PIV cards) coming with a native minidriver (it do not need anything to be used immediately) and it is read/write with the minidriver. > What is unusual is that it is not a PKCS#15 card and it uses BER TLV files defined in the iso 7816-4:2013. The NIST PIV is not PKCS#15 either and uses a command called GET DATA but the command is 00:CB:3F:FF and it returns BER-TLV. NIST 800-73 does not define read/write APDUs. All access to objects is to be via GET DATA. pkcs15-piv.c emulate a PKCS#15 card providing file paths. card-piv.c has piv_select_file, piv_read_binary and piv_write_binary to override the normal select_file, read_binary and write_binary. piv_select_file takes the path and maps it to a container_id. The first piv_read_binary then uses the container_id with a GET DATA to read the whole object, and cache it. Subsequent read_binary will then return parts of the cached object. So as part of writing the emulation, the card driver gets control and can do whatever it need to do to read/write the data. Much of what you want to do can be done in your card driver, with little or no modifications to the common routines in OpenSC. and you may want to look at the routines in card-piv.c and pkcs15-piv.c If on the other hand, 7816-4:2013 use of this feature is likely to be used by other cards in the future, then a common routines make more sense. > > The BER TLV file is not known / defined in OpenSC. > This is a new value of the file descriptor byte (added in iso 7816-4:2013 7.4.5) whose value is: 0x39 (111001). (the second file type added is SIMPLE TLV structure) > Then each data is stored in a DO of this BER TLV file and is accessed with a GET DATA / PUT DATA ADPU. > > I would like to modify the sc_path_t structure to add a new type named SC_PATH_TYPE_FILE_ID_DO and modify the sc_pkcs15_read_file like functions to use getdata instead of read binary / read record > when accessing data. > => is it ok for you or do you have any comment ? > > Thanks in advance for your attention > > regards, > -- > -- > Vincent Le Toux > > My Smart Logon > www.mysmartlogon.com <http://www.mysmartlogon.com/> > > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > > > > _______________________________________________ > Opensc-devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensc-devel > -- Douglas E. Engert <DEE...@gm...> |