Commit Graph

71 Commits

Author SHA1 Message Date
Stefan Berger
08da93a96f swtpm_setup: Implement support for ECC keys
Implement support in swtpm_setup.sh so that the TPM's primary key
can be an ECC key.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:46 -04:00
Stefan Berger
15226ad9a5 Support TPM 2 in swtpm_setup and swtpm_setup.sh
Support TPM 2 in swtpm_setup and swtpm_setup.sh.
Implement support for all command line options except for:
 o --take-ownership and anything related to ownership passwords
 o --lock-nvram
 o --display

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:46 -04:00
Stefan Berger
5409034b5f build-sys: Remove '/' after $(DESTDIR)
Remove the unnecessary '/' after $(DESTDIR).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-05-29 12:16:49 -04:00
Stefan Berger
2fb204666a samples: remove the TPM attribute parameters from the options file
Since swtpm_setup now uses the swtpm_ioctl tool to get some of the
TPM attributes directly from the TPM, we don't need to pass these
options via the options file anymore.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-05-05 01:09:46 -04:00
Stefan Berger
f6accfb869 sample: propagate and log error if swtpm_cert is missing
If the swtpm_cert was missing, nothing was reported in the error log. Change
this and report it in the error log rather than writing the error in the
certificate file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-04-23 11:58:59 -04:00
Stefan Berger
ab37e6f383 samples: implement options for pass TPM spec parameters
Implement options --tpm-spec-family, --tpm-spec-revision, and
tpm-spec-level to pass to swtpm_cert for EK creation.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-04-23 10:00:47 -04:00
Stefan Berger
4713f2996a samples: Error out if key exists but is not readable for user
If the key is not readable as the current user, such as tss:tss,
but it is there, we don't try to create it but error out.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-04-18 14:53:55 -04:00
Stefan Berger
373a90840c samples: Create a root CA that signs the cert used for creating TPM certs
We are currently missing the Authority Key Id in the certificate used for
creating the EK cert. To get this, we create a root CA for our local CA
and use that root CA to sign the local CA's certificate. Our local
CA is now an intermediate CA and the Authority Key Id can now be copied
into the EK cert.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-04-17 10:52:35 -04:00
Stefan Berger
8740ec5765 samples: Use the --add-header option for TPM 1.2
Use the --add-header option when writing a cert for a TPM 1.2

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-04-12 13:20:21 -04:00
Stefan Berger
5ceed802cc samples: pass --subject to swtpm_cert since certtool needs a subject
Certtool seems to not verify a certificate chain properly unless
the certificate has a distinguished name.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-12-21 21:14:48 -05:00
Stefan Berger
863d1a157c samples: error if swtpm-localca gets an unsupported option passed
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-12-20 20:18:54 -05:00
Stefan Berger
b7a4c100fb samples: improve error handling
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-28 15:58:15 -05:00
Stefan Berger
c4ac0a11e9 build: remove hardcoded tss user and group
Remove the hardcodes tss user and group and to configure with
--with-tss-user=tss --with-tss-group=tss to set the tss user
and group to be used.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-02 20:47:37 -05:00
Stefan Berger
7d4b4514a3 build: enable RPM building for non-root users
Disable the chown commands when building an RPM; we try to detect this
by the usage of DESTDIR.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-16 19:08:43 -04:00
Stefan Berger
1004cfde5a samples: propagate error code
Propagate error code to the exit statement.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-07-02 16:02:09 -04:00
Stefan Berger
a1004f8caa build: set proper rights on swtpm-localca script when installing
Signed-off-by: Stefan  Berger <stefanb@linux.vnet.ibm.com>
2015-05-04 01:07:28 -04:00
Stefan Berger
3cb54a5d35 build: install /var/lib/swtpm-localca with proper owner
Install /var/lib/swtpm-localca so that tss can access it.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-04 00:31:44 -04:00
Stefan Berger
58145689b0 samples: automatically create signing key and issuer cert
Automatically create the signing key and a self-signed issuer
certificate if the state dir has to be created.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-04 02:52:08 -04:00
Stefan Berger
7ad7df96ba sample: rename swtpm_localca dir to swtpm-localca
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-04 00:36:23 -04:00
root
070d313cb3 samples: rename swtpm-localca.sh to swtpm-localca
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-04 00:26:14 -04:00
Stefan Berger
e46a2b6686 merging swtpm-tools into this project 2014-12-05 13:43:21 -05:00