Replies: 3 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Also, have a look at your hello world application code - how it should handle select commands and what it should return. If select returns error or throws, you should get 6999 response instead, not 6700 or 6a82 |
Beta Was this translation helpful? Give feedback.
1 reply
-
Also, get a better reader than this https://github.com/martinpaljak/NFC4PC/wiki/Supported-readers |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I was playing with a dual-interface smartcard I obtained. I don't know a lot about the Java Card ecosystem and I'm mostly learning with the little information that is available online.
I successfully built uploaded a test applet using this javacard gradle template and I was able to communicate with it via APDU.
I decided I wanted to try making it default-selected, so in order to do that I added the
--default
flag during installation, which didn't work (I don't remember the error, this was yesterday and I no longer have those logs). Reading StackOverflow threads I understood that "default selected" is what happens when you give the applet theCardReset
privilege, so I also added--privs CardReset
and that didn't fail andgpp -l
did show that theCardReset
privilege was applied. I then added some code to theselect()
method so it would be executed when the default applet was selected but nothing seemed to happen unless I explicitly selected its AID.That was yesterday. I went to sleep and tried again this morning to find out that I can no longer select anything on the card: any select over NFC returns
6A82
. Having understood from the internet that the applet installation is performed by a "security domain" (which I still don't entirely understand what is) and having left open overnight a terminal window with some GPP logs from yesterday showing listings from before and after the permission change, I was able to figure out that the security domain AID isA000000151000000
, so I triedgpp -ld -c A000000151000000
. This also returns6A82
over the contactful interface, but over the contactless interface it now returns6700
(all other selects I tried seem to still return6A82
)My uneducated guess is that my code inside
select()
is throwing an exception and that's somehow messing everything up. I'm guessing this might be the case because earlier, before trying any of the default-selected/card reset stuff, I uploaded some buggy code that was throwing an exception inselect()
and it was returning6A82
as well.My questions are:
I saw #331 but that didn't seem to lead anywhere, and my card is not a SIM card anyway.
This is a
gpp -ld
output from before I messed with--default
andCardReset
(01FFFF00DECAF4DD0102
is my applet):This is
gpp -ld
after messing up with the privileges when the card still appeared to be working before I went to sleep:This is random stuff I'm trying right now while the card appears to be bricked:
try selecting what I think is the security domain
same as above but via NFC:
try selecting my applet:
try selecting the app that previously had the
CardReset
privilege:try to list applets:
Thanks for your time and for your great Java Card development resources, they are extremely helpful!
Beta Was this translation helpful? Give feedback.
All reactions