Fwd: SC_PATH_TYPE_DF_NAME

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: SC_PATH_TYPE_DF_NAME

Galoh Haron
Hello,

In opensc0.12.2, this code works.

sc_format_path (aid, &app);
app.type = SC_PATH_TYPE_DF_NAME;
r = sc_get_iso7816_driver()->ops->select_file( card, &app, NULL );

the debug output is
00 A4 04 00 0A 50 4B 49 41 50 50 00 00 00 01 .....PKIAPP....

how ever in opensc 0.13.0, the same code give output of
00 A4 04 0C 0A 50 4B 49 41 50 50 00 00 00 01 .....PKIAPP....

with different in the 4th column. 00 ->0C.

Any new way to handle the SC_PATH_TYPE_DF_NAME in opensc0.13.0

Thank you

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: SC_PATH_TYPE_DF_NAME

Douglas E. Engert


On 2/6/2013 9:44 PM, Galoh Haron wrote:

> Hello,
>
> In opensc0.12.2, this code works.
>
> sc_format_path (aid, &app);
> app.type = SC_PATH_TYPE_DF_NAME;
> r = sc_get_iso7816_driver()->ops->select_file( card, &app, NULL );
>
> the debug output is
> 00 A4 04 00 0A 50 4B 49 41 50 50 00 00 00 01 .....PKIAPP....
>
> how ever in opensc 0.13.0, the same code give output of
> 00 A4 04 0C 0A 50 4B 49 41 50 50 00 00 00 01 .....PKIAPP....
>
> with different in the 4th column. 00 ->0C.
>
> Any new way to handle the SC_PATH_TYPE_DF_NAME in opensc0.13.0

the 0.13.0 iso7816.c has:

  465         if (file_out != NULL) {
  466                 apdu.p2 = 0;            /* first record, return FCI */
  467                 apdu.resp = buf;
  468                 apdu.resplen = sizeof(buf);
  469                 apdu.le = card->max_recv_size > 0 ? card->max_recv_size : 256;
  470         }
  471         else {
  472                 apdu.p2 = 0x0C;         /* first record, return nothing */
  473                 apdu.cse = (apdu.lc == 0) ? SC_APDU_CASE_1 : SC_APDU_CASE_3_SHORT;
  474         }

line 472 is new in 0.13.0
p2=0C Is "RFU" in the 1995 ISO7816, but may be defined in a newer version.
The comment implies it is, and is the way to specify don't return anything.

A p2=00 is defined to return the FCI, but your code is passing NULL for the
for file_out, implying not to return anything.

So if you card can not handle p2=0c, provide a file_out parameter.


>
> Thank you
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Opensc-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel
>

--

  Douglas E. Engert  <[hidden email]>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel