laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42803?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: SIMTRACE: Increase USB receive buffer size
......................................................................
SIMTRACE: Increase USB receive buffer size
The maximum SIM request data can be 255 bytes. Additionally, the
SIMtrace PDU header is 14 bytes. So increase the buffer to 269 bytes.
Change-Id: I05261b4a754b4892955d0b4e426bd32be261efa7
---
M library/SIMTRACE_Emulation.ttcn
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
Hoernchen: Looks good to me, but someone else must approve
diff --git a/library/SIMTRACE_Emulation.ttcn b/library/SIMTRACE_Emulation.ttcn
index c907608..7ba4b2c 100644
--- a/library/SIMTRACE_Emulation.ttcn
+++ b/library/SIMTRACE_Emulation.ttcn
@@ -34,9 +34,9 @@
integer usb_if_nr
};
-private const octetstring c_oct261 := '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'O;
+private const octetstring c_oct269 := '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'O;
-private function f_usb_submit_xfer(USB_endpoint ep, octetstring data := c_oct261,
+private function f_usb_submit_xfer(USB_endpoint ep, octetstring data := c_oct269,
USB_transfer_type ttype := USB_TRANSFER_TYPE_BULK,
integer tout_ms := 30000) runs on USB_CT
{
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42803?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: I05261b4a754b4892955d0b4e426bd32be261efa7
Gerrit-Change-Number: 42803
Gerrit-PatchSet: 5
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/+/42804?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: CCID: Check if reader sends request TPDU with maximum size
......................................................................
CCID: Check if reader sends request TPDU with maximum size
The maximum size of a request TPDU can have 5 bytes header and 255 bytes
data. It is expected that the reader transmits all bytes to SIM without
failure.
Change-Id: I7c1cb52b578c19d6c0ec1493e45f6ed9c43735b4
---
M ccid/CCID_Tests.ttcn
1 file changed, 44 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Hoernchen: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn
index f4470f1..8184bf3 100644
--- a/ccid/CCID_Tests.ttcn
+++ b/ccid/CCID_Tests.ttcn
@@ -760,12 +760,54 @@
f_start_and_wait();
}
+/* The SIM request with 255 bytes. */
+private function f_TC_255_bytes_request() runs on CardemSlot_CT
+{
+ var octetstring req := '00D60000FF000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e'O
+ var octetstring res := '9000'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(?, substr(req, 0, 5)));
+ /* Transmit the procedure byte from SIM. */
+ f_cardem_transmit(ts_SIMTRACE_CEMU_TX_DATA(ts_CardEmu_DataFlags(pb_and_rx := true, final := false),
+ 'D6'O));
+ /* Receive the data by SIM. */
+ f_cardem_receive(tr_SIMTRACE_CEMU_RX_DATA(?, substr(req, 5, lengthof(req) - 5)));
+ /* Transmit the status bytes from 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.u.DataBlock.abData != res) {
+ setverdict(fail, "Unexpected SW1/SW2");
+ mtc.stop;
+ }
+
+ /* Stop simtrace emulation, to prevent race condition. */
+ vc_Cardem.stop;
+ vc_Cardem.done;
+}
+testcase TC_255_bytes_request() runs on Test_CT
+{
+ f_init();
+
+ f_start_handler(refers(f_TC_255_bytes_request), mp_simtrace_slot, true);
+
+ f_start_and_wait();
+}
+
/* TODO */
/* IccPowerOn: verify that CCID resets all parameters to default values */
/* IccPowerOn: verify that bPowerSelect has no effect in active state */
-/* XfrBlock: length corner cases (Lc/Le max, ...) */
/* IccClock: verify clock has stopped/restarted */
/* Abort for command that already terminated */
/* Abort for command that's still processing */
@@ -966,6 +1008,7 @@
execute( TC_255_bytes_response() );
execute( TC_256_bytes_response() );
execute( TC_null_procedure_byte() );
+ execute( TC_255_bytes_request() );
/* error handling */
execute( TC_inval_slot() );
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42804?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: I7c1cb52b578c19d6c0ec1493e45f6ed9c43735b4
Gerrit-Change-Number: 42804
Gerrit-PatchSet: 5
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/+/42802?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: CCID: Check if reader restarts WWT upon NULL procedure byte
......................................................................
CCID: Check if reader restarts WWT upon NULL procedure byte
The reader will receive a NULL procedure byte every 0.2 for a long time.
The reader may only respond with a status that time extension was
requested. At the end the SIM proceeds with a valid response. This
response must be returned by the reader.
Change-Id: I4eb09e86f88df19d96e9ec55872654352ca2ebd5
---
M ccid/CCID_Tests.ttcn
1 file changed, 56 insertions(+), 0 deletions(-)
Approvals:
Hoernchen: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/ccid/CCID_Tests.ttcn b/ccid/CCID_Tests.ttcn
index 1d1be35..f4470f1 100644
--- a/ccid/CCID_Tests.ttcn
+++ b/ccid/CCID_Tests.ttcn
@@ -705,6 +705,61 @@
f_start_and_wait();
}
+/* The SIM responds with many procedure bytes to prevent timeout. */
+private function f_TC_null_procedure_byte() runs on CardemSlot_CT
+{
+ var octetstring req := c_SIM_READ_BINARY;
+ var octetstring res := '0102030405060708090a9000'O;
+ var CCID_PDU ccid_pdu;
+ var integer i;
+
+ 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));
+ for (i := 0; i < 40; i := i+1) {
+ /* Transmit NULL procedure byte by SIM. */
+ f_cardem_transmit(ts_SIMTRACE_CEMU_TX_DATA(ts_CardEmu_DataFlags(pb_and_tx := true, final := false),
+ '60'O));
+ /* Eat the possible 'Time Extension status' */
+ timer T := 0.2;
+ T.start;
+ alt {
+ [] CCID.receive(tr_CCID_DataBlock(g_slot_nr, ?, tr_CCID_HeaderIN(?, CCID_CMD_STATUS_TIME_EXT, ?), ?)) {
+ log("Eating 'Time Extension status'.");
+ repeat;
+ }
+ [] as_ccid_any();
+ [] T.timeout { }
+ }
+ }
+ /* Transmit the response by SIM. */
+ f_cardem_transmit(ts_SIMTRACE_CEMU_TX_DATA(ts_CardEmu_DataFlags(pb_and_tx := true, final := true),
+ req[1] & res));
+ /* Receive the response from reader. */
+ ccid_pdu := f_ccid_receive(tr_CCID_DataBlock(g_slot_nr, ?, ?, ?));
+ if (ccid_pdu.u.DataBlock.abData != res) {
+ setverdict(fail, "Unexpected SW1/SW2");
+ mtc.stop;
+ }
+
+ /* Stop simtrace emulation, to prevent race condition. */
+ vc_Cardem.stop;
+ vc_Cardem.done;
+}
+testcase TC_null_procedure_byte() runs on Test_CT
+{
+ f_init();
+
+ f_start_handler(refers(f_TC_null_procedure_byte), mp_simtrace_slot, true);
+
+ f_start_and_wait();
+}
+
/* TODO */
@@ -910,6 +965,7 @@
execute( TC_simtrace_test() );
execute( TC_255_bytes_response() );
execute( TC_256_bytes_response() );
+ execute( TC_null_procedure_byte() );
/* error handling */
execute( TC_inval_slot() );
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42802?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: I4eb09e86f88df19d96e9ec55872654352ca2ebd5
Gerrit-Change-Number: 42802
Gerrit-PatchSet: 5
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/+/42801?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: CCID: Check if reader handles special P3 value 0x00 correctly
......................................................................
CCID: Check if reader handles special P3 value 0x00 correctly
If data is requested from SIM with P3 set 0x00, it means that 256
bytes are requested. The reader will receive a procedure byte, which
must cause it to receive all 256 data bytes + two status words.
Change-Id: Icc3fd1937b9829fcf825c58d7b676aa2be2c48e7
---
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 53753c3..1d1be35 100644
--- a/ccid/CCID_Tests.ttcn
+++ b/ccid/CCID_Tests.ttcn
@@ -667,6 +667,44 @@
f_start_and_wait();
}
+/* The SIM responds with 256 bytes. */
+private function f_TC_256_bytes_response() runs on CardemSlot_CT
+{
+ var octetstring req := c_UICC_GET_RESPONSE_BASE & '00'O;
+ var octetstring res := '232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323429000'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),
+ req[1] & res));
+ /* Receive the response from reader. */
+ ccid_pdu := f_ccid_receive(tr_CCID_DataBlock(g_slot_nr, ?, ?, ?));
+ if (ccid_pdu.u.DataBlock.abData != res) {
+ setverdict(fail, "Unexpected SW1/SW2");
+ mtc.stop;
+ }
+
+ /* Stop simtrace emulation, to prevent race condition. */
+ vc_Cardem.stop;
+ vc_Cardem.done;
+}
+testcase TC_256_bytes_response() runs on Test_CT
+{
+ f_init();
+
+ f_start_handler(refers(f_TC_256_bytes_response), mp_simtrace_slot, true);
+
+ f_start_and_wait();
+}
+
/* TODO */
@@ -871,6 +909,7 @@
execute( TC_successful_case_2_3() );
execute( TC_simtrace_test() );
execute( TC_255_bytes_response() );
+ execute( TC_256_bytes_response() );
/* error handling */
execute( TC_inval_slot() );
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42801?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: Icc3fd1937b9829fcf825c58d7b676aa2be2c48e7
Gerrit-Change-Number: 42801
Gerrit-PatchSet: 5
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: Hoernchen, jolly, 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 (#5).
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 procedure byte in advance of the two status bytes
towards the reader. The reader expects SW1 instead of the status byte,
so that it returns it as SW1.
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/5
--
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: 5
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-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: Hoernchen, jolly, laforge.
Hello Hoernchen, Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42796?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review-1 by Hoernchen, Verified+1 by Jenkins Builder
Change subject: CCID: Send a wrong procedure byte towards the reader
......................................................................
CCID: Send a wrong procedure byte towards the reader
A case 3 request is send 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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/96/42796/5
--
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: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iaa0bd8845b3408fba309874fe41c855d8e7efccc
Gerrit-Change-Number: 42796
Gerrit-PatchSet: 5
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-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: jolly.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42827?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: CCID: Add testenv.cfg to run tests using testenv
......................................................................
CCID: Add testenv.cfg to run tests using testenv
Change-Id: I97c9da414facf438aa28d5200c4152730ff763a2
---
A ccid/testenv.cfg
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/27/42827/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42827?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: I97c9da414facf438aa28d5200c4152730ff763a2
Gerrit-Change-Number: 42827
Gerrit-PatchSet: 4
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Attention is currently required from: jolly.
Hello Hoernchen, Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42804?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: CCID: Check if reader sends request TPDU with maximum size
......................................................................
CCID: Check if reader sends request TPDU with maximum size
The maximum size of a request TPDU can have 5 bytes header and 255 bytes
data. It is expected that the reader transmits all bytes to SIM without
failure.
Change-Id: I7c1cb52b578c19d6c0ec1493e45f6ed9c43735b4
---
M ccid/CCID_Tests.ttcn
1 file changed, 44 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/04/42804/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42804?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: I7c1cb52b578c19d6c0ec1493e45f6ed9c43735b4
Gerrit-Change-Number: 42804
Gerrit-PatchSet: 5
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>