Attention is currently required from: Hoernchen, laforge.
Hello Hoernchen, Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email
to look at the new patch set (#8).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: CCID: Send procedure byte, when not expected
......................................................................
CCID: Send procedure byte, when not expected
A case 1 APDU does not request any data from SIM to return. The SIM will
only return a status byte with no procedure byte in advance.
The test sends a the INS byte + some other byte (0x42) instead of the
two status bytes as a response to the reader. The reader waits for
payload to be received from the SIM and times out.
This means that the reader uses the SIM response to determine if it is
a case 1 or case 2 APDU and not the instruction GET_RESPONSE or any
other instruction code.
Change-Id: Icffd48d99f0eb48e0898efb027854eba8c22f4a4
---
M ccid/CCID_Tests.ttcn
1 file changed, 39 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/97/42797/8
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icffd48d99f0eb48e0898efb027854eba8c22f4a4
Gerrit-Change-Number: 42797
Gerrit-PatchSet: 8
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: Hoernchen, laforge.
jolly has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email )
Change subject: CCID: Send procedure byte, when not expected
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
> what is the "procedure byte 0x62" in this context? Where does that value come from and why is it use […]
ok this is confusing, so i changed this to some other value. i just want to send two bytes to check, if the reader would interpret "INS + some_byte" as a status response.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icffd48d99f0eb48e0898efb027854eba8c22f4a4
Gerrit-Change-Number: 42797
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 13 Jul 2026 12:23:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: Hoernchen, laforge.
jolly has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email )
Change subject: CCID: Send procedure byte, when not expected
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
> how is this test different from sending only one of the byts of a sttaus word? To the reader, there […]
looking at tpdu_s_procedure_action() of osmo-ccid-firmare shows that the reader decides if this is a status word (0x6x / 0x9x) or if it should proceed (INS) and shoul wait for the 256 bytes (as Hoernchen stated). the reader is working at TPDU level, so it does not care, if there is a command that requires a response or not. (see also CCID spec §3.2.1)
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icffd48d99f0eb48e0898efb027854eba8c22f4a4
Gerrit-Change-Number: 42797
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 13 Jul 2026 12:14:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
jolly has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42964?usp=email )
Change subject: eIM: Make tests work with testenv
......................................................................
Set Ready For Review
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42964?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I38364e4bd5625b301c32fd58b50e35667c64b1be
Gerrit-Change-Number: 42964
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 13 Jul 2026 12:06:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Attention is currently required from: Hoernchen, jolly.
laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email )
Change subject: CCID: Send procedure byte, when not expected
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
what is the "procedure byte 0x62" in this context? Where does that value come from and why is it used here? From my memory all I recall is that 0x62 looks like the first half of a status word. 0x60 would be waiting time extension.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icffd48d99f0eb48e0898efb027854eba8c22f4a4
Gerrit-Change-Number: 42797
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Mon, 13 Jul 2026 11:37:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Hoernchen, jolly.
laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email )
Change subject: CCID: Send procedure byte, when not expected
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
how is this test different from sending only one of the byts of a sttaus word? To the reader, there's basically just a "I am expecting two bytes now" situation. It doesn't knwo nor care what those bytes are, right?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42797?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icffd48d99f0eb48e0898efb027854eba8c22f4a4
Gerrit-Change-Number: 42797
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Mon, 13 Jul 2026 11:22:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42856?usp=email )
Change subject: CCID: Check if reader times out after first status word
......................................................................
CCID: Check if reader times out after first status word
A case 1 APDU is sent towards the reader. The reader expects two status
words. If only the first word is sent by the SIM, the reader must
timeout and send an error message back to the host.
Change-Id: Ic5b892e356c13808555d75746c48c6d8c96ec462
---
M ccid/CCID_Tests.ttcn
1 file changed, 39 insertions(+), 0 deletions(-)
Approvals:
Hoernchen: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn
index a06c878..0988ae7 100644
--- a/ccid/CCID_Tests.ttcn
+++ b/ccid/CCID_Tests.ttcn
@@ -1045,6 +1045,44 @@
f_start_and_wait();
}
+/* The SIM responds with one status word only. */
+private function f_TC_status_word_incomplete() runs on CardemSlot_CT
+{
+ var octetstring req := c_UICC_MANAGE_CHANNEL;
+ var octetstring res := '62'O;
+ var CCID_PDU ccid_pdu;
+
+ f_cardem_manager();
+
+ f_ccid_power_on(CCID_PWRSEL_3V0);
+
+ /* Send a request towards reader. */
+ CCID.send(ts_CCID_XfrBlock(g_slot_nr, req, 0));
+ /* Receive the request by SIM. */
+ f_cardem_receive(tr_SIMTRACE_CEMU_RX_DATA(?, req));
+ /* Transmit the response by SIM. */
+ f_cardem_transmit(ts_SIMTRACE_CEMU_TX_DATA(ts_CardEmu_DataFlags(pb_and_tx := true, final := true),
+ res));
+ /* Receive the response from reader. */
+ ccid_pdu := f_ccid_receive(tr_CCID_DataBlock(g_slot_nr, ?, ?, ?));
+ if (ccid_pdu.hdr_in.bError != CCID_ERR_ICC_MUTE) {
+ setverdict(fail, "Unexpected Response or error code");
+ mtc.stop;
+ }
+
+ /* Stop simtrace emulation, to prevent race condition. */
+ vc_Cardem.stop;
+ vc_Cardem.done;
+}
+testcase TC_status_word_incomplete() runs on Test_CT
+{
+ f_init();
+
+ f_start_handler(refers(f_TC_status_word_timeout), mp_simtrace_slot, true);
+
+ f_start_and_wait();
+}
+
/* TODO */
/* IccPowerOn with wrong voltage (> 0x04) */
@@ -1093,6 +1131,7 @@
execute( TC_truncated_response() );
execute( TC_empty_slot() );
execute( TC_status_word_timeout() );
+ execute( TC_status_word_incomplete() );
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42856?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic5b892e356c13808555d75746c48c6d8c96ec462
Gerrit-Change-Number: 42856
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42796?usp=email )
Change subject: CCID: Send a wrong procedure byte towards the reader
......................................................................
CCID: Send a wrong procedure byte towards the reader
A case 2 request (according to ISO 7816) is sent and a response with
data is expected, but the first byte replied by the SIM is not a
procedure byte, nor a valid status byte.
This text expects the reader to return an error that states an incorrect
received procedure byte.
Change-Id: Iaa0bd8845b3408fba309874fe41c855d8e7efccc
---
M ccid/CCID_Tests.ttcn
1 file changed, 39 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
Hoernchen: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn
index 0988ae7..5d80c16 100644
--- a/ccid/CCID_Tests.ttcn
+++ b/ccid/CCID_Tests.ttcn
@@ -1083,6 +1083,44 @@
f_start_and_wait();
}
+/* The SIM sends a wrong procedure byte */
+private function f_TC_wrong_procedure_byte() runs on CardemSlot_CT
+{
+ var octetstring req := c_SIM_READ_BINARY;
+ var octetstring res := '0102030405060708090a9000'O;
+ var CCID_PDU ccid_pdu;
+
+ f_cardem_manager();
+
+ f_ccid_power_on(CCID_PWRSEL_3V0);
+
+ /* Send a request towards reader. */
+ CCID.send(ts_CCID_XfrBlock(g_slot_nr, req, 0));
+ /* Receive the request by SIM. */
+ f_cardem_receive(tr_SIMTRACE_CEMU_RX_DATA(?, req));
+ /* Transmit the response by SIM. */
+ f_cardem_transmit(ts_SIMTRACE_CEMU_TX_DATA(ts_CardEmu_DataFlags(pb_and_tx := true, final := true),
+ '42'O & res));
+ /* Receive the response from reader. */
+ ccid_pdu := f_ccid_receive(tr_CCID_DataBlock(g_slot_nr, ?, ?, ?));
+ if (ccid_pdu.hdr_in.bError != CCID_ERR_PROCEDURE_BYTE_CONFLICT) {
+ setverdict(fail, "Unexpected Response or error code");
+ mtc.stop;
+ }
+
+ /* Stop simtrace emulation, to prevent race condition. */
+ vc_Cardem.stop;
+ vc_Cardem.done;
+}
+testcase TC_wrong_procedure_byte() runs on Test_CT
+{
+ f_init();
+
+ f_start_handler(refers(f_TC_wrong_procedure_byte), mp_simtrace_slot, true);
+
+ f_start_and_wait();
+}
+
/* TODO */
/* IccPowerOn with wrong voltage (> 0x04) */
@@ -1132,6 +1170,7 @@
execute( TC_empty_slot() );
execute( TC_status_word_timeout() );
execute( TC_status_word_incomplete() );
+ execute( TC_wrong_procedure_byte() );
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42796?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iaa0bd8845b3408fba309874fe41c855d8e7efccc
Gerrit-Change-Number: 42796
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Attention is currently required from: jolly.
laforge has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42856?usp=email )
Change subject: CCID: Check if reader times out after first status word
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42856?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic5b892e356c13808555d75746c48c6d8c96ec462
Gerrit-Change-Number: 42856
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Mon, 13 Jul 2026 11:14:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes