Valerio Setti | 4f4ade9 | 2024-05-03 17:28:04 +0200 | [diff] [blame] | 1 | # psasim |
| 2 | |
| 3 | This tool simulates a PSA Firmware Framework implementation. |
| 4 | It allows you to develop secure partitions and their clients on a desktop computer. |
| 5 | It should be able to run on all systems that support POSIX and System V IPC: |
| 6 | e.g. macOS, Linux, FreeBSD, and perhaps Windows 10 WSL2. |
| 7 | |
| 8 | Please note that the code in this directory is maintained by the Mbed TLS / PSA Crypto project solely for the purpose of testing the use of Mbed TLS with client/service separation. We do not recommend using this code for any other purpose. In particular: |
| 9 | |
| 10 | * This simulator is not intended to pass or demonstrate compliance. |
| 11 | * This code is only intended for simulation and does not have any security goals. It does not isolate services from clients. |
| 12 | |
| 13 | ## Building |
| 14 | |
| 15 | To build and run the test program make sure you have `make`, `python` and a |
| 16 | C compiler installed and then enter the following commands: |
| 17 | |
| 18 | ```sh |
| 19 | make run |
| 20 | ``` |
| 21 | |
| 22 | Optionally the `DEBUG=1` command line option can be enabled to increase verbosity: |
| 23 | |
| 24 | ```sh |
| 25 | make DEBUG=1 run |
| 26 | ``` |
| 27 | |
| 28 | Once done with the test, it is possible to clean all the generated files with: |
| 29 | |
| 30 | ```sh |
| 31 | make clean |
| 32 | ``` |
| 33 | |
| 34 | ## Features |
| 35 | |
| 36 | The implemented API is intended to be compliant with PSA-FF 1.0.0 with the exception of a couple of things that are a work in progress: |
| 37 | |
| 38 | * `psa_notify` support |
| 39 | * "strict" policy in manifest |
| 40 | |
| 41 | The only supported "interrupts" are POSIX signals, which act |
| 42 | as a "virtual interrupt". |
| 43 | |
| 44 | The standard PSA RoT APIs are not included (e.g. cryptography, attestation, lifecycle etc). |
| 45 | |
| 46 | ## Design |
| 47 | |
| 48 | The code is designed to be readable rather than fast or secure. |
| 49 | In this implementation only one message is delivered to a |
| 50 | RoT service at a time. |
| 51 | The code is not thread-safe. |
| 52 | |
| 53 | ## Unsupported features |
| 54 | |
| 55 | Because this is a simulator there are a few things that |
| 56 | can't be reasonably emulated: |
| 57 | |
| 58 | * Manifest MMIO regions are unsupported |
| 59 | * Manifest priority field is ignored |
| 60 | * Partition IDs are in fact POSIX `pid_t`, which are only assigned at runtime, |
| 61 | making it infeasible to populate pid.h with correct values. |