Ticket #163 (new defect)

Opened 13 months ago

Last modified 11 months ago

bug in iso7816.c select_file()

Reported by: mrp Owned by: opensc-devel@…
Priority: high Milestone: 0.11.5
Component: opensc Version: 0.11.4
Severity: normal Keywords:
Cc:

Description

iso7816.c select_file() fails when called as

select_fail(card,&path,NULL)

if path.type=SC_PATH_TYPE_PARENT

The error is at the line 452 (the version I am using is the stable 0.11.4)

apdu.cse = SC_APDU_CASE_3_SHORT;

changing it to

apdu.cse = pathlen ? SC_APDU_CASE_3_SHORT : SC_APDU_CASE_1;

seems to fix the problem.

Change History

Changed 11 months ago by martin

  • priority changed from normal to high
  • version changed from 0.11.3 to 0.11.4
  • milestone set to 0.11.5

(ISO spec @ http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx#table58 tells that there is no data and thus CASE 2)

http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/iso7816.c#L435 Correctly sets the right APDU class.

So this is defintiely a bug.

Note: See TracTickets for help on using tickets.