From: Iain M. <mu...@ds...> - 2006-03-27 17:54:37
|
Karsten Ohme wrote on 03/26/06 01:23 PM: > Iain MacDonnell wrote: >> >> Karsten Ohme wrote on 03/26/06 01:00 PM: >> >>> Karsten Ohme wrote: >>> >>>> Karsten Ohme wrote: >>>> >>>>> Karsten Ohme wrote: >>>>> >>>>> >>>>>> Iain MacDonnell wrote: >>>>> >>>>>>>> BTW, I've run into what appears to be a bigger problem - have you >>>>>>>> ever >>>>>>>> tried this stuff on a big-endian machine? >>> >>> I have run some big endian tests on a Solaris system running on a Sparc. >>> >>> For some reason the following happens: >>> >>> char *test = "EE"; >>> sscanf (test, "%02x", &temp); >>> >>> if temp is a char the conversion is always 00, if temp is an int, it >>> works. >>> >>> Please try out the GPShell version in CVS. I have fixed probably all >>> conversions, but I have no possibility to test it. >> >> I noticed that too - but when I changed AID to be int[], things broke a >> little later (in select_application(), where the data is copied into a >> BYTE[] buffer). > > AID is still a char array. > >> The 'hh' length modifier seems to be the easiest fix - what do you think >> of it ? > > In the man page of my Debian Linux system only h for short int is > mentioned, under Solaris in the man page it is not mentioned, so I don't > know, if it is portable. The length modifiers are apparently part of the ISO 9899:1999 (C99) spec. Solaris 10 has them, but Solaris 9 apparently doesn't. In Linux world, it appears you need glibc-2.1. I'll try out your other proposed fix ASAP. Thx, ~Iain >>>>>>>> # /opt/ITmuscle/bin/gpshell list-cflex.txt >>>>>>>> mode_201 >>>>>>>> enable_trace >>>>>>>> establish_context >>>>>>>> card_connect >>>>>>>> select -AID a0000000030000 >>>>>>>> --> 00A404000700000000000000 >>>>>>> >>>>>>> Note that the AID is not showing in this APDU... compared to >>>>>>> below.... >>>>>> >>>>>> Mmmh, this is a bigger problem. I will see to fix the conversion >>>>>> routines, if something like this is used, I'm not sure. >>>> >>>> This could be the guilty routine (?): >>>> >>>> It scans two bytes interpreted as a hex byte: >>>> >>>> while (sscanf (&(dummy[i*2]), "%02x", &(pOptionStr->AID[i])) > 0) { >>>> i++; >>>> } >>>> >>>> I will see. >>>> >>>> Karsten >>>> >>>> >>>>>> Thanks, Karsten >>>>>> >>>>>> >>>>>> >>>>>>>> <-- 6A82 >>>>>>>> select_application() returns 0x80216A82 (6A82: The application to be >>>>>>>> selected could not be found.) >>>>>>>> # uname -a >>>>>>>> SunOS sb150 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Blade-100 >>>>>>>> # >>>>>>>> >>>>>>>> >>>>>>>> Maybe the endianess is a red herring too ... but I've >>>>>>>> successfully used >>>>>>>> this stuff on Solaris x86... >>>>> >>>>> Mmmh, actually I use only byte arrays, no numbers, this should not >>>>> effect endianess. I will look into GPShell. >>>>> >>>>> Karsten >>>>> >>>>> >>>>> >>>>>>> Same card, same reader, same sources, but on Solaris x86: >>>>>>> >>>>>>> >>>>>>> # /opt/ITmuscle/bin/gpshell list-cflex.txt >>>>>>> mode_201 >>>>>>> enable_trace >>>>>>> establish_context >>>>>>> card_connect >>>>>>> select -AID a0000000030000 >>>>>>> --> 00A4040007A0000000030000 >>>>>>> <-- 6F188407A0000000030000A50D9F6E060005020201009F6501FF9000 >>>>>>> open_sc -security 1 -keyind 0 -keyver 0 -mac_key >>>>>>> 404142434445464748494a4b4c4d4e4f -enc_key >>>>>>> 404142434445464748494a4b4c4d4e4f // Open secure channel >>>>>>> --> 80500000088409FFE1A2E28B4600 >>>>>>> <-- 000012010000111401020101E86DFA173682E4673596888A215DE86C9000 >>>>>>> --> 8482010010C8207C7B2A3E416884B431EF23B61CD2 >>>>>>> <-- 9000 >>>>>>> get_status -element e0 >>>>>>> --> 80F2E000024F0000 >>>>>>> <-- >>>>>>> 07A0000000030000070007A0000000620001010007A0000000620101010007A0000000620102010007A0000000620201010007A0000000030000010005A000000001010006A0000000010107009000 >>>>>>> >>>>>>> >>>>>>> >>>>>>> List of applets (AID state privileges) >>>>>>> a0000000030000 7 0 >>>>>>> a0000000620001 1 0 >>>>>>> a0000000620101 1 0 >>>>>>> a0000000620102 1 0 >>>>>>> a0000000620201 1 0 >>>>>>> a0000000030000 1 0 >>>>>>> a000000001 1 0 >>>>>>> a00000000101 7 0 >>>>>>> card_disconnect >>>>>>> release_context >>>>>>> # >>>>>>> >>>>>>> ~Iain >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------- >>>>>>> This SF.Net email is sponsored by xPML, a groundbreaking scripting >>>>>>> language >>>>>>> that extends applications into web and mobile media. Attend the live >>>>>>> webcast >>>>>>> and join the prime developer group breaking into this new coding >>>>>>> territory! >>>>>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Globalplatform-users mailing list >>>>>>> Glo...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/globalplatform-users >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------- >>>>>> This SF.Net email is sponsored by xPML, a groundbreaking scripting >>>>>> language >>>>>> that extends applications into web and mobile media. Attend the >>>>>> live webcast >>>>>> and join the prime developer group breaking into this new coding >>>>>> territory! >>>>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >>>>>> >>>>>> _______________________________________________ >>>>>> Globalplatform-users mailing list >>>>>> Glo...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/globalplatform-users >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> This SF.Net email is sponsored by xPML, a groundbreaking scripting >>>>> language >>>>> that extends applications into web and mobile media. Attend the live >>>>> webcast >>>>> and join the prime developer group breaking into this new coding >>>>> territory! >>>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >>>>> >>>>> _______________________________________________ >>>>> Globalplatform-developers mailing list >>>>> Glo...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/globalplatform-developers >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.Net email is sponsored by xPML, a groundbreaking scripting >>>> language >>>> that extends applications into web and mobile media. Attend the live >>>> webcast >>>> and join the prime developer group breaking into this new coding >>>> territory! >>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >>>> _______________________________________________ >>>> Globalplatform-developers mailing list >>>> Glo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/globalplatform-developers >>> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by xPML, a groundbreaking scripting language >> that extends applications into web and mobile media. Attend the live >> webcast >> and join the prime developer group breaking into this new coding territory! >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >> _______________________________________________ >> Globalplatform-users mailing list >> Glo...@li... >> https://lists.sourceforge.net/lists/listinfo/globalplatform-users > |