Skip to content

Commit 38f8fd0

Browse files
authored
Merge pull request #5 from aidangarske/fix-config
Fix wolfssl default config in readme
2 parents 349df7e + 53170a1 commit 38f8fd0

1 file changed

Lines changed: 42 additions & 10 deletions

File tree

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wolfSPDM
22

3-
Lightweight SPDM 1.2+ requester-only stack implementation using wolfSSL/wolfCrypt
3+
Lightweight SPDM 1.2+ requester-only stack implementation using wolfSSL/wolfCrypt with no dynamic memory allocations
44

55
## Overview
66

@@ -31,14 +31,16 @@ wolfSSL with the required crypto algorithms:
3131
git clone https://github.com/wolfSSL/wolfssl.git
3232
cd wolfssl
3333
./autogen.sh
34-
./configure --enable-wolftpm --enable-all
35-
or
36-
./configure --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf
34+
./configure --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
3735
make
3836
sudo make install
3937
sudo ldconfig
4038
```
4139

40+
The `--enable-sp` flag enables Single Precision math with optimized ECC P-384
41+
support, which is required for SPDM Algorithm Set B on platforms like ARM64.
42+
For a broader feature set, `--enable-all` can be used instead.
43+
4244
## Building
4345

4446
```bash
@@ -85,6 +87,17 @@ WOLFSPDM_CTX* ctx = wolfSPDM_New();
8587
wolfSPDM_Free(ctx); /* frees heap memory */
8688
```
8789

90+
## Build Order
91+
92+
wolfSPDM depends on wolfSSL, and wolfTPM depends on both. When changing
93+
wolfSSL configuration, **all three must be rebuilt in order** because
94+
wolfSPDM's static context size (`WOLFSPDM_CTX_STATIC_SIZE`) depends on
95+
wolfSSL internal struct sizes (`ecc_key`, `wc_Sha384`, `WC_RNG`, etc.):
96+
97+
```
98+
wolfSSL (sudo make install) → wolfSPDM (make) → wolfTPM (make)
99+
```
100+
88101
## Testing with spdm-emu Emulator
89102

90103
```bash
@@ -94,18 +107,27 @@ cd spdm-emu && mkdir build && cd build
94107
cmake -DARCH=x64 -DTOOLCHAIN=GCC -DTARGET=Release -DCRYPTO=mbedtls ..
95108
make copy_sample_key && make
96109

110+
# Build wolfSSL
111+
cd wolfssl
112+
./autogen.sh
113+
./configure --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
114+
make
115+
sudo make install
116+
sudo ldconfig
117+
97118
# Build wolfSPDM
98119
cd wolfSPDM
120+
./autogen.sh
99121
./configure
100122
make
101123

102-
# Build wolfTPM
124+
# Build wolfTPM (point --with-wolfspdm to wolfSPDM source directory)
103125
cd wolfTPM
104-
./configure --enable-spdm --enable-swtpm --with-wolfspdm=path/to/wolfspdm
126+
./autogen.sh
127+
./configure --enable-spdm --enable-swtpm --with-wolfspdm=../wolfSPDM
105128
make
106129

107130
# Run emulator tests (starts/stops emulator automatically)
108-
cd wolfTPM
109131
./examples/spdm/spdm_test.sh --emu
110132
```
111133

@@ -116,14 +138,24 @@ unsigned measurements, challenge authentication, heartbeat, and key update.
116138
## Testing with Nuvoton NPCT75x
117139

118140
```bash
119-
# Build wolfSPDM
141+
# Build wolfSSL
142+
cd wolfssl
143+
./autogen.sh
144+
./configure --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
145+
make
146+
sudo make install
147+
sudo ldconfig
148+
149+
# Build wolfSPDM with Nuvoton support
120150
cd wolfSPDM
151+
./autogen.sh
121152
./configure --enable-nuvoton
122153
make
123154

124-
# Build wolfTPM
155+
# Build wolfTPM (point --with-wolfspdm to wolfSPDM source directory)
125156
cd wolfTPM
126-
./configure --enable-spdm --enable-nuvoton --with-wolfspdm=path/to/wolfspdm
157+
./autogen.sh
158+
./configure --enable-spdm --enable-nuvoton --with-wolfspdm=../wolfSPDM
127159
make
128160

129161
# Run Nuvoton test suite

0 commit comments

Comments
 (0)