Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

C-MAC generation on G&D Expert 3.0 cards

843851Oct 23 2006 — edited Oct 23 2006
Hello folks,

I manage to perform authentication to G&D expert3.0 cards (Init-update, then Ext-Auth) to start a secure channel.
My problem is for following commands in same session, I get an 0x6982 for commands sent in a secure channel, below is a piece of code :

applet:
  public boolean select()
   {
      mySecureChannel = GPSystem.getSecureChannel();
      return true;
   }
(...)
  public void process(APDU apdu) throws ISOException
    {
      byte[] buffer = apdu.getBuffer();     
      (....) 
       switch (buffer[ISO7816.OFFSET_INS]) {
          
          case myFunction: 
             // Host has to be authenticated:
             if(mySecureChannel.getSecurityLevel() == SecureChannel.NO_SECURITY_LEVEL)
              ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
           else
           {
             wrappedLength = apdu.setIncomingAndReceive();
             mySecureChannel.unwrap(buffer,ISO7816.OFFSET_CLA,(short)(wrappedLength + 5));    /*<-- Exception thrown HERE*/
             myFunction(apdu); }
(...)
I assume MAC generation on host side is correct as I could reproduce sample sequences and MAC for External Authentication is correct.

Any hints greatly appreciated ! Thanks,

Daniel
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2006
Added on Oct 23 2006
2 comments
121 views