Add warning on CKM TrustZone space leak 25/239925/4
authorMateusz Cegielka <m.cegielka@samsung.com>
Thu, 30 Jul 2020 12:01:32 +0000 (14:01 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 2 Oct 2020 10:51:02 +0000 (10:51 +0000)
commit40c2de92974c65d56fd7408d47a9cd8b235b36d4
tree2742b01960c951fe74a9bbb71e0dfea136e199de
parent1403c0200b3f46f2b8c992580cfeb6308b7e9175
Add warning on CKM TrustZone space leak

Current implementation of ckmc_remove_user_data is not able to remove
individual objects from TrustZone, because their names are stored in a
possibly encrypted database. This rarely happens in actual code, but
tests extensively use this function to clean up objects they create.
Because of this, running CKM tests multiple times with TrustZone enabled
may exceed TrustZone limits.

Fixing the behaviour is a larger task, and making all tests clean up
individual objects is too verbose, complex and error-prone for a bug
workaround that only affects developers (this approach has already been
tried once, and it was removed years ago).

I have added a heuristic check that tries to create a single-byte data
object in TrustZone. If that fails, it displays a warning message
explaining the problem and suggesting to reset TrustZone and key-manager
state, as well as instructions on how to do use using Tizen emulator and
tef-simulator.

Change-Id: Id99c22c33f3e5adfbeff5c7b1b58d2d995ed4cca
src/CMakeLists.txt
src/ckm-integration/main.cpp
src/ckm/CMakeLists.txt
src/ckm/privileged/main.cpp
src/ckm/unprivileged/main.cpp
src/common/CMakeLists.txt
src/common/ckm_helpers.cpp [new file with mode: 0644]
src/common/ckm_helpers.h [new file with mode: 0644]