dexter has uploaded this change for review.

View Change

OmapiCallbackHandlerVpcd: use appropriate status word to reject MANAGE CHANNEL

ISO/IEC 7816-4 specifies a status word to reject MANAGE CHANNEL instructions
in case the card does not support multiple channels.

Let's also print an error message in the log to simplify debugging for users
who aren't aware of OMAPI's logical channel limitation.

Change-Id: I42529a6ae61378e41f33f1ec34124e346d4805df
---
M app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java
1 file changed, 4 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/android-apdu-proxy refs/changes/00/41800/1
diff --git a/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java b/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java
index 7b2f63f..f443ac2 100644
--- a/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java
+++ b/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java
@@ -147,8 +147,11 @@

//Block all attempts to manage a channel, this is a feature we do not support here.
//(OMAPI also does not support the MANAGE CHANNEL command)
- return (Utils.h2b("6D00"));
if (Arrays.equals(Arrays.copyOf(tpdu, 2), Utils.h2b("0070") ) ) {
+ Log.e("PROXY", String.format("Rejecting unsupported MANAGE CHANNEL (%s) command...\n",
+ Utils.b2h(tpdu)));
+ //see also ISO/IEC 7816-4, table 6 (logical channel not supported)
+ return (Utils.h2b("6881"));
}

//Normal APDU/TPDU exchange

To view, visit change 41800. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: android-apdu-proxy
Gerrit-Branch: master
Gerrit-Change-Id: I42529a6ae61378e41f33f1ec34124e346d4805df
Gerrit-Change-Number: 41800
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>