<p>Kévin Redon has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9855">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update<br><br>Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922<br>---<br>M firmware/libcommon/source/sniffer.c<br>1 file changed, 363 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/55/9855/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c</span><br><span>index 987e3e5..c71c491 100644</span><br><span>--- a/firmware/libcommon/source/sniffer.c</span><br><span>+++ b/firmware/libcommon/source/sniffer.c</span><br><span>@@ -17,8 +17,10 @@</span><br><span>  * along with this program.  If not, see <http://www.gnu.org/licenses/>.</span><br><span>  *</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-/* This code implement the Sniffer mode to sniff the communication between a SIM card and a phone.</span><br><span style="color: hsl(120, 100%, 40%);">+/* This code implement the Sniffer mode to sniff the communication between a SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card reader).</span><br><span>  * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used.</span><br><span style="color: hsl(120, 100%, 40%);">+ *  TODO handle RST, PTS, and send data over USB</span><br><span style="color: hsl(120, 100%, 40%);">+ *  TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4)</span><br><span>  */</span><br><span> #include "board.h"</span><br><span> #include "simtrace.h"</span><br><span>@@ -30,19 +32,22 @@</span><br><span>  *------------------------------------------------------------------------------*/</span><br><span> </span><br><span> #include <string.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include "utils.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include "iso7816_fidi.h"</span><br><span> </span><br><span> /*------------------------------------------------------------------------------</span><br><span>  *         Internal definitions</span><br><span>  *------------------------------------------------------------------------------*/</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/** Maximum ucSize in bytes of the smartcard answer to a command.*/</span><br><span style="color: hsl(0, 100%, 40%);">-#define MAX_ANSWER_SIZE         10</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/*! Maximum Answer-To-Reset (ATR) size in bytes ucSize in bytes</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Maximum Answer-To-Reset (ATR) size in bytes</span><br><span>  *  @note defined in ISO/IEC 7816-3:2006(E) section 8.2.1 as 32, on top the initial character TS of section 8.1</span><br><span>  *  @remark technical there is no size limitation since Yi present in T0,TDi will indicate if more interface bytes are present, including TDi+i</span><br><span>  */</span><br><span> #define MAX_ATR_SIZE 33</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Maximum Protocol and Parameters Selection (PPS) size in bytes</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @note defined in ISO/IEC 7816-3:2006(E) section 9.2</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+#define MAX_PPS_SIZE 6</span><br><span> </span><br><span> /*! ISO 7816-3 states relevant to the sniff mode */</span><br><span> enum iso7816_3_sniff_state {</span><br><span>@@ -51,7 +56,9 @@</span><br><span>        ISO7816_S_IN_ATR, /*!< while we are receiving the ATR */</span><br><span>  ISO7816_S_WAIT_APDU, /*!< waiting for start of new APDU */</span><br><span>        ISO7816_S_IN_APDU, /*!< inside a single APDU */</span><br><span style="color: hsl(0, 100%, 40%);">-      ISO7816_S_IN_PTS, /*!< while we are inside the PTS / PSS */</span><br><span style="color: hsl(120, 100%, 40%);">+        ISO7816_S_IN_PPS_REQ, /*!< while we are inside the PPS request */</span><br><span style="color: hsl(120, 100%, 40%);">+  ISO7816_S_WAIT_PPS_RSP, /*!< waiting for start of the PPS response */</span><br><span style="color: hsl(120, 100%, 40%);">+      ISO7816_S_IN_PPS_RSP, /*!< while we are inside the PPS request */</span><br><span> };</span><br><span> </span><br><span> /*! Answer-To-Reset (ATR) sub-states of ISO7816_S_IN_ATR</span><br><span>@@ -66,7 +73,18 @@</span><br><span>      ATR_S_WAIT_TD, /*!< fourth sub-group interface byte */</span><br><span>    ATR_S_WAIT_HIST, /*!< historical byte */</span><br><span>  ATR_S_WAIT_TCK, /*!< check byte */</span><br><span style="color: hsl(0, 100%, 40%);">-   ATR_S_DONE, /*!< to indicated all ATR bytes have been received */</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Protocol and Parameters Selection (PPS) sub-states of ISO7816_S_IN_PTS_REQ/ISO7816_S_IN_PTS_RSP</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @note defined in ISO/IEC 7816-3:2006(E) section 9</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+enum pps_sniff_state {</span><br><span style="color: hsl(120, 100%, 40%);">+   PPS_S_WAIT_PPSS, /*!< initial byte */</span><br><span style="color: hsl(120, 100%, 40%);">+      PPS_S_WAIT_PPS0, /*!< format byte */</span><br><span style="color: hsl(120, 100%, 40%);">+       PPS_S_WAIT_PPS1, /*!< first parameter byte */</span><br><span style="color: hsl(120, 100%, 40%);">+      PPS_S_WAIT_PPS2, /*!< second parameter byte */</span><br><span style="color: hsl(120, 100%, 40%);">+     PPS_S_WAIT_PPS3, /*!< third parameter byte */</span><br><span style="color: hsl(120, 100%, 40%);">+      PPS_S_WAIT_PCK, /*!< check byte */</span><br><span> };</span><br><span> </span><br><span> /*------------------------------------------------------------------------------</span><br><span>@@ -77,36 +95,328 @@</span><br><span>  * to support a second sniffer interface the code should be restructured to use handles.</span><br><span>  */</span><br><span> /* Pin configurations */</span><br><span style="color: hsl(0, 100%, 40%);">-/* Pin configuration to sniff communication (using USART connection card) */</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Pin configuration to sniff communication (using USART connection card) */</span><br><span> static const Pin pins_sniff[] = { PINS_SIM_SNIFF };</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Pin configuration to interconnect phone and card using the bus switch */</span><br><span> static const Pin pins_bus[] = { PINS_BUS_SNIFF };</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Pin configuration to power the card by the phone */</span><br><span> static const Pin pins_power[] = { PINS_PWR_SNIFF };</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Pin configuration for timer counter to measure ETU timing */</span><br><span> static const Pin pins_tc[] = { PINS_TC };</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Pin configuration for card reset line */</span><br><span style="color: hsl(120, 100%, 40%);">+static const Pin pin_rst = PIN_SIM_RST_SNIFF;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* USART related variables */</span><br><span style="color: hsl(0, 100%, 40%);">-/* USART peripheral used to sniff communication */</span><br><span style="color: hsl(120, 100%, 40%);">+/*! USART peripheral used to sniff communication */</span><br><span> static struct Usart_info sniff_usart = {</span><br><span>     .base = USART_SIM,</span><br><span>   .id = ID_USART_SIM,</span><br><span>  .state = USART_RCV,</span><br><span> };</span><br><span style="color: hsl(0, 100%, 40%);">-/* Ring buffer to store sniffer communication data */</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Ring buffer to store sniffer communication data */</span><br><span> static struct ringbuf sniff_buffer;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* ISO 7816 variables */</span><br><span style="color: hsl(120, 100%, 40%);">+/*! ISO 7816-3 state */</span><br><span style="color: hsl(120, 100%, 40%);">+enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET;</span><br><span style="color: hsl(120, 100%, 40%);">+/*! ATR state */</span><br><span style="color: hsl(120, 100%, 40%);">+enum atr_sniff_state atr_state;</span><br><span style="color: hsl(120, 100%, 40%);">+/*! ATR data</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @remark can be used to check later protocol changes</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+uint8_t atr[MAX_ATR_SIZE];</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Current index in the ATR data */</span><br><span style="color: hsl(120, 100%, 40%);">+uint8_t atr_i = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+/*! If convention conversion is needed */</span><br><span style="color: hsl(120, 100%, 40%);">+bool convention_convert = false;</span><br><span style="color: hsl(120, 100%, 40%);">+/*! The supported T protocols */</span><br><span style="color: hsl(120, 100%, 40%);">+uint16_t t_protocol_support = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+/*! PPS state </span><br><span style="color: hsl(120, 100%, 40%);">+ *  @remark it is shared between request and response since they aren't simultaneous but follow the same procedure</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+enum pps_sniff_state pps_state;</span><br><span style="color: hsl(120, 100%, 40%);">+/*! PPS request data</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @remark can be used to check PPS response</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+uint8_t pps_req[MAX_PPS_SIZE];</span><br><span style="color: hsl(120, 100%, 40%);">+/*! PPS response data */</span><br><span style="color: hsl(120, 100%, 40%);">+uint8_t pps_rsp[MAX_PPS_SIZE];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*------------------------------------------------------------------------------</span><br><span>  *         Internal functions</span><br><span>  *------------------------------------------------------------------------------*/</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Convert data between direct and inverse convention</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @note direct convention is LSb first and HIGH=1; inverse conversion in MSb first and LOW=1</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @remark use a look up table to speed up conversion</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, };</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Update the ISO 7816-3 state</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @param[in] iso_state_new new ISO 7816-3 state to update to</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+static void change_state(enum iso7816_3_sniff_state iso_state_new)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+   /* sanity check */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (iso_state_new==iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+               TRACE_WARNING("Already in ISO 7816 state %u\n\r", iso_state);</span><br><span style="color: hsl(120, 100%, 40%);">+               return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* handle actions to perform when switching state */</span><br><span style="color: hsl(120, 100%, 40%);">+  switch (iso_state_new) {</span><br><span style="color: hsl(120, 100%, 40%);">+      case ISO7816_S_RESET:</span><br><span style="color: hsl(120, 100%, 40%);">+         update_fidi(sniff_usart.base, 0x11); /* reset baud rate to default Di/Fi values */</span><br><span style="color: hsl(120, 100%, 40%);">+            // TODO disable USART and TC</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case ISO7816_S_WAIT_ATR:</span><br><span style="color: hsl(120, 100%, 40%);">+              rbuf_reset(&sniff_buffer); /* reset buffer for new communication */</span><br><span style="color: hsl(120, 100%, 40%);">+               // TODO enable USART and TC</span><br><span style="color: hsl(120, 100%, 40%);">+           break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case ISO7816_S_IN_ATR:</span><br><span style="color: hsl(120, 100%, 40%);">+                atr_i = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+            convention_convert = false;</span><br><span style="color: hsl(120, 100%, 40%);">+           t_protocol_support = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+               atr_state = ATR_S_WAIT_TS;</span><br><span style="color: hsl(120, 100%, 40%);">+            break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case ISO7816_S_IN_PPS_REQ:</span><br><span style="color: hsl(120, 100%, 40%);">+    case ISO7816_S_IN_PPS_RSP:</span><br><span style="color: hsl(120, 100%, 40%);">+            pps_state = PPS_S_WAIT_PPSS;</span><br><span style="color: hsl(120, 100%, 40%);">+          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        default:</span><br><span style="color: hsl(120, 100%, 40%);">+              break;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* save new state */</span><br><span style="color: hsl(120, 100%, 40%);">+  iso_state = iso_state_new;</span><br><span style="color: hsl(120, 100%, 40%);">+    TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Process ATR byte</span><br><span style="color: hsl(120, 100%, 40%);">+ *  @param[in] byte ATR byte to process</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+static void process_byte_atr(uint8_t byte)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        static uint8_t atr_hist_len = 0; /* store the number of expected historical bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+  static uint8_t y = 0; /* last mask of the upcoming TA, TB, TC, TD interface bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* sanity check */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (ISO7816_S_IN_ATR!=iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+            TRACE_ERROR("Processing ATR data in wrong ISO 7816-3 state %u\n\r", iso_state);</span><br><span style="color: hsl(120, 100%, 40%);">+             return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (atr_i>=ARRAY_SIZE(atr)) {</span><br><span style="color: hsl(120, 100%, 40%);">+              TRACE_WARNING("ATR data overflow\n\r");</span><br><span style="color: hsl(120, 100%, 40%);">+             return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* save data for use by other functions */</span><br><span style="color: hsl(120, 100%, 40%);">+    atr[atr_i++] = byte;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* handle ATR byte depending on current state */</span><br><span style="color: hsl(120, 100%, 40%);">+      switch (atr_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+  case ATR_S_WAIT_TS: /* see ISO/IEC 7816-3:2006 section 8.1 */</span><br><span style="color: hsl(120, 100%, 40%);">+         switch (byte) {</span><br><span style="color: hsl(120, 100%, 40%);">+               case 0x23: /* direct convention used, but decoded using inverse convention (a parity error should also have occurred) */</span><br><span style="color: hsl(120, 100%, 40%);">+              case 0x30: /* inverse convention used, but decoded using direct convention (a parity error should also have occurred) */</span><br><span style="color: hsl(120, 100%, 40%);">+                      convention_convert = !convention_convert;</span><br><span style="color: hsl(120, 100%, 40%);">+             case 0x3b: /* direct convention used and correctly decoded */</span><br><span style="color: hsl(120, 100%, 40%);">+         case 0x3f: /* inverse convention used and correctly decoded */</span><br><span style="color: hsl(120, 100%, 40%);">+                        atr_state = ATR_S_WAIT_T0; /* wait for format byte */</span><br><span style="color: hsl(120, 100%, 40%);">+                 break;</span><br><span style="color: hsl(120, 100%, 40%);">+                default:</span><br><span style="color: hsl(120, 100%, 40%);">+                      atr_i--; /* revert last byte */</span><br><span style="color: hsl(120, 100%, 40%);">+                       TRACE_WARNING("Invalid TS received\n\r");</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+             break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case ATR_S_WAIT_T0: /* see ISO/IEC 7816-3:2006 section 8.2.2 */</span><br><span style="color: hsl(120, 100%, 40%);">+       case ATR_S_WAIT_TD: /* see ISO/IEC 7816-3:2006 section 8.2.3 */</span><br><span style="color: hsl(120, 100%, 40%);">+               if (ATR_S_WAIT_T0==atr_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       atr_hist_len = (byte&0x0f); /* save the number of historical bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+             } else if (ATR_S_WAIT_TD==atr_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        t_protocol_support |= (1<<(byte&0x0f)); /* remember supported protocol to know if TCK will be present */</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span style="color: hsl(120, 100%, 40%);">+             y = (byte&0xf0); /* remember upcoming interface bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+          if (y&0x10) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     atr_state = ATR_S_WAIT_TA; /* wait for interface byte TA */</span><br><span style="color: hsl(120, 100%, 40%);">+                   break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case ATR_S_WAIT_TA: /* see ISO/IEC 7816-3:2006 section 8.2.3 */</span><br><span style="color: hsl(120, 100%, 40%);">+               if (y&0x20) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     atr_state = ATR_S_WAIT_TB; /* wait for interface byte TB */</span><br><span style="color: hsl(120, 100%, 40%);">+                   break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case ATR_S_WAIT_TB: /* see ISO/IEC 7816-3:2006 section 8.2.3 */</span><br><span style="color: hsl(120, 100%, 40%);">+               if (y&0x40) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     atr_state = ATR_S_WAIT_TC; /* wait for interface byte TC */</span><br><span style="color: hsl(120, 100%, 40%);">+                   break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */</span><br><span style="color: hsl(120, 100%, 40%);">+               if (y&0x80) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     atr_state = ATR_S_WAIT_TD; /* wait for interface byte TD */</span><br><span style="color: hsl(120, 100%, 40%);">+                   break;</span><br><span style="color: hsl(120, 100%, 40%);">+                } else if (atr_hist_len) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    atr_state = ATR_S_WAIT_HIST; /* wait for historical bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+                  break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case ATR_S_WAIT_HIST: /* see ISO/IEC 7816-3:2006 section 8.2.4 */</span><br><span style="color: hsl(120, 100%, 40%);">+             if (atr_hist_len) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   atr_hist_len--;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+             if (0==atr_hist_len) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        if (t_protocol_support>1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                atr_state = ATR_S_WAIT_TCK; /* wait for check bytes */</span><br><span style="color: hsl(120, 100%, 40%);">+                                break;</span><br><span style="color: hsl(120, 100%, 40%);">+                        }</span><br><span style="color: hsl(120, 100%, 40%);">+             } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case ATR_S_WAIT_TCK:  /* see ISO/IEC 7816-3:2006 section 8.2.5 */</span><br><span style="color: hsl(120, 100%, 40%);">+             /* we could verify the checksum, but we are just here to sniff */</span><br><span style="color: hsl(120, 100%, 40%);">+             change_state(ISO7816_S_WAIT_APDU); /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+             break;</span><br><span style="color: hsl(120, 100%, 40%);">+        default:</span><br><span style="color: hsl(120, 100%, 40%);">+              TRACE_INFO("Unknown ATR state %u\n\r", atr_state);</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static void process_byte_pps(uint8_t byte)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ uint8_t *pps_cur; /* current PPS (request or response) */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* sanity check */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (ISO7816_S_IN_PPS_REQ==iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                pps_cur = pps_req;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else if (ISO7816_S_IN_PPS_RSP==iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+         pps_cur = pps_rsp;</span><br><span style="color: hsl(120, 100%, 40%);">+    } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              TRACE_ERROR("Processing PPS data in wrong ISO 7816-3 state %u\n\r", iso_state);</span><br><span style="color: hsl(120, 100%, 40%);">+             return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* handle PPS byte depending on current state */</span><br><span style="color: hsl(120, 100%, 40%);">+      switch (pps_state) { /* see ISO/IEC 7816-3:2006 section 9.2 */</span><br><span style="color: hsl(120, 100%, 40%);">+        case PPS_S_WAIT_PPSS: /*!< initial byte */</span><br><span style="color: hsl(120, 100%, 40%);">+         if (0xff) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   pps_cur[0] = byte;</span><br><span style="color: hsl(120, 100%, 40%);">+                    pps_state = PPS_S_WAIT_PPS0; /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+           } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      TRACE_INFO("Invalid PPSS received\n\r");</span><br><span style="color: hsl(120, 100%, 40%);">+                    change_state(ISO7816_S_WAIT_APDU); /* go back to APDU state */</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+             break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case PPS_S_WAIT_PPS0: /*!< format byte */</span><br><span style="color: hsl(120, 100%, 40%);">+          pps_cur[1] = byte;</span><br><span style="color: hsl(120, 100%, 40%);">+            if (pps_cur[1]&0x10) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    pps_state = PPS_S_WAIT_PPS1; /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+                   break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case PPS_S_WAIT_PPS1: /*!< first parameter byte */</span><br><span style="color: hsl(120, 100%, 40%);">+         pps_cur[2] = byte; /* not always right but doesn't affect the process */</span><br><span style="color: hsl(120, 100%, 40%);">+          if (pps_cur[1]&0x20) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    pps_state = PPS_S_WAIT_PPS2; /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+                   break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case PPS_S_WAIT_PPS2: /*!< second parameter byte */</span><br><span style="color: hsl(120, 100%, 40%);">+                pps_cur[3] = byte; /* not always right but doesn't affect the process */</span><br><span style="color: hsl(120, 100%, 40%);">+          if (pps_cur[1]&0x40) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    pps_state = PPS_S_WAIT_PPS3; /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+                   break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case PPS_S_WAIT_PPS3: /*!< third parameter byte */</span><br><span style="color: hsl(120, 100%, 40%);">+         pps_cur[4] = byte; /* not always right but doesn't affect the process */</span><br><span style="color: hsl(120, 100%, 40%);">+          pps_state = PPS_S_WAIT_PCK; /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+            break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case PPS_S_WAIT_PCK: /*!< check byte */</span><br><span style="color: hsl(120, 100%, 40%);">+            pps_cur[5] = byte; /* not always right but doesn't affect the process */</span><br><span style="color: hsl(120, 100%, 40%);">+          /* verify the checksum */</span><br><span style="color: hsl(120, 100%, 40%);">+             uint8_t check = 0; </span><br><span style="color: hsl(120, 100%, 40%);">+           check ^= pps_cur[0];</span><br><span style="color: hsl(120, 100%, 40%);">+          check ^= pps_cur[1];</span><br><span style="color: hsl(120, 100%, 40%);">+          if (pps_cur[1]&0x10) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    check ^= pps_cur[2];</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             if (pps_cur[1]&0x20) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    check ^= pps_cur[3];</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             if (pps_cur[1]&0x40) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    check ^= pps_cur[4];</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+             check ^= pps_cur[5];</span><br><span style="color: hsl(120, 100%, 40%);">+          if (ISO7816_S_IN_PPS_REQ==iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        if (0==check) { /* checksum is valid */</span><br><span style="color: hsl(120, 100%, 40%);">+                               change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+                  } else { /* checksum is invalid */</span><br><span style="color: hsl(120, 100%, 40%);">+                            change_state(ISO7816_S_WAIT_APDU); /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             } else if (ISO7816_S_IN_PPS_RSP==iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 if (0==check) { /* checksum is valid */</span><br><span style="color: hsl(120, 100%, 40%);">+                               uint8_t fn, dn;</span><br><span style="color: hsl(120, 100%, 40%);">+                               if (pps_cur[1]&0x10) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                    fn = (pps_cur[2]>>4);</span><br><span style="color: hsl(120, 100%, 40%);">+                                   dn = (pps_cur[2]&0x0f);</span><br><span style="color: hsl(120, 100%, 40%);">+                           } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                                      fn = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+                                       dn = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+                               }</span><br><span style="color: hsl(120, 100%, 40%);">+                             TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fn, dn);</span><br><span style="color: hsl(120, 100%, 40%);">+                          update_fidi(sniff_usart.base, pps_cur[2]);</span><br><span style="color: hsl(120, 100%, 40%);">+            rbuf_reset(&sniff_buffer); /* reset buffer for new communication */</span><br><span style="color: hsl(120, 100%, 40%);">+                       } else { /* checksum is invalid */</span><br><span style="color: hsl(120, 100%, 40%);">+                            TRACE_INFO("PPS negotiation failed\n\r");</span><br><span style="color: hsl(120, 100%, 40%);">+                   }</span><br><span style="color: hsl(120, 100%, 40%);">+                     change_state(ISO7816_S_WAIT_APDU); /* co to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+             break;</span><br><span style="color: hsl(120, 100%, 40%);">+        default:</span><br><span style="color: hsl(120, 100%, 40%);">+              TRACE_INFO("Unknown PPS state %u\n\r", pps_state);</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static void process_byte_apdu(uint8_t byte)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static void check_sniffed_data(void)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        /* Display sniffed data */</span><br><span style="color: hsl(120, 100%, 40%);">+    /* Handle sniffed data */</span><br><span>    while (!rbuf_is_empty(&sniff_buffer)) {</span><br><span>          uint8_t byte = rbuf_read(&sniff_buffer);</span><br><span style="color: hsl(0, 100%, 40%);">-            TRACE_INFO_WP("0x%02x ", byte);</span><br><span style="color: hsl(120, 100%, 40%);">+             TRACE_WARNING_WP("< 0x%02x\n\r", byte);</span><br><span style="color: hsl(120, 100%, 40%);">+          switch (iso_state) { /* Handle byte depending on state */</span><br><span style="color: hsl(120, 100%, 40%);">+             case ISO7816_S_RESET: /* During reset we shouldn't receive any data */</span><br><span style="color: hsl(120, 100%, 40%);">+                    break;</span><br><span style="color: hsl(120, 100%, 40%);">+                case ISO7816_S_WAIT_ATR: /* After a reset we expect the ATR */</span><br><span style="color: hsl(120, 100%, 40%);">+                        change_state(ISO7816_S_IN_ATR); /* go to next state */</span><br><span style="color: hsl(120, 100%, 40%);">+                case ISO7816_S_IN_ATR: /* More ATR data incoming */</span><br><span style="color: hsl(120, 100%, 40%);">+                   process_byte_atr(byte);</span><br><span style="color: hsl(120, 100%, 40%);">+                       break;</span><br><span style="color: hsl(120, 100%, 40%);">+                case ISO7816_S_WAIT_APDU: /* After the ATR we expect APDU or PPS data */</span><br><span style="color: hsl(120, 100%, 40%);">+              case ISO7816_S_WAIT_PPS_RSP:</span><br><span style="color: hsl(120, 100%, 40%);">+                  if (byte == 0xff) {</span><br><span style="color: hsl(120, 100%, 40%);">+                           if (ISO7816_S_WAIT_PPS_RSP==iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                      change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */</span><br><span style="color: hsl(120, 100%, 40%);">+                             } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                                      change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span style="color: hsl(120, 100%, 40%);">+                             process_byte_pps(byte);</span><br><span style="color: hsl(120, 100%, 40%);">+                               break;</span><br><span style="color: hsl(120, 100%, 40%);">+                        }</span><br><span style="color: hsl(120, 100%, 40%);">+             case ISO7816_S_IN_APDU: /* More APDU data incoming */</span><br><span style="color: hsl(120, 100%, 40%);">+                 process_byte_apdu(byte);</span><br><span style="color: hsl(120, 100%, 40%);">+                      break;</span><br><span style="color: hsl(120, 100%, 40%);">+                case ISO7816_S_IN_PPS_REQ:</span><br><span style="color: hsl(120, 100%, 40%);">+            case ISO7816_S_IN_PPS_RSP:</span><br><span style="color: hsl(120, 100%, 40%);">+                    process_byte_pps(byte);</span><br><span style="color: hsl(120, 100%, 40%);">+                       break;</span><br><span style="color: hsl(120, 100%, 40%);">+                default:</span><br><span style="color: hsl(120, 100%, 40%);">+                      TRACE_ERROR("Data received in unknown state %u\n\r", iso_state);</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span>    }</span><br><span> }</span><br><span> </span><br><span> /*! Interrupt Service Routine called on USART activity */</span><br><span style="color: hsl(0, 100%, 40%);">-void Sniffer_usart_irq(void)</span><br><span style="color: hsl(120, 100%, 40%);">+void Sniffer_usart_isr(void)</span><br><span> {</span><br><span>       /* Read channel status register */</span><br><span>   uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR;</span><br><span>@@ -114,11 +424,36 @@</span><br><span>        if (csr & US_CSR_RXRDY) {</span><br><span>                /* Read communication data byte between phone and SIM */</span><br><span>             uint8_t byte = sniff_usart.base->US_RHR;</span><br><span style="color: hsl(120, 100%, 40%);">+           /* Convert convention if required */</span><br><span style="color: hsl(120, 100%, 40%);">+          if (convention_convert) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     byte = convention_convert_lut[byte];</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span>            /* Store sniffed data into buffer (also clear interrupt */</span><br><span>           rbuf_write(&sniff_buffer, byte);</span><br><span>         }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/** PIO interrupt service routine to checks if the card reset line has changed</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+static void Sniffer_reset_isr(const Pin* pPin)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    /* Ensure an edge on the reset pin cause the interrupt */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (pPin->id!=pin_rst.id || 0==(pPin->mask&pin_rst.mask)) {</span><br><span style="color: hsl(120, 100%, 40%);">+         TRACE_ERROR("Pin other than reset caused a interrupt\n\r");</span><br><span style="color: hsl(120, 100%, 40%);">+         return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Update the ISO state according to the reset change */</span><br><span style="color: hsl(120, 100%, 40%);">+      if (PIO_Get(&pin_rst)) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (ISO7816_S_WAIT_ATR!=iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  change_state(ISO7816_S_WAIT_ATR);</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              if (ISO7816_S_RESET!=iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     change_state(ISO7816_S_RESET);</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*------------------------------------------------------------------------------</span><br><span>  *         Global functions</span><br><span>  *------------------------------------------------------------------------------*/</span><br><span>@@ -126,14 +461,14 @@</span><br><span> void Sniffer_usart1_irq(void)</span><br><span> {</span><br><span>        if (ID_USART1==sniff_usart.id) {</span><br><span style="color: hsl(0, 100%, 40%);">-                Sniffer_usart_irq();</span><br><span style="color: hsl(120, 100%, 40%);">+          Sniffer_usart_isr();</span><br><span>         }</span><br><span> }</span><br><span> </span><br><span> void Sniffer_usart0_irq(void)</span><br><span> {</span><br><span>     if (ID_USART0==sniff_usart.id) {</span><br><span style="color: hsl(0, 100%, 40%);">-                Sniffer_usart_irq();</span><br><span style="color: hsl(120, 100%, 40%);">+          Sniffer_usart_isr();</span><br><span>         }</span><br><span> }</span><br><span> </span><br><span>@@ -153,8 +488,9 @@</span><br><span>     TRACE_INFO("Sniffer exit\n\r");</span><br><span>    USART_DisableIt(sniff_usart.base, US_IER_RXRDY);</span><br><span>     /* NOTE: don't forget to set the IRQ according to the USART peripheral used */</span><br><span style="color: hsl(0, 100%, 40%);">-      NVIC_DisableIRQ(USART0_IRQn);</span><br><span style="color: hsl(120, 100%, 40%);">+ NVIC_DisableIRQ(IRQ_USART_SIM);</span><br><span>      USART_SetReceiverEnabled(sniff_usart.base, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+        </span><br><span> }</span><br><span> </span><br><span> /* called when *Sniffer* configuration is set by host */</span><br><span>@@ -168,6 +504,12 @@</span><br><span>         PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus));</span><br><span>     /* Configure pins to forward phone power to card */</span><br><span>  PIO_Configure(pins_power, PIO_LISTSIZE(pins_power));</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Enable interrupts on port with reset line */</span><br><span style="color: hsl(120, 100%, 40%);">+       NVIC_EnableIRQ(PIOA_IRQn); /* CAUTION this needs to match to the correct port */</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Register ISR to handle card reset change */</span><br><span style="color: hsl(120, 100%, 40%);">+        PIO_ConfigureIt(&pin_rst, &Sniffer_reset_isr);</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Enable interrupt on card reset pin */</span><br><span style="color: hsl(120, 100%, 40%);">+      PIO_EnableIt(&pin_rst);</span><br><span> </span><br><span>      /* Clear ring buffer containing the sniffed data */</span><br><span>  rbuf_reset(&sniff_buffer);</span><br><span>@@ -180,10 +522,13 @@</span><br><span>       /* Enable interrupt requests for the USART peripheral */</span><br><span>     NVIC_EnableIRQ(IRQ_USART_SIM);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      /* TODO configure RST pin ISR */</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Reset state */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (ISO7816_S_RESET!=iso_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+             change_state(ISO7816_S_RESET);</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* main (idle/busy) loop of this USB configuration */</span><br><span style="color: hsl(120, 100%, 40%);">+/* Main (idle/busy) loop of this USB configuration */</span><br><span> void Sniffer_run(void)</span><br><span> {</span><br><span>        check_sniffed_data();</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9855">change 9855</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9855"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 </div>
<div style="display:none"> Gerrit-Change-Number: 9855 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>