cuihaoliang / seek-for-android

Automatically exported from code.google.com/p/seek-for-android
0 stars 0 forks source link

openBasicChannel doesn't work with default-selected cardlet on card #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What's the problem?

The openBasicChannel command doesn't work with cards that have a default 
selected cardlet on it.

What steps will reproduce the problem?

1. download the open mobile api sample from the seek-for-android website.
2. run the sample with a card that has a default selected cardlet on it.

What is the expected output? What do you see instead?

The sample code fails and displays a nullpointer error.
In the log-output you find a more detailed error report:
>>>
01-01 05:32:34.925: V/SmartcardService(6303): OpenBasicChannel Exception: 
Access Rule Enforcer: access denied:  ARA-M couldn't be selected: 
com.mobilesecuritycard.openmobileapi.service.CardException: MANAGE CHANNEL 
response too small
<<<

What version of the product are you using? On what operating system?
- MSC Smartcard Service 3.0 corresponds to Smartcard API version 2.4.0.
Android 2.3.3

Please provide any additional information below.

By stepping through the code it appears to me that the 
manageChannelCommand(0x00, 0x70, 0x00, 0x00, 0x01) is received by the 
cardlet(default selected) rather than the cardManager.

Original issue reported on code.google.com by pics.a...@gmail.com on 11 Mar 2013 at 2:43

GoogleCodeExporter commented 9 years ago
Commands like MANAGE CHANNEL or SELECT by name should be processed by the card 
registry, not the default selected applet (see GlobalPlatform SELECT command) 
as otherwise no other applet could get selected when a default one is in place.

card issue?

Original comment by Daniel.A...@gi-de.com on 15 Apr 2013 at 3:47

GoogleCodeExporter commented 9 years ago
Daniel, 
we use Sm@rtCafe Expert 5.0-cards. The SELECT command is always received by the 
card manager, so you can select any applet you want. The problem seems to 
appear only for the MANAGE CHANNEL command. What cards do you use? Can you run 
a test using default applets(install -priv 4 in gpshell) on your cards?

Thanks!

Original comment by pics.a...@gmail.com on 16 Apr 2013 at 11:33

GoogleCodeExporter commented 9 years ago
I've seen an issue here when I use the ApduTester.cap test applet.
It's an issue in the Applet code: when you send a SELECT command to the card 
with an invalid/not existing AID, the default selected applet receives this 
SELECT APDU. When the applet (like ApduTester.cap) does not throw an exception 
the invalid SELECT is returned with 9000.
-> reproducible with ApduTester.cap default selected but not with e.g. 
HelloSmartcard.cap 

Original comment by Daniel.A...@gi-de.com on 17 Apr 2013 at 8:44

GoogleCodeExporter commented 9 years ago
I think we found the reason for this complications.
We found out that cardlets that don't implement the "MultiSelectable" interface 
and are default selected do not accept the manage channel command (0070000001).
With "MultiSelectable"-applets this problem does not occur.
Is there a way to make MSC work with cardlets that are not multiselectable and 
default selected? 
We only need a basic channel, logical channels are not necessary.

Thanks
Andreas

Original comment by pics.a...@gmail.com on 18 Jun 2013 at 1:40