|
| 1 | +--- |
| 2 | +# User change |
| 3 | +title: "Run the Parsec demo" |
| 4 | + |
| 5 | +weight: 4 |
| 6 | + |
| 7 | +layout: "learningpathall" |
| 8 | +--- |
| 9 | + |
| 10 | + |
| 11 | +There are a number of example applications which demonstrate the software stack running the reference hardware system modeled by a Fixed Virtual Platform (FVP). The Parsec demo is explained below. |
| 12 | + |
| 13 | +The [Parsec-enabled TLS demo](https://arm-auto-solutions.docs.arm.com/en/v1.1/design/applications/parsec_enabled_tls.html) illustrates a HTTPS session. A simple web page is transferred using a Transport Layer Security (TLS) connection. |
| 14 | + |
| 15 | +Parsec, or Platform AbstRaction for SECurity, is an open-source initiative that provides a common API to hardware security and cryptographic services. |
| 16 | + |
| 17 | +This enables applications to interact with the secure hardware of a device without needing to know the specific details of the hardware itself. The Parsec abstraction layer makes it easier to develop secure applications that can run on different devices and platforms. |
| 18 | + |
| 19 | +Follow the instructions below to run the Parsec demo. |
| 20 | + |
| 21 | +## Run the Parsec SSL demo |
| 22 | + |
| 23 | +From the command line, start a Tmux session. |
| 24 | + |
| 25 | +```console |
| 26 | +tmux new-session -s arm-auto-solutions |
| 27 | +``` |
| 28 | + |
| 29 | +Tmux makes it possible to connect to the output from multiple hardware subsystems in the reference design. |
| 30 | + |
| 31 | +To run the software stack on the FVP run: |
| 32 | + |
| 33 | +```console |
| 34 | +cd ~/arm-auto-solutions |
| 35 | +kas shell -c "../layers/meta-arm/scripts/runfvp -t tmux --verbose" |
| 36 | +``` |
| 37 | + |
| 38 | +This will run the entire software stack on a model of the hardware. |
| 39 | + |
| 40 | +At anytime you can use Tmux to interact with the different subsystems using `Ctrl-b` then `w` to bring up a list of windows. Use the arrow keys to select a window. |
| 41 | + |
| 42 | +After the software boots, you reach a Linux login prompt: `fvp-rd-kronos login:` |
| 43 | + |
| 44 | +Enter `root` for the login name, no password is required. |
| 45 | + |
| 46 | +Make sure the initialization process is complete by running: |
| 47 | + |
| 48 | +```console |
| 49 | +systemctl is-system-running --wait |
| 50 | +``` |
| 51 | + |
| 52 | +If the output is `running`, continue to the next step. If not, re-run the command until the output is `running`. |
| 53 | + |
| 54 | +On the primary compute run the SSL server: |
| 55 | + |
| 56 | +```console |
| 57 | +ssl_server & |
| 58 | +``` |
| 59 | + |
| 60 | +The output from the server is printed: |
| 61 | + |
| 62 | +```output |
| 63 | + . Seeding the random number generator... ok |
| 64 | + . Loading the server cert. and key... ok |
| 65 | + . Bind on https://localhost:4433/ ... ok |
| 66 | + . Setting up the SSL data.... ok |
| 67 | + . Waiting for a remote connection ... |
| 68 | +``` |
| 69 | + |
| 70 | +The SSL client runs in a standard Ubuntu 22.04 container and requests a web page from the SSL server. The client has been modified to use Parsec, making it more portable and abstracting the details of the hardware security services. |
| 71 | + |
| 72 | +Run the Parsec enabled SSL client: |
| 73 | + |
| 74 | +```console |
| 75 | +docker run --rm -v /run/parsec/parsec.sock:/run/parsec/parsec.sock -v /usr/bin/ssl_client1:/usr/bin/ssl_client1 --network host docker.io/library/ubuntu:22.04 ssl_client1 |
| 76 | +``` |
| 77 | + |
| 78 | +The container will be downloaded and run. The SSL client application named `ssl_client1` runs. |
| 79 | + |
| 80 | +The client application requests a webpage from the SSL server and the output is: |
| 81 | + |
| 82 | +```output |
| 83 | + . Seeding the random number generator... ok |
| 84 | + . Loading the CA root certificate ... ok (0 skipped) |
| 85 | + . Connecting to tcp/localhost/4433... ok |
| 86 | + . Performing the SSL/TLS handshake... ok |
| 87 | + . Setting up the SSL/TLS structure... ok |
| 88 | + . Performing the SSL/TLS handshake... ok |
| 89 | + < Read from client: 18 bytes read |
| 90 | +
|
| 91 | +GET / HTTP/1.0 |
| 92 | +
|
| 93 | + > Write to client: ok |
| 94 | + . Verifying peer X.509 certificate... ok |
| 95 | + > Write to server: 156 bytes written |
| 96 | +
|
| 97 | +HTTP/1.0 200 OK |
| 98 | +Content-Type: text/html |
| 99 | +
|
| 100 | +<h2>Mbed TLS Test Server</h2> |
| 101 | +<p>Successful connection using: TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256</p> |
| 102 | +
|
| 103 | + . Closing the connection... ok |
| 104 | + . Waiting for a remote connection ... 18 bytes written |
| 105 | +
|
| 106 | +GET / HTTP/1.0 |
| 107 | +
|
| 108 | + < Read from server: 156 bytes read |
| 109 | +
|
| 110 | +HTTP/1.0 200 OK |
| 111 | +Content-Type: text/html |
| 112 | +
|
| 113 | +<h2>Mbed TLS Test Server</h2> |
| 114 | +<p>Successful connection using: TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256</p> |
| 115 | +``` |
| 116 | + |
| 117 | +## Shutdown and clean up |
| 118 | + |
| 119 | +You can shut down the simulated system: |
| 120 | + |
| 121 | +```console |
| 122 | +shutdown now |
| 123 | +``` |
| 124 | + |
| 125 | +You will return to the command line. |
| 126 | + |
| 127 | +Type `exit` to leave the Tmux session and `exit` again to leave the Multipass virtual machine. |
| 128 | + |
| 129 | +To delete the Multipass VM run the commands: |
| 130 | + |
| 131 | +```console |
| 132 | +multipass stop u20-32 |
| 133 | +multipass delete u20-32 |
| 134 | +multipass purge |
| 135 | +``` |
| 136 | + |
| 137 | +You have run the Parsec example from the Arm Automotive Solutions Software Reference Stack. |
| 138 | + |
| 139 | +There are many other example applications you can run, refer to the Further Reading section. |
0 commit comments