Page 1 of 1

NULL procedure byte 0x60

Posted: Thu Dec 24, 2020 9:10 am
by sam786
Hi guys

I’m really hoping someone could help me out here as I’ve been trying to figure this out last few days now...

I am trying to issue a Null procedure byte 0x60 requesting for additional work time.

I am really unsure how to implement this function in my code.

A sample code with some simple explanation in layman's terms would be greatly appreciated as im new to javacard!

Thanks in advance!!!

Re: NULL procedure byte 0x60

Posted: Sat Dec 26, 2020 6:19 am
by kuafu
What is NULL procedure byte 0x60?

Re: NULL procedure byte 0x60

Posted: Sat Dec 26, 2020 7:52 am
by sam786
Hi kuafu,

Thank you again for offering to help out!!!

I will try to make this as short as possible.

As per ISO7816-3 (10.3.3)
After transmitting the header as a string of five characters (C-APDU), the interface device shall wait for a character conveying a procedure byte (R-APDU). There are three types of procedure bytes: NULL, SW1, ACK.

NULL: 0x60

SW1, SW2: (Example: 9000 - command normally completed etc...)

ACK:

If the value is '60', it is a NULL byte. It requests no action on data transfer. The interface device shall wait for a character conveying a procedure byte.
At each procedure byte, the card can proceed with the command by NULL or ACK, or finish the command by SW1 SW2, or show its disapproval by becoming unresponsive (WT will be exceeded).

I am trying to respond to a Generate Application cryptogram request:

80 AE 80 00 1D (CLA, INS, P1, P2, P3)

I would like the card to respond with a NULL byte 0x60 to request the interface device for more time.

If I write the following code:

ISOException.throwIt((short) 0x60);

The interface device will throw an error and disconnect the communication with the card as 0x60 is not an SW1 byte (as defined by ISO7816-3)

If I write the following code:

{

(byte) 0x60

};

short len = (short) sendbyte.length;
Util.arrayCopyNonAtomic(sendbyte, (short)0, buffer, (short)0, (short)len);
apdu.setOutgoing();
apdu.setOutgoingLength(len);
apdu.sendBytes((short) 0, (short)len);

The card will respond with the following data: 60 90 00, this is also incorrect parameters (as defined by ISO7816-3).

Someone has asked a similar question in another post:

https://javacardos.com/javacardforum/vi ... +byte#p231

The reply in that post stated:

public static void waitExtension() throws APDUException
Note:
1-In T=0 protocol, a NULL procedure byte is sent to reset the work waiting time.
2-In T=1 protocol, the implementation needs to request the same T=0 protocol work waiting time quantum by sending a T=1 protocol request for wait time extension.

is this related to me? if so how can i implement this function in my code?

A sample code would be greatly appreciated!!!

Thanks in advance!!!!!!!!!!!!!!!!

Re: NULL procedure byte 0x60

Posted: Sun Dec 27, 2020 3:50 am
by kuafu
sam786 wrote:
Sat Dec 26, 2020 7:52 am
Hi kuafu,

Thank you again for offering to help out!!!

I will try to make this as short as possible.

As per ISO7816-3 (10.3.3)
After transmitting the header as a string of five characters (C-APDU), the interface device shall wait for a character conveying a procedure byte (R-APDU). There are three types of procedure bytes: NULL, SW1, ACK.

NULL: 0x60

SW1, SW2: (Example: 9000 - command normally completed etc...)

ACK:

If the value is '60', it is a NULL byte. It requests no action on data transfer. The interface device shall wait for a character conveying a procedure byte.
At each procedure byte, the card can proceed with the command by NULL or ACK, or finish the command by SW1 SW2, or show its disapproval by becoming unresponsive (WT will be exceeded).

I am trying to respond to a Generate Application cryptogram request:

80 AE 80 00 1D (CLA, INS, P1, P2, P3)

I would like the card to respond with a NULL byte 0x60 to request the interface device for more time.

If I write the following code:

ISOException.throwIt((short) 0x60);

The interface device will throw an error and disconnect the communication with the card as 0x60 is not an SW1 byte (as defined by ISO7816-3)

If I write the following code:

{

(byte) 0x60

};

short len = (short) sendbyte.length;
Util.arrayCopyNonAtomic(sendbyte, (short)0, buffer, (short)0, (short)len);
apdu.setOutgoing();
apdu.setOutgoingLength(len);
apdu.sendBytes((short) 0, (short)len);

The card will respond with the following data: 60 90 00, this is also incorrect parameters (as defined by ISO7816-3).

Someone has asked a similar question in another post:

https://javacardos.com/javacardforum/vi ... +byte#p231

The reply in that post stated:

public static void waitExtension() throws APDUException
Note:
1-In T=0 protocol, a NULL procedure byte is sent to reset the work waiting time.
2-In T=1 protocol, the implementation needs to request the same T=0 protocol work waiting time quantum by sending a T=1 protocol request for wait time extension.

is this related to me? if so how can i implement this function in my code?

A sample code would be greatly appreciated!!!

Thanks in advance!!!!!!!!!!!!!!!!
https://www.javacardos.com/wiki/javacar ... textension
But it depends on whether the virtual machine is supported it.Most of the time this waitextension is not implemented .
And or

Code: Select all

ISOException.throwIt((short) 0x60);   
or
{ 


(byte) 0x60

		};
			  
      short len = (short) sendbyte.length;
      Util.arrayCopyNonAtomic(sendbyte, (short)0, buffer, (short)0, (short)len);    
      apdu.setOutgoing();
      apdu.setOutgoingLength(len);
      apdu.sendBytes((short) 0, (short)len);
      
They didn't work. You can't reach your destination by send any data back in applet level.

Re: NULL procedure byte 0x60

Posted: Sun Dec 27, 2020 3:56 am
by kuafu
sam786 wrote:
Thu Dec 24, 2020 9:10 am
Hi guys

I’m really hoping someone could help me out here as I’ve been trying to figure this out last few days now...

I am trying to issue a Null procedure byte 0x60 requesting for additional work time.

I am really unsure how to implement this function in my code.

A sample code with some simple explanation in layman's terms would be greatly appreciated as im new to javacard!

Thanks in advance!!!
In a word . It's the duty of java card virtual machine. You can not do that on applet level.

Re: NULL procedure byte 0x60

Posted: Tue Jan 26, 2021 11:40 am
by sam786
Thanks kuafu,

As always really appreciate the help and support!!!!!!!!!!!!