Hello, On Mar 25, 2011, at 20:44 , Douglas E. Engert wrote: > On 3/25/2011 1:22 PM, Martin Paljak wrote: >> >> On Mar 25, 2011, at 20:19 , webmas...@opensc-project.org wrote: >> >>> Revision: 5271 >>> Author: vtarasov >>> Date: 2011-03-25 18:19:28 +0000 (Fri, 25 Mar 2011) >>> >>> Log Message: >>> ----------- >>> cardmod: when getting serial number use GET_SERIAL ctl call ... >>> >>> rather then card->serialnr value. Not all card drivers initialize this >>> member. >> >> >> Feel free to file a bug for this as well, to make sure that >> active/"compliant" drivers would implement it consistently. > > An interesting side note: The PIV driver is designed to use the PIV > application > on whatever type of card it is on. The PIV specs do not define how to > retrieve the > serial number. And no attempt is made to get the actual serial number from > the card. > > But the OpenSC PIV code and the Microsoft code need something to use as a > serial number, > and both do this by reading one of the objects define by NIST, the CHUID, and > get either > the FASC-N or the GUID in this object to use as a "serial number". These are > unique. > > So even if a card contained 2 PIV applications, or a PIV application > and some other application they might have different serial numbers. > > So it is not clear if the card->serialnr should be set.
Maybe I don't know the background but the serial number of the card object is only to distinguish between two cards of the same type. Maybe the field (and/or control code) should be renamed to "unique id" or something more specific, as different profiles have different ideas for a serial number. ICC serial number vs visual ID serial number vs other stuff. Martin _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel