# Collective Attestation for Manageable IoT Environments
## 4 Design
### Maintenance Phase  
In the management phase, the network operator can prepare, update or replace the devices offline. The offline or on-site manual jobs are inevitable to manage swarm networks since the ROM-based minimal hardware anchors prevent the remote over-the-air (OTA) update from covering all the updates. The network operator injects a component tag to each software component and generates a device tag to easily maintain devices. **Component tag. ** Making every software component distinguishable is helpful to find a compromised component as well as to detect absent (disappeared) devices from the measurement. For this purpose, CAMIE puts a unique tag within each software component. Once the tag is embedded in the program code, it is protected by the hardware mechanisms of the minimal trust anchor [15; 16; 17]. If ones store the component tags in a separate storage instead of injecting the tags, it requires an additional process to validate whether the binding between metadata and binary codes are secure, as in property-base attestation [25]. Thus, we choose the direct tag injection approach. More formally, when the network operator installs or updates a software component to a device \(D_{i}\), the network operator newly generates a random value for a tag, \(\tau_{i}\) for each software component \(s_{ik}\). **Tag injection. ** To put a tag in the program code without modifying the program semantics, there are two options: (1) to use the operand of side effect free instructions (e.g., prefetchnta in the x86 architecture), and (2) to use a tag with a bypassing branch, which uses a relative-address jump (e.g., b in the ARM architecture) to skip the tag. Figure 2 shows the examples of the two approaches. The former \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbol** & **Description** \\ \hline \(\mathbb{D}\) & a set of all devices in a swarm \\ \(D_{i}\) & the \(i\)-th device in \(\mathbb{D}\) \\ \(\mathbb{B}_{i}\) & Device tag of \(D_{i}\) \\ \(s_{i}\) & A software components \\ \(\tau_{i}\) & A component tag for \(s_{i}\) \\ \(\Gamma\) & A map \(\mathbb{B}_{i}\mapsto\{(s_{i1},\tau_{1}),\cdots,(s_{i2},\tau_{2})\). \(bfid_{i}\mapsto(s_{i},\tau_{i})\}\) \\ \(K_{ij}\) & A pairwise attestation key \(K_{ij}\) between \(D_{i}\) and \(D_{j}\) \\ \(A_{i}\) & The list of neighbors of \(D_{i}\) \\ \(C_{i}\) & The children set of \(D_{i}\) in the attestation tree. \\ \(|A|\) & The maximum number of neighbor in the attestation tree \\ \(|S|\) & The maximum height of a region tree \\ \(\mathbb{T}\) & The pattern of target device tags \\ \(\mathbb{P}_{i}\) & The position information of \(D_{i}\) \\ \(N\) & A random nonce \\ \(\mathbb{H}_{i}\) & The depth of \(D_{i}\) in the region tree. \\ \(\alpha_{i}\) & The number of good provers in the descendants of \(D_{i}\) \\ \(\beta_{i}\) & The number of bad provers in the descendants of \(D_{i}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Notations. method (Figure 2a) does not change the control flow graph, which is good for attestation schemes checking control flow (e.g., CFLAT [24]), but the tag size is limited to the operand size. The latter method (Figure 2b) may alter the control flow graph, but the tag size is flexible. Before injecting the tag, the binary code of software component is prepared in either way as shown in Figure 2. Injecting extra instruction into binary code may break the absolute-address branches by shifting the jump-target address, thus it may require the sophisticated binary rewriting. The network operator can compile the source code to the form of position independent executable (PIE) to minimize the rewriting. More preferably, if source code is available, the network operator can add the tag instructions with a dummy tag as an inline assembly (e.g., asm) in source code before compiling it. Since the tag instructions are already in the binary code, binary rewriting is simplified to the replacement of the dummy tag with \(\tau_{i}\). **Device tag (B). ** CAMIE generates the device tag from the tagged software components.