From: Karsten O. <wid...@t-...> - 2006-10-20 10:26:50
|
Iain MacDonnell wrote: > > The next card on my list is a Cyberflex Access 64k V2c (Pegasus). I > had problems installing the MCardApplet, which I tracked down to the > ordering of the "Install Parameters Data Block". Following the > Cyberflex Access V2 Programmer's Guide, I get: > > EF04C8027FFFC900 > > but gpshell produces: > > C900EF04C8027FFF > > i.e. the C900 (application-specific install parameters) needs to be > after the instance size, not at the start. > > > So I get: > > install_for_install -priv 2 -AID A00000000101 -instAID A00000000101 > -pkgAID A000000001 -nvDataLimit 32767 > --> > 80E60C002005A00000000106A0000000010106A00000000101010208C900EF04C8027FFF0000 > > <-- 6A80 > install_for_install_and_make_selectable() returns 0x80206A80 (6A80: > Wrong data / Incorrect values in command data.) > > > Whereas the same APDU except with the ordering fixed: > > send_apdu -sc 1 -APDU > 80E60C002005A00000000106A0000000010106A00000000101010208EF04C8027FFFC9000000 > > Send APDU: 80 E6 0C 00 20 05 A0 00 00 00 01 06 A0 00 00 00 01 01 06 A0 > 00 00 00 01 01 01 02 08 EF 04 C8 02 7F FF C9 00 00 00 > --> > 80E60C002005A00000000106A0000000010106A00000000101010208EF04C8027FFFC9000000 > > <-- 009000 > Recv APDU: 00 90 00 > > > Not sure if this is a bug in GlobalPlatform, or in the card implementation? Open Platform specification: ---- Open Platform cards use the Application Specific Install parameter field (identified by the tag ‘C9’) to enable parameters specific to the installation of the application to be known to the application. If an application does not require application specific parameters the corresponding length contains '00'. This tag and those defined for system specific parameters requires that the install method parameter field contain at least the value ‘9F’ ‘00’. ---- The following tags may apply: ‘C9’ Variable Application specific parameters ‘EF’ Variable System specific parameters ‘C6’ 2 Non volatile code space limit ‘C7’ 2 Volatile data space limit ‘C8’ 2 Non volatile data space limit ---- So there seems no order to be defined. But the OpenPlatform specification is not clearly written in a lot of places. But also in GlobalPlatform 2.1.1 no order is defined. The following table identifies the possible tags for use in the install parameters field: 'C9' Variable Application Specific Parameters Mandatory 'EF' Variable System Specific Parameters Conditional 'C7' 2 Volatile data space limit Optional 'C8' 2 Non volatile data space limit Optional But, because of the order it may be assumed, that the order should be like this. But C7 and C8 are clearly subtags of EF. In the example of the CFlex card: ---- EF 04 C8 02 || length(instance data in EEPROM) || C9 || L1 || xx xx || C702 || RAM resources ---- C7 is not a subtag. This is wrong. And E4 must comprise all system specific parameters. the length 04 is so also not correct. So at least the card must accept the correct format. Well, at the moment I know no good solution how to fix this behavior of the card. Maybe at connect time some argument should be passed, so that the library can handle the different quirks of cards. It could sometimes be assumed, that some implementations out there are outside of the specification on purpose, so that own tools can be sold. For CFlex cards there is a card manual publicly available, but a lot of manufacturers make a secret out of their cards. Karsten > > ~Iain > > |