Commit Graph

9 Commits

Author SHA1 Message Date
Stefan Berger
27d4c5d83f swtpm_localca: Test for available issuercert before creating CA
Avoid trying to create TPM certificates while the issuer certificate has
not been created, yet (in a 2nd step).

To resolve this do not just test for availability of the signing key, which
is created first, but also test for the issuer certifcate, which is created
in a 2nd step when the local CA is created. If either one is missing,
attempt to create the CA.

Resolves: #644
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-02-17 20:29:17 -05:00
Stefan Berger
e621b21d4c samples: Do not follow symlink on logfile (CVE-2020-28407)
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-11-17 15:47:43 -05:00
Stefan Berger
5af35971b8 samples: Do not truncate logfile when testing write-access
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-10-06 15:05:08 -04:00
Stefan Berger
7b72dfedec samples: swtpm-localca: Pass password via template file when possible
Pass the CA's private key password via the template file. Remove recently
added old GnuTLS support. Extend man page with a paragraph about short-
comings of certtool that doesn't seem to allow private key password being
passed either as environment variable or template file.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-21 16:01:20 -04:00
Stefan Berger
c73771b0c5 samples: Fix support for -h and -? options in swtpm-localca
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-21 13:17:39 -04:00
Stefan Berger
3ed0744de0 samples: Add --password parameter for older GnuTLS versions
Older versions of GnuTLS need --password on the command line while
newer versions require GNUTLS_PIN to be set to pass the password.
So, this patch accomodates older versions of GnuTLS.

Older version of GnuTLS seem to NOT be able to handle a CA private
key needing a password and a signing key needing a password when
creating the intermediate CA. So this case of 2 passwords will
always fail.

The value of the local CA is not so high that passing passwords on
the command line would be an issue. Later on when using the CA the
password are set via environment variables, so not visible to other
users.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-18 20:12:01 -04:00
Stefan Berger
14d2d4381d samples: Add support for pkcs11 module environment variables to config file
Add support for pkcs11 module environment variables to the config file.
These variables may have the following format:

   env:VARNAME=VALUE

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-18 12:09:11 -04:00
Stefan Berger
cc592a0931 samples: Also allow signingkey_password to be used not just 'SWTPM_PKCS11_PIN'
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-18 12:09:11 -04:00
Stefan Berger
b71da43026 samples: Rewrite swtpm-localca in python
Rewrite swtpm-localca in python and get rid of the bash file and the flock
dependency.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-18 12:09:11 -04:00