Commit Graph

10 Commits

Author SHA1 Message Date
Stefan Berger
1cd2dc6049 samples: swtpm-create-tpmca: Fix shellcheck issues and add to syntax-check target
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-02-22 17:27:05 -05:00
Stefan Berger
036fd75b1f samples: swtpm-create-tpmca: Check for missing tpmtool
Recent GnuTLS does not package tpmtool anymore. Check for
the missing tpmtool and report an error as appropriate.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-02-22 17:27:05 -05:00
Stefan Berger
f30e202df6 samples: Extend script to create a CA using a TPM 2 for signing
Extend the script that creates a CA that uses a TPM 2 for signing.
For this we have to create tokens using the TPM 2 pkcs11 module's
tpm2_ptool and can then use the p11tool for creating keys.

Add a test case that requires a running tpm2-abrmd and tpm2_ptool.
Eventually the test case should (try to) start its own tpm2-abrmd
and talk to swtpm directly but the tcti module to do that isn't
available as a package, yet.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-04-14 13:09:00 -04:00
Stefan Berger
b291eb83ed samples: Protect variables in swtpm-create-tpmca
Address several issues reported by shellcheck and protect
variables with quotes so we now can have filenames with spaces.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-01-27 09:16:16 -05:00
Stefan Berger
e0c04ff832 samples: Enable support for well known SRK password (TPM 1.2)
If tpmtool supports --srk-well-known we also support the well known
SRK password and allow the user not to provide an SRK password on
the command line.

This patch should have been applied before the previous patch that
tests this. Luckily, only very few systems have tpmtool with
--srk-well-known so that the order would matter there (and cause test
failures).

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-09 15:07:54 -05:00
Stefan Berger
588c06362b samples: Require an SRK password for TPM 1.2
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-05 15:23:11 -05:00
Stefan Berger
7be0768859 samples: Return result code from expect script to caller
Return the result code from the expect script to the caller.
Also, display possible log messages in case the private key file
was not written properly.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-05 15:23:11 -05:00
Stefan Berger
3327d83878 samples: Fix a typo
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-25 10:32:36 -04:00
Stefan Berger
15a14c552a samples: Add support for password protected root CA priv. key
Support creation and usage of the root CA with a password protected
private key. The root CA's key password can be set using the environment
variable SWTPM_ROOTCA_PASSWORD.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-25 10:32:36 -04:00
Stefan Berger
05f4d55f1f samples: Add a script to create a TPM 1.2 intermediate CA
This (experimental) script uses GnuTLS tpmtool to create a TPM 1.2
intermediate CA that can sign a vTPM's EK and platform certificates.

Add a man page for this tool.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-15 20:45:48 -04:00