Skip to content

Changes

Summary

  1. libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions (details)
  2. libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA (details)
  3. [cosmetic] libosmosim/class_tables: Add a quick reminder about the cases (details)
Commit 020b3248a898645097265d3134f95b035a6d42b9 by laforge
libosmosim: class_tables: Resolve conflicting CLA=8x INS=F2 definitions

In their infinite wisdom, GlobalPlatform re-defined the CLA 8x / INS F2 command
alreay specified by ETSI TS 102 221.  This wouldn't be as bads if they
had the same "Case".  However, ETSI has case 2 while GP has case 4.

Lucikly, the P1 coding of ETSI [so far] states all the four upper bits
must be 0, while GP always has one of those bits set.

Before this patch, it is possible that a Modem/Phone will send an 8xF2
command and intends it as a GlobalPlatform command (with Lc > 0 and
command data portion), while this code assumes it is an ETSI UICC
command with Lc=0 and hence no command data portion.  This will make
communication break when using simtrace2 'cardem'.

Change-Id: I8dd317ef8f942542e412b18c834a0467c51291c3
Related: SYS#6865
Related: https://lists.osmocom.org/hyperkitty/list/simtrace@lists.osmocom.org/thread/HPRTPGPZITHHASCJISCBAKHGBFZCFANP/
The file was modified tests/sim/sim_test.ok
The file was modified src/sim/class_tables.c
The file was modified tests/sim/sim_test.c
Commit fb52e1dcbb7c78857ef8e5a74f39a384e8ea9b76 by laforge
libosmosim: class_tables: Fix GlobalPlatform CLA=8x INS=CA/CB GET DATA

in their infinite wisdom, GlobalPlatform made GET DATA a command that can be either APDU
case 2 or case 4.  As the specify Le must be 0x00, we can conclude that P3 == 0x00 must be
Le, while P3 != 0x00 must be Lc and hence case 4 */

Change-Id: Ic8a17921f5a42d227791f1de39f90b4967c2e1b6
Related: SYS#6865
The file was modified tests/sim/sim_test.ok
The file was modified src/sim/class_tables.c
The file was modified tests/sim/sim_test.c
Commit 10d4d119ed6e9670a9313bc32c581acf85ef4339 by laforge
[cosmetic] libosmosim/class_tables: Add a quick reminder about the cases

Change-Id: I5280b6431b18ec36c3186460bebeb6321996c35f
The file was modified src/sim/class_tables.c