Commit b393dd42 authored by Sebastian Hans's avatar Sebastian Hans
Browse files

CR-063 SCP(15)000130

-The CR delivers also a api_2_rmm_rrp/Api_2_RMm_Rrp_2.java that has no changes compared with the version already in this branch
parent 01f2abdc
Loading
Loading
Loading
Loading
+2 −17
Original line number Original line Diff line number Diff line
@@ -18,23 +18,20 @@ public class Api_2_RMm_Sgp_2 extends Applet implements ReaderListener {
	/**
	/**
	 * INS values to determine which feature to test or verify
	 * INS values to determine which feature to test or verify
	 */
	 */
	private static final byte INS_TEST_HCI_DISABLED = 0x01;
	private static final byte INS_TEST_RECEIVING_HCI_MESSAGE = 0x02;
	private static final byte INS_TEST_RECEIVING_HCI_MESSAGE = 0x02;
	private static final byte INS_TEST_ILLIGALVALUE = 0x05;
	private static final byte INS_TEST_ILLIGALVALUE = 0x05;
	private static final byte INS_VERIFY_HCI_DISABLED = 0x11;
	private static final byte INS_VERIFY_RECEIVING_HCI_MESSAGE = 0x12;
	private static final byte INS_VERIFY_RECEIVING_HCI_MESSAGE = 0x12;
	private static final byte INS_VERIFY_ILLIGALVALUE = 0x15;
	private static final byte INS_VERIFY_ILLIGALVALUE = 0x15;
	
	
	/**
	/**
	 * Keeps the feature to test. Value is set in process() and used in onCallback().
	 * Keeps the feature to test. Value is set in process() and used in onCallback().
	 */
	 */
	private byte featureToTest;
	private int featureToTest;


	/**
	/**
	 * Variables to remember the thrown exception. Set in onCallback() and evaluated in
	 * Variables to remember the thrown exception. Set in onCallback() and evaluated in
	 * process() with INS >= 0x11.
	 * process() with INS >= 0x11.
	 */
	 */
	private boolean exceptionHciDisabledThrown;
	private boolean exceptionIlligalValueThrown;
	private boolean exceptionIlligalValueThrown;
	private boolean exceptionReceivingHciThrown;
	private boolean exceptionReceivingHciThrown;


@@ -86,9 +83,6 @@ public class Api_2_RMm_Sgp_2 extends Applet implements ReaderListener {
		byte buffer[] = apdu.getBuffer();
		byte buffer[] = apdu.getBuffer();


		switch (buffer[ISO7816.OFFSET_INS]) {
		switch (buffer[ISO7816.OFFSET_INS]) {
		case INS_TEST_HCI_DISABLED:
			featureToTest = 1;
			break;
		case INS_TEST_RECEIVING_HCI_MESSAGE:
		case INS_TEST_RECEIVING_HCI_MESSAGE:
			featureToTest = 2;
			featureToTest = 2;
			break;
			break;
@@ -96,11 +90,6 @@ public class Api_2_RMm_Sgp_2 extends Applet implements ReaderListener {
			featureToTest = 5;
			featureToTest = 5;
			break;
			break;
			
			
		case INS_VERIFY_HCI_DISABLED:
			if (exceptionHciDisabledThrown) {
				ISOException.throwIt((short) (ISO7816.SW_NO_ERROR + 3));
			}
			break;
		case INS_VERIFY_RECEIVING_HCI_MESSAGE:
		case INS_VERIFY_RECEIVING_HCI_MESSAGE:
			if (exceptionReceivingHciThrown) {
			if (exceptionReceivingHciThrown) {
				ISOException.throwIt((short) (ISO7816.SW_NO_ERROR + 4));
				ISOException.throwIt((short) (ISO7816.SW_NO_ERROR + 4));
@@ -139,11 +128,7 @@ public class Api_2_RMm_Sgp_2 extends Applet implements ReaderListener {
					try {
					try {
						readerMessage.prepareAndSendGetParameterCommand(paramID);
						readerMessage.prepareAndSendGetParameterCommand(paramID);
					} catch (HCIException e) {
					} catch (HCIException e) {
						if (e.getReason() == HCIException.HCI_CURRENTLY_DISABLED) {
						if (e.getReason() == HCIException.HCI_FRAGMENTED_MESSAGE_ONGOING) {
							if (featureToTest == 1) {
								exceptionHciDisabledThrown = true;
							}
						} else if (e.getReason() == HCIException.HCI_FRAGMENTED_MESSAGE_ONGOING) {
							if (featureToTest == 2) {
							if (featureToTest == 2) {
								exceptionReceivingHciThrown = true;
								exceptionReceivingHciThrown = true;
							}
							}
+1 −19
Original line number Original line Diff line number Diff line
@@ -18,12 +18,10 @@ public class Api_2_RMm_Srx_2 extends Applet implements ReaderListener {
	/**
	/**
	 * INS values to determine which feature to test or verify
	 * INS values to determine which feature to test or verify
	 */
	 */
	private static final byte INS_TEST_HCI_DISABLED = 0x01;
	private static final byte INS_TEST_NULLPOINTER = 0x02;
	private static final byte INS_TEST_NULLPOINTER = 0x02;
	private static final byte INS_TEST_ARRAYBOUNDS_L = 0x03;
	private static final byte INS_TEST_ARRAYBOUNDS_L = 0x03;
	private static final byte INS_TEST_ARRAYBOUNDS_H = 0x04;
	private static final byte INS_TEST_ARRAYBOUNDS_H = 0x04;
	private static final byte INS_TEST_ILLIGALVALUE = 0x05;
	private static final byte INS_TEST_ILLIGALVALUE = 0x05;
	private static final byte INS_VERIFY_HCI_DISABLED = 0x11;
	private static final byte INS_VERIFY_NULLPOINTER = 0x12;
	private static final byte INS_VERIFY_NULLPOINTER = 0x12;
	private static final byte INS_VERIFY_ARRAYBOUNDS_L = 0x13;
	private static final byte INS_VERIFY_ARRAYBOUNDS_L = 0x13;
	private static final byte INS_VERIFY_ARRAYBOUNDS_H = 0x14;
	private static final byte INS_VERIFY_ARRAYBOUNDS_H = 0x14;
@@ -32,13 +30,12 @@ public class Api_2_RMm_Srx_2 extends Applet implements ReaderListener {
	/**
	/**
	 * Keeps the feature to test. Value is set in process() and used in onCallback().
	 * Keeps the feature to test. Value is set in process() and used in onCallback().
	 */
	 */
	private byte featureToTest;
	private int featureToTest;


	/**
	/**
	 * Variables to remember the thrown exception. Set in onCallback() and evaluated in
	 * Variables to remember the thrown exception. Set in onCallback() and evaluated in
	 * process() with INS >= 0x11.
	 * process() with INS >= 0x11.
	 */
	 */
	private boolean exceptionHciDisabledThrown;
	private boolean exceptionArrayIndexThrown;
	private boolean exceptionArrayIndexThrown;
	private boolean exceptionIlligalValueThrown;
	private boolean exceptionIlligalValueThrown;
	private boolean exceptionNullPointerThrown;
	private boolean exceptionNullPointerThrown;
@@ -91,9 +88,6 @@ public class Api_2_RMm_Srx_2 extends Applet implements ReaderListener {
		byte buffer[] = apdu.getBuffer();
		byte buffer[] = apdu.getBuffer();


		switch (buffer[ISO7816.OFFSET_INS]) {
		switch (buffer[ISO7816.OFFSET_INS]) {
		case INS_TEST_HCI_DISABLED:
			featureToTest = 1;
			break;
		case INS_TEST_NULLPOINTER:
		case INS_TEST_NULLPOINTER:
			featureToTest = 2;
			featureToTest = 2;
			break;
			break;
@@ -107,11 +101,6 @@ public class Api_2_RMm_Srx_2 extends Applet implements ReaderListener {
			featureToTest = 5;
			featureToTest = 5;
			break;
			break;
			
			
		case INS_VERIFY_HCI_DISABLED:
			if (exceptionHciDisabledThrown) {
				ISOException.throwIt((short) (ISO7816.SW_NO_ERROR + 1));
			}
			break;
		case INS_VERIFY_NULLPOINTER:
		case INS_VERIFY_NULLPOINTER:
			if (exceptionNullPointerThrown) {
			if (exceptionNullPointerThrown) {
				ISOException.throwIt((short) (ISO7816.SW_NO_ERROR + 2));
				ISOException.throwIt((short) (ISO7816.SW_NO_ERROR + 2));
@@ -176,13 +165,6 @@ public class Api_2_RMm_Srx_2 extends Applet implements ReaderListener {
					try {
					try {
						readerMessage.prepareAndSendWriteXchgDataCommand(timeout,
						readerMessage.prepareAndSendWriteXchgDataCommand(timeout,
								data, offset, len);
								data, offset, len);
					} catch (HCIException e) {
						if (e.getReason() == HCIException.HCI_CURRENTLY_DISABLED) {
							if (featureToTest == 1) {
								exceptionHciDisabledThrown = true;
							}
							return;
						}
					} catch (ArrayIndexOutOfBoundsException e) {
					} catch (ArrayIndexOutOfBoundsException e) {
						if (featureToTest == 3 || featureToTest == 4) {
						if (featureToTest == 3 || featureToTest == 4) {
							exceptionArrayIndexThrown = true;
							exceptionArrayIndexThrown = true;