Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
lmadarassy
Posts: 7
Registered: ‎09-10-2013
My Device: Z10
My Carrier: T-Mobile

Transmit apdu - CLA problem

Hi,

 

I have found an interesting problem when I'm trying to send apdu to my javacard applet.

I have defined the CLA 80 for my applet's cla and a have sent this apsu to:

80200000020101

I have debugged, the BB app sendind this apdu:

82200000020101

I have debugged a bit and found the following results:

sending CLA 80 resulting 82

sending CLA 81 resulting 82

sending CLA 82 resulting 82

sending CLA 89 resulting 8a

It seems BB don't like non iso standard cla and it will modify.

Any reason for this?

 

Laszlo

Please use plain text.
BlackBerry Development Advisor (Retired)
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: Transmit apdu - CLA problem

Yes

 

:-)

 

Let me do some digging and see what I can come back with.

 

Regards

 

Martin

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Please use plain text.
BlackBerry Development Advisor (Retired)
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: Transmit apdu - CLA problem

In fact...... the last 2 bits of CLA control the channel your command is sent over. We set that for you hence the change you're seeing. This is from iso7816-4.
--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Please use plain text.
New Contributor
lmadarassy
Posts: 7
Registered: ‎09-10-2013
My Device: Z10
My Carrier: T-Mobile

Re: Transmit apdu - CLA problem

Hi,

 

Thanks for the reply. I'm not planning to use multi selectable applets. Are there any to communicate with my applet through secure element without logical channels? 

 

Laszlo

 

Please use plain text.
BlackBerry Development Advisor (Retired)
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: Transmit apdu - CLA problem

No. All carrier/GSMA requirement specifications as well as the OpenMobile spec forbid access to the basic channel on the UICC for applications so we do not allow it.

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Please use plain text.
New Contributor
lmadarassy
Posts: 7
Registered: ‎09-10-2013
My Device: Z10
My Carrier: T-Mobile

Re: Transmit apdu - CLA problem

Hi,

 

Thank you for the help! I have solved the problem on the applet side, but I have an other problem now:

I'm using pin code on the applet to restrict some features. If I authenticate with the pin, it will be authenticated when I turn off the phone or select applet again.

On Blackberry, when I send an APDU it will first select the applet, so I cannot use the pin feature, because on the next command it will select the applet again and the pin will be unverified again.

Now I made a workaround on the applet to store the authentication state separately, but it has security problems.

The question is:

Can I run multiple APDU commands without selecting the applet after every command?

 

Laszlo

Please use plain text.
BlackBerry Development Advisor (Retired)
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: Transmit apdu - CLA problem

Yes you can send multiple APDU after selecting the applet. To be clear, by "select" you mean calling nfc_se_session_open_logical_channel from the application which of course performs the ISO7816-4 SELECT behind the scenes.

 

Can you clarify the issue you're seeing and share the related fragment of your code please?

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Please use plain text.