laforge submitted this change.
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
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(-)
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 change 42801. To unsubscribe, or for help writing mail filters, visit settings.