Skip to content
Success

Changes

Summary

  1. OmapiCallbackHandlerVpcd: simplify/fix SELECT by DF-Name (aid) (details)
Commit fb3308b64d7d31d993c01fedfc9e54b742c6ce99 by pmaier@sysmocom.de
OmapiCallbackHandlerVpcd: simplify/fix SELECT by DF-Name (aid)

When a TPDU with a SELECT by DF-Name is received from the VPCD end,
it cannot be transparently passed through the OMAPI channel as OMAPI
will block those TDPUs for security reasons. To overcome this, we
close the current OMAPI channel and re-open a new one under the new
DF-Name (AID).

To reduce the likelyhood for unexpected behaviour and possible loss
of state we have replaced the SELECT by DF-Name with a SELECT to
7fff (alias for the currently selected application), in case the
SELECT by DF-Name would target the currently selected application.

This workaround requires preceise tracking of which application is
currently selected. Unfortunately this has proven as difficult and
error prone.

After looking closer at the problem we noticed that we do not even
need the aforementioned workaround. The opening and closing of the
OMAPI channel just opens and closes logical channels on the card.
It does not perform a reset. This in particular means that the ADM
or PIN verification state is retained. (states like the currently
selected file, the current tag and the current record are reset by
SELECT anyway).

So let's remove the workaround and re-open the OMAPI channel each
time a SELECT by DF-Name is received.

Related: OS#6836
Change-Id: Ib4873b18d233e549e075b9384906a536907c6260
The file was modifiedapp/src/main/java/org/osmocom/androidApduProxy/OmapiCallbackHandlerVpcd.java