Skip to content

Commit 68dcc19

Browse files
committed
feat: linux: Add more information on Secure Storage and PKCS#11
Presently, TI's OP-TEE docs speak only of RPMB Secure Storage mechanism, and not of REE FS. REE FS is supported by-default, so mention it too. Also add a brief on Secure Storage. Signed-off-by: Suhaas Joshi <[email protected]>
1 parent 1e83eb6 commit 68dcc19

File tree

1 file changed

+75
-20
lines changed

1 file changed

+75
-20
lines changed

source/linux/Foundational_Components_OPTEE.rst

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,46 +77,89 @@ of entropy can work around these issues.
7777
7878
.. _secure-storage-with-rpmb:
7979

80-
Secure Storage with RPMB (For HS)
81-
*********************************
80+
OP-TEE Secure Storage
81+
*********************
8282

83-
OP-TEE provides secure storage functionality. TI SoCs with HS configuration have a
84-
KEK embedded in them that is programmed across OP-TEE instances that are distributed
85-
in a derived manner. Each HS device has its own HUK signing key (DKEK) which is different
86-
from other HS devices.
83+
OP-TEE provides secure storage functionality through two mechanisms:
84+
**REE FS** (Rich Execution Environment Filesystem) and **RPMB**
85+
(Replay Protected Memory Block).
8786

88-
For enabling RPMB support along with secure storage, additional flags need to be passed to
89-
the build instructions. The information for the flags can be found here.
90-
https://optee.readthedocs.io/en/latest/architecture/secure_storage.html
87+
TI SDK enables REE FS by-default, and configures OP-TEE to store
88+
encrypted binary blobs created by REE FS in
89+
:file:`/var/lib/tee/`.
9190

92-
There is a hybrid mode in which both the flags i.e `CFG_REE_FS=y` and `CFG_RPMB_FS=y` are enabled.
93-
This mode stores the state of the Secure Storage directory in RPMB partition to check for the
94-
integrity of the data present in it. It is the recommended way.
91+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
9592

96-
E.g. For enabling hybrid mode of RPMB along with REE_FS
93+
.. note::
9794

98-
.. ifconfig:: CONFIG_part_variant in ('J721S2')
95+
Presently, AM62L does not support RPMB. This support will be added
96+
in subsequent releases. It does support REE FS.
9997

100-
.. code-block:: console
98+
The remaining devices support both: REE FS by-default and RPMB if
99+
OP-TEE binaries are re-compiled with required flags.
101100

102-
$ export CFG_CONSOLE_UART=0x8
101+
For learning more about secure storage in OP-TEE, refer:
102+
https://optee.readthedocs.io/en/latest/architecture/secure_storage.html
103103

104-
.. parsed-literal::
104+
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
105+
106+
RPMB works in TI SoCs with HS configuration. These embed a KEK
107+
that programs across OP-TEE instances in a derived manner. Each HS
108+
device has its own HUK signing key (DKEK), which is different from
109+
other HS devices. TI SDK disables RPMB by-default. To enable it,
110+
re-compiling OP-TEE with ``CFG_RPMB_FS=y`` flag.
111+
112+
For learning more about secure storage in OP-TEE, and instructions to
113+
enable RPMB, refer:
114+
https://optee.readthedocs.io/en/latest/architecture/secure_storage.html
115+
116+
There is a hybrid mode in which both the flags i.e `CFG_REE_FS=y` and `CFG_RPMB_FS=y` are enabled.
117+
This mode stores the state of the Secure Storage directory in RPMB partition to check for the
118+
integrity of the data present in it. It is the recommended way.
119+
120+
E.g. For enabling hybrid mode of RPMB along with REE_FS
121+
122+
.. ifconfig:: CONFIG_part_variant in ('J721S2')
123+
124+
.. code-block:: console
125+
126+
$ export CFG_CONSOLE_UART=0x8
127+
128+
.. parsed-literal::
129+
130+
$ make CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_REE_FS=y CFG_RPMB_FS=y
131+
132+
OPTEE-client also needs to be updated to enable the use of real
133+
emmc instead of the virtual emmc that is enabled by default
105134

106-
$ make CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_REE_FS=y CFG_RPMB_FS=y
135+
As an example to show the usage of secure storage, the filesystem
136+
provides a binary :file:`/usr/bin/optee_examples_secure_storage`.
107137

108-
OPTEE-client also needs to be updated to enable the use of real
109-
emmc instead of the virtual emmc that is enabled by default
138+
.. code::
139+
140+
optee_examples_secure_storage
141+
142+
For more details, see optee_examples:
143+
https://github.com/linaro-swg/optee_examples
110144

111145
Getting OP-TEE Client source code
112146
---------------------------------
113147

148+
To get optee_client source code, do:
149+
150+
.. rubric:: Getting OP-TEE Client source code
151+
114152
.. code-block:: console
115153
116154
$ git clone https://github.com/OP-TEE/optee_client
117155
118156
.. rubric:: Building OP-TEE Client with RPMB support
119157

158+
To use emulated RPMB, set RPMB_EMU=1. Otherwise, set RPMB_EMU=0.
159+
160+
For example, the following command builds optee_client to use the real RPMB,
161+
instead of the emulated one.
162+
120163
.. code-block:: console
121164
122165
$ make CROSS_COMPILE="$CROSS_COMPILE_64" PLATFORM=k3 CFG_TEE_SUPP_LOG_LEVEL=2 RPMB_EMU=0 CFG_ARM64_core=y
@@ -146,3 +189,15 @@ Integrate binary output into U-boot
146189
.. note::
147190

148191
tee-pager_v2.bin may be called bl32.bin in other documentation.
192+
193+
|
194+
195+
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
196+
197+
.. rubric:: PKCS#11
198+
199+
PKCS#11 is a cryptographic token interface standard that allows applications
200+
to access cryptographic services through a platform-independent API.
201+
202+
For userland integration details, refer:
203+
https://optee.readthedocs.io/en/latest/building/userland_integration.html

0 commit comments

Comments
 (0)