laforge has submitted this change. ( https://gerrit.osmocom.org/c/android-apdu-proxy/+/41800?usp=email )
Change subject: OmapiCallbackHandlerVpcd: use appropriate status word to reject MANAGE CHANNEL ......................................................................
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 Related: OS#6836 --- M app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java b/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java index 0b880fb..02f3028 100644 --- a/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java +++ b/app/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java @@ -158,7 +158,10 @@ //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) if (Arrays.equals(Arrays.copyOf(tpdu, 2), Utils.h2b("0070"))) { - return (Utils.h2b("6D00")); + 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