×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Hi

    I get troubles while loading a .cap file into the SE of my Nokia 6131 or my Nokia 6212.

    I am using GPShell (but I also have JCOP Shell so if you have a solution with this one I can test it) and a Pegoda reader.

    I tried the helloInstallNokia6131NFC.txt script in the GPShell forlder but it doesn't work

    Code:
    mode_211
    enable_trace
    
    establish_context
    card_connect
    
    # If you have an Omnikey CardMan 5x21 reader, the contactless reader is 
    # the next even number, e.g. 2 if this is you first reader device in 
    # the system
    #card_connect
    select -AID a000000003000000
    open_sc -security 3 -keyver 42 -mac_key 404142434445464748494A4B4C4D4E4F -enc_key 404142434445464748494A4B4C4D4E4F -kek_key 404142434445464748494A4B4C4D4E4F
    #delete -AID a00000006203010c0101
    #delete -AID a00000006203010c01
    #delete -AID a00000006203010c0101
    install -file HelloWorld.cap -priv 2
    card_disconnect
    release_contexts
    but I get this error :

    Code:
    C:\GPShell>GPShell.exe helloInstallNokia6131NFC.txt
    mode_211
    enable_trace
    establish_context
    card_connect
    list_readers failed with error 0x8010002E (I)
    I think that GPShell does not see my Pegoda Reader.

    I saw in other files that we can specify a reader as :

    Code:
    card_connect -readerNumber 2
    So i tested with numbers like 1,2,3 up to 6 but it returned the same error.

    or

    Code:
    card_connect -reader "ReaderName"
    But I dont know the physical name of the Pegoda reader.

    If you have any idea, all the help is welcome

    Gilloull

  2. #2
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Hallo,

    Quote Originally Posted by gilloull View Post
    I get troubles while loading a .cap file into the SE of my Nokia 6131 or my Nokia 6212.

    I am using GPShell and a Pegoda reader.

    Code:
    list_readers failed with error 0x8010002E (I)
    I think that GPShell does not see my Pegoda Reader.
    This is correct. GPShell only works with PC/SC-compliant readers. The Pegoda has some proprietary interface that is not PC/SC-compliant.

    br,
    Michael

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Thanks a lot for your answer !

    I founded a PC/SC reader and tried again but it is still not working. This is the log :

    Code:
    C:\GPShell>GPShell helloInstallNokia6131NFC.txt
    mode_211
    enable_trace
    establish_context
    card_connect
    * reader name NXP NFC CARD READER 0
    card_connect() returns 0x80100069 (The smart card has been removed and no comunication is now possible.)
    select -AID a000000003000000
    Command --> 00A4040008A000000003000000
    Wrapped command --> 00A4040008A000000003000000
    select_application() returns 0x00000006 (invalid handle)
    The log is the same for a 6131 or 6212.

    I did not mentioned that both phones are unlocked with special midlet.

  4. #4
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Hallo,

    Quote Originally Posted by gilloull View Post
    I founded a PC/SC reader and tried again but it is still not working.

    Code:
    C:\GPShell>GPShell helloInstallNokia6131NFC.txt
    * reader name NXP NFC CARD READER 0
    card_connect() returns 0x80100069 (The smart card has been removed and no comunication is now possible.)
    What reader are you using now? Seems as if this reader doesn't detect the phone...did you activate the secure element?

    br,
    Michael

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    What reader are you using now? Seems as if this reader doesn't detect the phone...did you activate the secure element?
    I am using a demoboard from NXP (one of my partners) with a PN533 (it is not a commercial reader).

    The reader seems to be OK because the one who gave it to me is using it for his personnal projects.

    Could it be a problem from the cellphone ?

    What do you mean by activate the SE ? If it is about the unlocking middlet, so the phone is unlocked, when I tried to apply again the middlet, it told me that the phone was already unlocked.

  6. #6
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Hallo,

    Quote Originally Posted by gilloull View Post
    I am using a demoboard from NXP (one of my partners) with a PN533 (it is not a commercial reader).
    I don't know much about this reader, but I just checked the GPShell with a couple of readers and found that the only working reader was the Omnikey 5321.

    Quote Originally Posted by gilloull View Post
    What do you mean by activate the SE ?
    I meant: Have you disabled the SE in the NFC menu? But I just checked and found out that you can't disable it anyways (the only options are "Always allow", "Ask first" and "Ask passcode first"). What you can try to do is check if the phone detects the field emitted by the reader: Set the SE activation level (Menu -> NFC -> Secure element settings) to "Ask first". If the phone asks you to activate the SE you know that there is at least some form of communication between phone and reader.

    br,
    Michael

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Thanks again for taking time.

    The SE is set to "Always Active" in the NFC menu.

    In fact I can now connect to my phone. The problem was the place of the antenna, the reader was not in front of it (the antenna is in the front screen and not on the battery as I was thinking).

    I still get trouble while charging the helloWorld into the 6131. Here is the log :

    Code:
    C:\GPShell>GPShell.exe helloInstallNokia6131NFC.txt
    
    mode_211
    
    enable_trace
    
    establish_context
    
    card_connect
    * reader name NXP NFC CARD READER 0
    
    select -AID a000000003000000
    
    Command --> 00A4040008A000000003000000
    
    Wrapped command --> 00A4040008A000000003000000
    
    Response <-- 6F108408A000000003000000A5049F6501FF9000
    
    open_sc -security 3 -keyver 42 -mac_key 404142434445464748494A4B4C4D4E4F -enc_ke
    y 404142434445464748494A4B4C4D4E4F -kek_key 404142434445464748494A4B4C4D4E4F
    
    Command --> 80CA006600
    
    Wrapped command --> 80CA006600
    
    Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
    886FC6B03640B06092A864886FC6B040255650B06092B8510864864020103660C060A2B060104012
    A026E01029000
    
    Command --> 80502A0008960755175DA5E29C00
    
    Wrapped command --> 80502A0008960755175DA5E29C00
    
    Response <-- 6A88
    mutual_authentication() returns 0x80206A88 (6A88: Referenced data not found.)
    When I try with a Nokia 6212 I get a security error which could be logic as the scrypt is for 6131 :

    Code:
    C:\GPShell>GPShell.exe helloInstallNokia6131NFC.txt
    
    mode_211
    
    enable_trace
    
    establish_context
    
    card_connect
    * reader name NXP NFC CARD READER 0
    
    select -AID a000000003000000
    
    Command --> 00A4040008A000000003000000
    
    Wrapped command --> 00A4040008A000000003000000
    
    Response <-- 6F108408A000000003000000A5049F6501FF9000
    
    open_sc -security 3 -keyver 42 -mac_key 404142434445464748494A4B4C4D4E4F -enc_ke
    y 404142434445464748494A4B4C4D4E4F -kek_key 404142434445464748494A4B4C4D4E4F
    
    Command --> 80CA006600
    
    Wrapped command --> 80CA006600
    
    Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
    886FC6B03640B06092A864886FC6B040255650B06092B8510864864020103660C060A2B060104012
    A026E01029000
    
    Command --> 80502A0008098BB7704436413F00
    
    Wrapped command --> 80502A0008098BB7704436413F00
    
    Response <-- 6982
    mutual_authentication() returns 0x80206982 (6982: Command not allowed - Security
     status not satisfied.)
    Any idea ?
    Thanks

  8. #8
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Quote Originally Posted by gilloull View Post
    With 6131:
    Code:
    Response <-- 6A88
    mutual_authentication() returns 0x80206A88 (6A88: Referenced data not found.)
    With 6212:
    Code:
    Response <-- 6982
    mutual_authentication() returns 0x80206982 (6982: Command not allowed - Security
     status not satisfied.)
    The error with the 6131 is a typical authentication error. Usually this means that you used an invalid key...but you said you have unlocked the SE with the unlock MIDlet. So did you change the card manager keys after using the unlock MIDlet?

    The error with the 6212 is an error that I've never seen before, but this thread suggests that this is the error you get after 10 authentication failures to the card manager (i.e. the card manager is permanently locked!)

    br,
    Michael

  9. #9
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    In fact, I am not the first one using those phones so I don't know what was done with them before. You know it's like the phone is in a lab and everyone can use it for tests so the only thing I am sure is that they are unlocked because I tried to apply the unlock middlet and it told me that the phone was already unlocked.

    Do you know any procedure to change the card manager's keys ?

    Do you know if, each time I fail to upload the helloWorld.cap, it decrease the auth counter and I will soon lock the phone ?

  10. #10
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Hallo,

    Quote Originally Posted by gilloull View Post
    Do you know any procedure to change the card manager's keys ?
    If you don't know the keys, you can't change them.

    Quote Originally Posted by gilloull View Post
    Do you know if, each time I fail to upload the helloWorld.cap, it decrease the auth counter and I will soon lock the phone ?
    Yes, each time you start the authentication procedure against the card manager applet without successfully completing it, the lock-out/retry counter decreases. And after the tenth unsuccessful try, the card manager irreversibly locked.

    br,
    Michael

  11. #11
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Quote Originally Posted by mroland View Post
    If you don't know the keys, you can't change them.
    Ok I understand that point, but I would like to be sure that the problem is from the keys.

    If I try to change them supposing their value (404142434445464748494A4B4C4D4E4F) is default value and it succes, the problem should not be from the keys.

    If it does not work, at this time I will be certain that the problem is that keys value is different than default value.

  12. #12
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Hallo,

    Quote Originally Posted by gilloull View Post
    If I try to change them supposing their value (404142434445464748494A4B4C4D4E4F) is default value and it succes, the problem should not be from the keys.

    If it does not work, at this time I will be certain that the problem is that keys value is different than default value.
    Well, I do understand what you are up to, but in order to change the keys you first need to successfully authenticate against the card manager. I.e. with GPShell the order would be:

    Code:
    select -AID a0000000030000
    open_sc [...]
    put_sc_key [...]
    As opening the secure channel fails you can already be sure that you either use the wrong keys, use the wrong keyset or have used up all of your ten tries.

    br,
    Michael
    Last edited by mroland; 2010-05-12 at 18:21.

  13. #13
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    hello !

    I come back to you because I got news :

    As you were thinking, my cell phones are all blocked. So I bought a new one to perform tests with a blank architecture.

    I unlocked it and loaded the HelloWorld.cap with the GPShell example.

    The loading seems to be ok as I have 90 00 everywhere.

    But the problem is that in the menu, I don't see the helloWorld application, and I searched in all folders under Gallery, Apps and NFC

    Do you know how to launch the helloworld ?


    An other question about the script :

    Code:
    mode_211
    enable_trace
    
    establish_context
    card_connect
    
    # If you have an Omnikey CardMan 5x21 reader, the contactless reader is 
    # the next even number, e.g. 2 if this is you first reader device in 
    # the system
    #card_connect -readerNumber 2
    select -AID a000000003000000
    open_sc -security 3 -keyver 42 -mac_key 404142434445464748494A4B4C4D4E4F -enc_key 404142434445464748494A4B4C4D4E4F -kek_key 404142434445464748494A4B4C4D4E4F
    #delete -AID a00000006203010c0101
    #delete -AID a00000006203010c01
    #delete -AID a00000006203010c0101
    install -file HelloWorld.cap -priv 2
    card_disconnect
    release_contexts

    If i understand it well :

    Code:
    select -AID a000000003000000
    ==> this is the AID of the card Manager

    Code:
    -security 3
    ==> this is for the use of 3 keys

    Code:
    -priv 2
    ==> I don't understand this command...

    Do you know a place where I could find all options about commands and a list of command which are supported by the GPShell, as I would like to see what are the cap files installed into my phone (as Card-info in JCop Shell).

    Thanks a lot !

  14. #14
    Registered User
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    Hallo,

    Quote Originally Posted by gilloull View Post
    [...] But the problem is that in the menu, I don't see the helloWorld application, and I searched in all folders under Gallery, Apps and NFC

    Do you know how to launch the helloworld ?
    I'm not sure that you understand what Java Card applets do. Applets on the secure element do not (yet) have a graphical user interface. Interaction with these applets is based on APDUs (data packets according to ISO/IEC 7816). Therefore, if you want to access your applet from the phone, you need a seperate MIDlet application on the phone, that accesses your secure element applet.

    The applet can be launched with a SELECT_FILE APDU command that selects the applet by its dedicated file name.


    Quote Originally Posted by gilloull View Post
    Code:
    select -AID a000000003000000
    ==> this is the AID of the card Manager
    Correct.

    Quote Originally Posted by gilloull View Post
    Code:
    -security 3
    I think, this means that the channel is encrypted and that message authentication codes are applied.

    Quote Originally Posted by gilloull View Post
    Code:
    -priv 2
    ==> I don't understand this command...
    This sets the privileges of the installed applet. Sorry but I don't know what privileges are given by the value 2.

    Quote Originally Posted by gilloull View Post
    Do you know a place where I could find all options about commands and a list of command which are supported by the GPShell
    Except for the source code of GPShell, no.

    Quote Originally Posted by gilloull View Post
    as I would like to see what are the cap files installed into my phone (as Card-info in JCop Shell).
    You can do this with the command:
    Code:
    get_status -element 10
    br,
    Michael

  15. #15
    Registered User
    Join Date
    Feb 2010
    Posts
    12

    Re: Nokia 6212 or 6131 with GPShell and Pegoda Reader - Load .cap file

    You right, I am still confusing cardlet and midlet, shame on me

    My reader is gone to an other lab so I can not test the command "get_status -element 10" for now but may be tomorrow.

    May I ask you why the option "-element 10" ? Is the number important ?

    About privileges, I found this in the README file :

    -priv (DWORD) Privilege. // e.g. 0x04 Default Selected
    So if someone know why in the helloWorld scrypt it is set to 2 and not 4 as default value and I would appreciate ?

    Thanks for your quick response mroland

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×