Andreas Jellinghaus wrote: > the old mechanism for selecting IDs was maybe too simple, so implementing > a better mechanism would be a good idea. I guess the card driver should > have some control over it, as different cards have different requirements. > > for example: > * with some cards, file index must be uniq (e.g. you can't have foo/A and > bar/A) > * some cards might want to set short ids (one byte global values for direct > reference) > * some cards might be limited - at least some special objects need to have > a "right" file ID. > > no idea how to actually implement it. if it breaks some or all cards, > now is a good time to make big changes, as we break ABI anyway. > > opensc reads all DF files on startup, so if a new ID is needed, a card > driver could (worst case) go through all DF entries and see which ones > are already in use to avoid conflicts? >
I'm going to replace the existing common mechanism for selecting IDs by the one based on the following rule: for a new pkcs15 object of a given type the file index is chosen as a first value in the range from 'file-id' to 'max-id', excluding the values that are already assigned to the file indexes of the existing pkcs15 objects of the same type. 'file-id' is defined in the template of the card profile; 'max-id' is hard coded value 0xFE (alternatively, can be also defined into card profile). Tested with CardOS (new API), and Oberthur (old API). Any objections? Later, I would like to add the possibility for the cards specific pkcs15init to implement its own procedure (something like existing 'select_key_reference' for the keys). > Regards, Andreas > > Kind wishes, Viktor. -- Viktor Tarasov <viktor.tara...@opentrust.com> _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel