Skip to content

Commit 082c0f9

Browse files
committed
Fixes for CI (now that fwtpm is enabled by default on intel/armv8)
1 parent f2c17d9 commit 082c0f9

File tree

8 files changed

+47
-52
lines changed

8 files changed

+47
-52
lines changed

.github/workflows/coverity-scan-fixes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: ./autogen.sh
2525
- name: wolfssl configure
2626
working-directory: ./wolfssl
27-
run: ./configure --enable-wolftpm
27+
run: ./configure --enable-wolftpm --enable-pkcallbacks --enable-keygen CFLAGS="-DWC_RSA_NO_PADDING"
2828
- name: wolfssl make
2929
working-directory: ./wolfssl
3030
run: make

.github/workflows/make-test-swtpm.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# wolfssl_config: --enable-wolftpm --enable-pkcallbacks
1717
# wolfssl_cflags: ""
1818
# wolfssl_ref: master
19-
# wolftpm_config: --enable-swtpm
19+
# wolftpm_config: --enable-swtpm --disable-fwtpm
2020
# wolftpm_cflags: ""
2121
# test_command: "true"
2222
# needs_swtpm: true
@@ -41,101 +41,101 @@ jobs:
4141

4242
# No wolfCrypt
4343
- name: no-wolfcrypt
44-
wolftpm_config: --enable-swtpm --disable-wolfcrypt
44+
wolftpm_config: --enable-swtpm --disable-wolfcrypt --disable-fwtpm
4545
test_command: "make check && WOLFSSL_PATH=./wolfssl WOLFCRYPT_ENABLE=0 ./examples/run_examples.sh"
4646

4747
# No wrapper
4848
- name: no-wrapper
49-
wolftpm_config: --enable-swtpm --disable-wrapper
49+
wolftpm_config: --enable-swtpm --disable-wrapper --disable-fwtpm
5050
test_command: "./examples/native/native_test"
5151

5252
# Small stack
5353
- name: smallstack
54-
wolftpm_config: --enable-swtpm --enable-smallstack
54+
wolftpm_config: --enable-swtpm --enable-smallstack --disable-fwtpm
5555
test_command: "make check && WOLFSSL_PATH=./wolfssl ./examples/run_examples.sh"
5656

5757
# Infineon SLB9670
5858
- name: slb9670
59-
wolftpm_config: --enable-infineon=slb9670
59+
wolftpm_config: --enable-infineon=slb9670 --disable-fwtpm
6060
# Infineon SLB9672
6161
- name: slb9672
62-
wolftpm_config: --enable-infineon=slb9672
62+
wolftpm_config: --enable-infineon=slb9672 --disable-fwtpm
6363
# Infineon SLB9673
6464
- name: slb9673
65-
wolftpm_config: --enable-infineon=slb9673 --enable-i2c
65+
wolftpm_config: --enable-infineon=slb9673 --enable-i2c --disable-fwtpm
6666
# Cert sign callback (wc_SignCert_cb)
6767
- name: certsigncb
6868
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-certsigncb
69-
wolftpm_config: --enable-swtpm --enable-certgen
69+
wolftpm_config: --enable-swtpm --enable-certgen --disable-fwtpm
7070
test_command: "make check && WOLFSSL_PATH=./wolfssl ./examples/run_examples.sh && ./examples/csr/csr -signcb && ./examples/csr/csr -signcb -cert"
7171

7272
# STMicro ST33KTPM2
7373
- name: st33ktpm2
74-
wolftpm_config: --enable-st33
74+
wolftpm_config: --enable-st33 --disable-fwtpm
7575
# STMicro ST33KTPM2
7676
- name: st33ktpm2 firmware
77-
wolftpm_config: --enable-st33 --enable-firmware
77+
wolftpm_config: --enable-st33 --enable-firmware --disable-fwtpm
7878
# SPDM + Nuvoton (compile-only, no hardware in CI)
7979
- name: spdm-nuvoton
8080
wolfssl_config: --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
81-
wolftpm_config: --enable-spdm --enable-nuvoton
81+
wolftpm_config: --enable-spdm --enable-nuvoton --disable-fwtpm
8282
needs_swtpm: false
8383
# SPDM small stack (heap-allocated SPDM context)
8484
- name: spdm-smallstack
8585
wolfssl_config: --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
86-
wolftpm_config: --enable-spdm --enable-nuvoton --enable-smallstack
86+
wolftpm_config: --enable-spdm --enable-nuvoton --enable-smallstack --disable-fwtpm
8787
needs_swtpm: false
8888
# SPDM debug
8989
- name: spdm-debug
9090
wolfssl_config: --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
91-
wolftpm_config: --enable-spdm --enable-nuvoton --enable-debug
91+
wolftpm_config: --enable-spdm --enable-nuvoton --enable-debug --disable-fwtpm
9292
needs_swtpm: false
9393
# SPDM + Nations (compile-only, no hardware in CI)
9494
- name: spdm-nations
9595
wolfssl_config: --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
96-
wolftpm_config: --enable-spdm --enable-nations
96+
wolftpm_config: --enable-spdm --enable-nations --disable-fwtpm
9797
needs_swtpm: false
9898
# SPDM + Nations debug
9999
- name: spdm-nations-debug
100100
wolfssl_config: --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
101-
wolftpm_config: --enable-spdm --enable-nations --enable-debug
101+
wolftpm_config: --enable-spdm --enable-nations --enable-debug --disable-fwtpm
102102
needs_swtpm: false
103103
# SPDM + Nations small stack (heap-allocated SPDM context)
104104
- name: spdm-nations-smallstack
105105
wolfssl_config: --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
106-
wolftpm_config: --enable-spdm --enable-nations --enable-smallstack
106+
wolftpm_config: --enable-spdm --enable-nations --enable-smallstack --disable-fwtpm
107107
needs_swtpm: false
108108
# Microchip
109109
- name: microchip
110-
wolftpm_config: --enable-microchip
110+
wolftpm_config: --enable-microchip --disable-fwtpm
111111
# Nuvoton
112112
- name: nuvoton
113-
wolftpm_config: --enable-nuvoton
113+
wolftpm_config: --enable-nuvoton --disable-fwtpm
114114

115115
# TIS lock
116116
- name: tislock
117-
wolftpm_config: --enable-tislock
117+
wolftpm_config: --enable-tislock --disable-fwtpm
118118
needs_swtpm: false
119119

120120
# Debug
121121
- name: debug
122-
wolftpm_config: --enable-debug
122+
wolftpm_config: --enable-debug --disable-fwtpm
123123
needs_swtpm: false
124124

125125
# Debug verbose
126126
- name: debug-verbose
127-
wolftpm_config: --enable-debug=verbose
127+
wolftpm_config: --enable-debug=verbose --disable-fwtpm
128128
needs_swtpm: false
129129

130130
# Debug IO
131131
- name: debug-io
132-
wolftpm_config: --enable-debug=io
132+
wolftpm_config: --enable-debug=io --disable-fwtpm
133133
wolftpm_cflags: "-DWOLFTPM_DEBUG_TIMEOUT"
134134
needs_swtpm: false
135135

136136
# AdvIO
137137
- name: advio
138-
wolftpm_config: --enable-advio
138+
wolftpm_config: --enable-advio --disable-fwtpm
139139
needs_swtpm: false
140140

141141
# Autodetect (default configure, /dev/tpm0 + SPI dual support)
@@ -155,7 +155,7 @@ jobs:
155155

156156
# No provisioning
157157
- name: no-provisioning
158-
wolftpm_config: --disable-provisioning
158+
wolftpm_config: --disable-provisioning --disable-fwtpm
159159
needs_swtpm: false
160160

161161
# Symmetric encryption
@@ -286,7 +286,7 @@ jobs:
286286
- name: Build wolfTPM
287287
run: |
288288
./autogen.sh
289-
WOLFTPM_CONFIG="${{ matrix.wolftpm_config || '--enable-swtpm' }}"
289+
WOLFTPM_CONFIG="${{ matrix.wolftpm_config || '--enable-swtpm --disable-fwtpm' }}"
290290
WOLFTPM_CFLAGS="${{ matrix.wolftpm_cflags || '' }}"
291291
WOLFTPM_CC="${{ matrix.wolftpm_cc || '' }}"
292292
# Add TPM port to configure if SWTPM is needed

.github/workflows/multi-compiler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
CXX: ${{ matrix.cxx }}
8989
run: |
9090
./autogen.sh
91-
./configure CFLAGS="-Wall -Wextra -Wpedantic"
91+
./configure --disable-fwtpm CFLAGS="-Wall -Wextra -Wpedantic"
9292
make -j$(nproc)
9393
9494
- name: Make dist

.github/workflows/sanitizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
- name: Build wolfTPM with ${{ matrix.name }}
9595
run: |
9696
./autogen.sh
97-
./configure --enable-swtpm \
97+
./configure --enable-swtpm --disable-fwtpm \
9898
CFLAGS="${{ matrix.cflags }}" LDFLAGS="${{ matrix.ldflags }}"
9999
make -j$(nproc)
100100

.github/workflows/seal-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Build wolfTPM
5757
run: |
5858
./autogen.sh
59-
./configure --enable-swtpm --enable-debug
59+
./configure --enable-swtpm --enable-debug --disable-fwtpm
6060
make -j
6161
6262
- name: Run seal tests

src/tpm2.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6743,19 +6743,7 @@ int TPM2_ParsePublic(TPM2B_PUBLIC* pub, byte* buf, word32 size, int* sizeUsed)
67436743

67446744
#ifdef DEBUG_WOLFTPM
67456745

6746-
void TPM2_PrintAuth(const TPMS_AUTH_COMMAND* authCmd)
6747-
{
6748-
if (authCmd == NULL)
6749-
return;
6750-
6751-
printf("authCmd:\n");
6752-
printf("sessionHandle=0x%08X\n", (unsigned int)authCmd->sessionHandle);
6753-
printf("nonceSize=%u nonceBuffer:\n", authCmd->nonce.size);
6754-
TPM2_PrintBin(authCmd->nonce.buffer, authCmd->nonce.size);
6755-
printf("sessionAttributes=0x%02X\n", authCmd->sessionAttributes);
6756-
printf("hmacSize=%u hmacBuffer:\n", authCmd->hmac.size);
6757-
TPM2_PrintBin(authCmd->hmac.buffer, authCmd->hmac.size);
6758-
}
6746+
/* TPM2_PrintAuth moved to tpm2_util.c (shared with fwtpm_server) */
67596747

67606748
void TPM2_PrintPublicArea(const TPM2B_PUBLIC* pub)
67616749
{

src/tpm2_util.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,18 @@ void TPM2_PrintBin(const byte* buffer, word32 length)
151151
length -= sz;
152152
}
153153
}
154+
155+
void TPM2_PrintAuth(const TPMS_AUTH_COMMAND* authCmd)
156+
{
157+
if (authCmd == NULL)
158+
return;
159+
160+
printf("authCmd:\n");
161+
printf("sessionHandle=0x%08X\n", (unsigned int)authCmd->sessionHandle);
162+
printf("nonceSize=%u nonceBuffer:\n", authCmd->nonce.size);
163+
TPM2_PrintBin(authCmd->nonce.buffer, authCmd->nonce.size);
164+
printf("sessionAttributes=0x%02X\n", authCmd->sessionAttributes);
165+
printf("hmacSize=%u hmacBuffer:\n", authCmd->hmac.size);
166+
TPM2_PrintBin(authCmd->hmac.buffer, authCmd->hmac.size);
167+
}
154168
#endif /* DEBUG_WOLFTPM */

tests/include.am

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
# All paths should be given relative to the root
44

55
# unit.test requires a running TPM server. When fwtpm_check.sh is used
6-
# (BUILD_FWTPM or BUILD_SWTPM), it manages the server and runs unit.test
7-
# internally — so exclude unit.test from check_PROGRAMS in those cases.
6+
# (BUILD_FWTPM), it manages the server and runs unit.test internally —
7+
# so exclude unit.test from check_PROGRAMS in that case.
88
if BUILD_EXAMPLES
99
if !BUILD_FWTPM
10-
if !BUILD_SWTPM
1110
check_PROGRAMS += tests/unit.test
1211
endif
13-
endif
1412
noinst_PROGRAMS += tests/unit.test
1513
tests_unit_test_SOURCES = tests/unit_tests.c \
1614
examples/tpm_test_keys.c
@@ -38,12 +36,7 @@ tests_fwtpm_unit_test_LDADD = $(LIB_STATIC_ADD)
3836
endif
3937

4038
# TPM make check: manages server, runs unit.test + run_examples.sh
41-
# Used for --enable-fwtpm and/or --enable-swtpm builds
39+
# Used for --enable-fwtpm builds
4240
if BUILD_FWTPM
4341
dist_noinst_SCRIPTS += tests/fwtpm_check.sh
4442
endif
45-
if BUILD_SWTPM
46-
if !BUILD_FWTPM
47-
dist_noinst_SCRIPTS += tests/fwtpm_check.sh
48-
endif
49-
endif

0 commit comments

Comments
 (0)