Skip to content

Commit 48eca3c

Browse files
committed
Fix issue with possible use of uninitialized in rc in TPM2_GetNonceNoLock. Attempt to fix build for old v4.7.0 wolfssl.
1 parent b042e4d commit 48eca3c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,18 @@ jobs:
192192
repository: wolfssl/wolfssl
193193
path: wolfssl-old
194194
ref: v4.7.0-stable
195+
- name: Apply wolfssl-v4.7.0.patch to old wolfSSL
196+
if: matrix.name == 'old-wolfssl'
197+
working-directory: ./wolfssl-old
198+
run: |
199+
git apply ../.github/workflows/wolfssl-v4.7.0.patch
195200
- name: Setup old wolfSSL for linking
196201
if: matrix.name == 'old-wolfssl'
197202
working-directory: ./wolfssl-old
198203
run: |
199204
./autogen.sh
200-
./configure --enable-wolftpm --disable-examples --enable-cryptonly CFLAGS="-DWOLFSSL_PUBLIC_MP -DWOLFSSL_TEST_CERT -DWOLFSSL_KEY_GEN"
205+
./configure --enable-wolftpm --disable-examples CFLAGS="-DWOLFSSL_PUBLIC_MP -DWOLFSSL_TEST_CERT -DWOLFSSL_KEY_GEN -DNO_WRITEV"
206+
201207
make
202208
sudo make install
203209
sudo ldconfig

src/tpm2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5746,6 +5746,7 @@ int TPM2_GetNonceNoLock(byte* nonceBuf, int nonceSz)
57465746
#else
57475747
/* Call GetRandom directly, so a custom packet buffer can be used.
57485748
* This won't conflict when being called from TPM2_CommandProcess. */
5749+
rc = 0; /* default to success */
57495750
while (randSz < nonceSz) {
57505751
UINT16 inSz = nonceSz - randSz, outSz = 0;
57515752
if (inSz > MAX_RNG_REQ_SIZE) {

0 commit comments

Comments
 (0)