blob: aa30eb44dc678ddaed7df2718d4bce0238e20f36 [file] [log] [blame]
Satish Kumar427923c2021-10-05 07:21:53 +01001##################################
2Authenticated Debug Access Control
3##################################
4
5************
6Introduction
7************
8
9Introducing security in debug is about making sure that only authorized people
10have access to select parts of firmware and hardware. The Trusted Firmware-M
11software implementation contained in this project is designed to be a
12reference implementation.
13
14ADAC aims at making sure that debug capabilities do not become attack vectors.
15Debug security cannot be an afterthought when designing an SoC and the kind of
16debug solution needed is driven by the threat models for the device use case.
17
18The ADAC architecture is designed to be flexible to meet varying vendor needs,
19adaptable to work with many different hardware and software components, and
20scalable from small embedded or IoT systems to complex server environments.
21At the same time, it strives to be simple and resilient against attack.
22
23`Authenticated Debug Access Control`_ (ADAC).
24
25**********
26Components
27**********
28
29The repository contains software componenets, of the ADAC protocol, towards
30the target side. The following components are included in this repo:
31
32* Secure Debug Authenticator (SDA)
33* ADAC protocol core
34* Supported target platforms
35 * trusted-firmware-m: dipdha platform
36* Transport layer
37 * `SDC-600 Secure Debug Channel`_
38
39********************
40Directory structures
41********************
42
43- psa-adac
44 - core
45 - sda
46- target
47 - target name
48 - files implementing platform interface of psa-adac/core and psa-adac/sda
49 - psa_adac_platform.h: place where platform specific incoming and outgoing calls can be declared
50- transport
51 - files implementing transport interface of psa-adac/core and psa-adac/sda
52 - various implementations of transport layer for communication with the host can be hosted here
53- template_hal_files
54 - template files for hal api definitions
55
56
57************************
58Integration instructions
59************************
60
61Build options
62=============
63
64Build from the adac repository
65----------------------------------
66
67Configure:
68
69.. code-block::
70
71 cmake -B <build_dir> -S . -DCMAKE_BUILD_TYPE=Debug -DPSA_ADAC_TARGET=<target_name> -DPSA_ADAC_MBEDTLS_INCLUDE=<path to mbedtls include>
72
73Build and install:
74
75.. code-block::
76
77 cmake --build <build_dir> -- install
78
79Static library will be installation at:
80
81.. code-block::
82
83 <build_dir>/install/lib/lib_<target_name>.a
84
85Build as cmake target
86---------------------
87
88.. code-block::
89
90 add_subdirectory(${PLATFORM_PSA_ADAC_SOURCE_PATH} ${PLATFORM_PSA_ADAC_BUILD_PATH})
91 target_link_libraries(<target_name>-psa-adac
92 PRIVATE
93 <caller of adac entry point>
94 )
95
96Configuration variables
97=======================
98
99PSA_ADAC_TOOLCHAIN
100------------------
101When OFF, the build will not include toolchain files from the
102adac repository. User can decide to choose the toolchain configuration from the
103adac repository or can also provide its own toolchain configuration files.
104
105PSA_ADAC_TARGET
106---------------
107Name of the target. Support for the target should exist inside
108the ./target/ directory.
109
110PSA_ADAC_MBEDTLS_INCLUDE
111------------------------
112Path to mbedtls include directory (`MBEDTLS Repository`_)
113
114.. code-block::
115
116 <mbedtls>/include
117
118
119HAL integration
120===============
121
122psa-adac/sda and psa-adac/core depends on the following inteface:
123
124platform.h
125----------
126Defines the interface to the platform. A template file for the inteface
127can be found inside template directory.
128
129psa_adac_crypto_api.h
130---------------------
131Defines the interface to the cryptographic supported required
132by the adac protocol implementation.
133
134A target should provide the implementation of these HAL APIs. An example for platform.h
135api implementation can be find inside corstone1000 target directory. And example for
136crypto api implementaion can be find inside `Trusted-Firmware-M`_ repository. Further
137such integration of crypto apis, based on software (ex: mbedtls) as well as based on
138hardware accelerattion, can also be hosted as part of this repository.
139
140msg_interface.h
141---------------
142Defines the interface to the transport layer. The transport layer supports the communication
143between host and the target. The file, msg_interface.h, only contains the interface used
144by the target, i.e. psa-adac/core and psa-adac/sda. Various implementation of transport
145layer can be hosted inside ./trasport/ directory. For ex: corstone1000 uses transport based
146on SDC600 COMPORT.
147
148Integration to the secure debug workflow
149========================================
150
151The entry function definition to start the secure debug flow and any other dependency,
152a target is free to declare such apis inside the file: psa_adac_platform.h
153
154Corstone1000 psa_adac_platform.h is one such example.
155
156
157Target examples
158===============
159
160Build instructions for Corstone1000 platform inside trusted-firmware-m
161----------------------------------------------------------------------
162
163Configure:
164
165.. code-block::
166
167 cmake -B <build_dir> -S . -DCMAKE_BUILD_TYPE=Debug -DPSA_ADAC_TARGET=trusted-firmware-m -DTFM_PLATFORM=arm/corstone1000 -DPSA_ADAC_MBEDTLS_INCLUDE=<mbedtls>/include
168
169Build and install:
170
171.. code-block::
172
173 cmake --build <build_dir> -- install
174
175Build library:
176
177.. code-block::
178
179 build/install/lib/libtrusted-firmware-m-psa-adac.a
180
181The library generated contains secure debug support for Corstone1000 platform
182which can be linked to Corstone1000's trusted-firmware-m build.
183
184.. _Authenticated Debug Access Control: https://developer.arm.com/documentation/den0101/latest
185.. _SDC-600 Secure Debug Channel: https://www.arm.com/products/silicon-ip-system/coresight-debug-trace/sdc-600
186.. _MBEDTLS Repository: https://github.com/ARMmbed/mbedtls.git
187.. _Trusted-Firmware-M : https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/
188
189*Copyright (c) 2021, Arm Limited. All rights reserved.*