Skip to content

Commit

Permalink
Add tests for the TLS PK with TPM.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Dec 8, 2023
1 parent c0cd64d commit a50e4fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/make-test-swtpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: ./autogen.sh
- name: wolfssl configure
working-directory: ./wolfssl
run: ./configure --enable-wolftpm
run: ./configure --enable-wolftpm --enable-pkcallbacks
- name: wolfssl make install
working-directory: ./wolfssl
run: sudo make install
Expand Down
12 changes: 12 additions & 0 deletions examples/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ run_tpm_tls_server() { # Usage: run_tpm_tls_server [ecc/rsa] [tpmargs]]
}

if [ $WOLFCRYPT_ENABLE -eq 1 ]; then
# Run with Crypto CB
run_tpm_tls_client "rsa" ""
run_tpm_tls_client "rsa" "-aes"
run_tpm_tls_client "ecc" ""
Expand All @@ -227,6 +228,17 @@ if [ $WOLFCRYPT_ENABLE -eq 1 ]; then
run_tpm_tls_server "rsa" "-aes"
run_tpm_tls_server "ecc" ""
run_tpm_tls_server "ecc" "-aes"

# Run with PK
run_tpm_tls_client "rsa" "-pk"
run_tpm_tls_client "rsa" "-pk -aes"
run_tpm_tls_client "ecc" "-pk"
run_tpm_tls_client "ecc" "-pk -aes"

run_tpm_tls_server "rsa" "-pk "
run_tpm_tls_server "rsa" "-pk -aes"
run_tpm_tls_server "ecc" "-pk"
run_tpm_tls_server "ecc" "-pk -aes"
fi


Expand Down
1 change: 1 addition & 0 deletions examples/tls/tls_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ int TPM2_TLS_ClientArgs(void* userCtx, int argc, char *argv[])
printf("\tUse %s keys\n", useECC ? "ECC" : "RSA");
printf("\tUse Parameter Encryption: %s\n", TPM2_GetAlgName(paramEncAlg));
printf("\tUsing Port: %d\n", port);
printf("\tUsing %s callbacks\n", usePK ? "PK" : "Crypto");

/* Init the TPM2 device */
rc = wolfTPM2_Init(&dev, TPM2_IoCb, userCtx);
Expand Down
1 change: 1 addition & 0 deletions examples/tls/tls_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ int TPM2_TLS_ServerArgs(void* userCtx, int argc, char *argv[])
printf("\tUse %s keys\n", useECC ? "ECC" : "RSA");
printf("\tUse Parameter Encryption: %s\n", TPM2_GetAlgName(paramEncAlg));
printf("\tUsing Port: %d\n", port);
printf("\tUsing %s callbacks\n", usePK ? "PK" : "Crypto");

/* Init the TPM2 device */
rc = wolfTPM2_Init(&dev, TPM2_IoCb, userCtx);
Expand Down

0 comments on commit a50e4fe

Please sign in to comment.