Skip to content

Commit b1d05ac

Browse files
authored
Merge pull request #363 from cconlon/se050_tls_example
SE050: add demo SSL/TLS client applications
2 parents a363898 + f67f403 commit b1d05ac

18 files changed

Lines changed: 1179 additions & 22 deletions

File tree

SE050/README.md

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,56 @@ running these examples.
1616
## Installing Example Applications
1717

1818
These instructions assume that the SE050 middleware has already been installed
19-
in Raspbian and is located at `/home/pi/se_mw/simw-top`.
19+
in Raspbian and is located at `/home/pi/se_mw/simw-top`. Also that wolfSSL has
20+
been built and installed. See instructions in the wolfSSL repository at
21+
`wolfcrypt/src/port/nxp/README_SE050.md`.
2022

21-
Before building these demo, the "wolfssl" folder which contains these demos
22-
should be copied into the SE05x middleware source tree at:
23+
Example SE050 Pi installation steps:
2324

25+
```sh
26+
$ cd se_mw/simw-top
27+
$ mkdir build && cd build
28+
$ ccmake .
29+
# Make sure the following are set:
30+
# `Host OS` to `Raspbian`
31+
# `Host Crypto` to `None` (see HostCrypto section below)
32+
# `SMCOM` to `T1oI2C`
33+
$ c # to configure
34+
$ g # to generate
35+
$ q
36+
$ cmake --build .
37+
$ sudo make install
2438
```
25-
/home/pi/se_mw/simw-top/demos/wolfssl
39+
40+
Example wolfSSL installation:
41+
2642
```
43+
./configure --with-se050=/home/pi/se_mw/simw-top/ --enable-keygen --enable-cryptocb \
44+
--disable-examples --disable-crypttests
45+
make
46+
sudo make install
47+
```
48+
49+
Before building these demos, the "wolfssl" folder which contains these demos
50+
should be copied into the SE05x middleware source tree at: `~/se_mw/simw-top/demos/wolfssl`.
51+
Example: `cp -r wolfssl ~/se_mw/simw-top/demos/`
2752

2853
This will mean the wolfSSL demo applications will be at:
2954

3055
```
31-
/home/pi/se_mw/simw-top/demos/wolfssl/wolfcrypt_benchmark
32-
/home/pi/se_mw/simw-top/demos/wolfssl/wolfcrypt_generate_csr
33-
/home/pi/se_mw/simw-top/demos/wolfssl/wolfcrypt_key_cert_insert
34-
/home/pi/se_mw/simw-top/demos/wolfssl/wolfcrypt_test
56+
~/se_mw/simw-top/demos/wolfssl/wolfcrypt_benchmark
57+
~/se_mw/simw-top/demos/wolfssl/wolfcrypt_generate_csr
58+
~/se_mw/simw-top/demos/wolfssl/wolfcrypt_key_cert_insert
59+
~/se_mw/simw-top/demos/wolfssl/wolfcrypt_test
60+
~/se_mw/simw-top/demos/wolfssl/wolfssl_client
61+
~/se_mw/simw-top/demos/wolfssl/wolfssl_client_cert_key
3562
```
3663

3764
The 'wolfssl' demo directory needs to be tied into the CMake build system. Open
3865
the following file:
3966

4067
```
41-
/home/pi/se_mw/simw-top/demos/CMakeLists.txt
68+
~/se_mw/simw-top/demos/CMakeLists.txt
4269
```
4370

4471
Add the following at the bottom of this file:
@@ -50,9 +77,9 @@ ADD_SUBDIRECTORY(wolfssl)
5077
If the SE05x middleware has not yet been set up for compilation:
5178

5279
```
53-
$ cd /home/pi/se_mw/simw-top/scripts
54-
$ ./create_cmake_projects.py rpi
55-
$ cd /home/pi/se_mw/simw-top_build/raspbian_native_se050_t1oi2c
80+
$ cd ~/se_mw/simw-top/scripts
81+
$ python ./create_cmake_projects.py rpi
82+
$ cd ~/se_mw/simw-top_build/raspbian_native_se050_t1oi2c
5683
$ ccmake .
5784
< adjust options to match SE050 dev kit >
5885
< 'c', to configure >
@@ -68,6 +95,13 @@ included here need benchmark.c, benchmark.h, test.c, and test.h copied over
6895
from a valid wolfSSL source tree. See notes in those example README.md files
6996
for more information.
7097

98+
```
99+
cp ~/wolfssl/wolfcrypt/benchmark/benchmark.c ./wolfssl/wolfcrypt_benchmark/
100+
cp ~/wolfssl/wolfcrypt/benchmark/benchmark.h ./wolfssl/wolfcrypt_benchmark/
101+
cp ~/wolfssl/wolfcrypt/test/test.c ./wolfssl/wolfcrypt_test/
102+
cp ~/wolfssl/wolfcrypt/test/test.h ./wolfssl/wolfcrypt_test/
103+
```
104+
71105
## NXP SE050 EdgeLock Configuration
72106

73107
wolfSSL most recently tested these examples on a Raspberry Pi with NXP
@@ -105,6 +139,22 @@ generated and stored in the SE050. This examples requires that wolfSSL be
105139
compiled with `--enable-certgen --enable-certreq`. For details, see
106140
[README.md](./wolfssl/wolfcrypt_generate_csr/README.md).
107141

142+
### wolfSSL SSL/TLS Client Example
143+
144+
This example demonstrates a simple SSL/TLS client, using hardware-based
145+
cryptography supported inside the SE050. It loads and uses a certificate
146+
and private key from C arrays/buffers. For a more advanced demo which uses
147+
the private key directly from the SE050, see the following example. For details,
148+
see [README.md](./wolfssl/wolfssl_client/README.md).
149+
150+
### wolfSSL SSL/TLS Client Example with Cert and Private Key in SE050
151+
152+
This example demonstrates a simple SSL/TLS client, using hardware-based
153+
cryptography supported inside the SE050. It loads and uses a certificate
154+
and private key from C arrays/buffers into the SE050, then does all private key
155+
operations inside the SE050 for the TLS private key, based on a key ID.
156+
For details, see [README.md](./wolfssl/wolfssl_client_cert_key/README.md).
157+
108158
## Support
109159

110160
For support questions and issues, please email wolfSSL at support@wolfssl.com.

SE050/wolfssl/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ ADD_SUBDIRECTORY(wolfcrypt_benchmark)
22
ADD_SUBDIRECTORY(wolfcrypt_test)
33
ADD_SUBDIRECTORY(wolfcrypt_key_cert_insert)
44
ADD_SUBDIRECTORY(wolfcrypt_generate_csr)
5+
ADD_SUBDIRECTORY(wolfssl_client)
6+
ADD_SUBDIRECTORY(wolfssl_client_cert_key)

SE050/wolfssl/wolfcrypt_benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ADD_EXECUTABLE(
1212

1313
TARGET_COMPILE_DEFINITIONS(
1414
${PROJECT_NAME}
15-
PRIVATE SIMW_DEMO_ENABLE__DEMO_WOLFCRYPTBENCHMARK NO_MAIN_DRIVER BENCH_EMBEDDED USE_CERT_BUFFERS_2048 USE_CERT_BUFFERS_256
15+
PRIVATE SIMW_DEMO_ENABLE__DEMO_WOLFCRYPTBENCHMARK NO_MAIN_DRIVER BENCH_EMBEDDED USE_CERT_BUFFERS_2048 USE_CERT_BUFFERS_256 USE_FLAT_BENCHMARK_H
1616
)
1717

1818
TARGET_INCLUDE_DIRECTORIES(

SE050/wolfssl/wolfcrypt_benchmark/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* benchmark.c
22
*
3-
* Copyright (C) 2006-2022 wolfSSL Inc.
3+
* Copyright (C) 2006-2023 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*

SE050/wolfssl/wolfcrypt_benchmark/benchmark.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* benchmark.h
22
*
3-
* Copyright (C) 2006-2022 wolfSSL Inc.
3+
* Copyright (C) 2006-2023 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*

SE050/wolfssl/wolfcrypt_benchmark/wolfcrypt_benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* wolfcrypt_benchmark.c
22
*
3-
* Copyright (C) 2006-2022 wolfSSL Inc.
3+
* Copyright (C) 2006-2023 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*

SE050/wolfssl/wolfcrypt_generate_csr/wolfcrypt_generate_csr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* wolfcrypt_generate_csr.c
22
*
3-
* Copyright (C) 2006-2022 wolfSSL Inc.
3+
* Copyright (C) 2006-2023 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*

SE050/wolfssl/wolfcrypt_key_cert_insert/wolfcrypt_key_cert_insert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* wolfcrypt_key_cert_insert.c
22
*
3-
* Copyright (C) 2006-2022 wolfSSL Inc.
3+
* Copyright (C) 2006-2023 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*

SE050/wolfssl/wolfcrypt_test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ADD_EXECUTABLE(
1212

1313
TARGET_COMPILE_DEFINITIONS(
1414
${PROJECT_NAME}
15-
PRIVATE SIMW_DEMO_ENABLE__DEMO_WOLFCRYPTTEST NO_MAIN_DRIVER BENCH_EMBEDDED USE_CERT_BUFFERS_2048 USE_CERT_BUFFERS_256
15+
PRIVATE SIMW_DEMO_ENABLE__DEMO_WOLFCRYPTTEST NO_MAIN_DRIVER BENCH_EMBEDDED USE_CERT_BUFFERS_2048 USE_CERT_BUFFERS_256 USE_FLAT_TEST_H
1616
)
1717

1818
TARGET_INCLUDE_DIRECTORIES(

SE050/wolfssl/wolfcrypt_test/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* test.c
22
*
3-
* Copyright (C) 2006-2022 wolfSSL Inc.
3+
* Copyright (C) 2006-2023 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*

0 commit comments

Comments
 (0)