mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-08-07 07:57:42 +00:00
Extend an existing test case using the IBM TSS2 tools and add state created with libtpms v0.9 and v0.10 that contains signing and encryption primary keys. Use the keys to verify a signature created by those versions of libtpms and data encrypted by them to make sure that primary keys that are recreated with later versions of libtpms still create the same primary keys. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
||
|---|---|---|
| .. | ||
| encrypted-v0.9-null.bin | ||
| encrypted-v0.10-default-v1.bin | ||
| encrypted-v0.10-null.bin | ||
| Readme.txt | ||
| signature-v0.9-null.bin | ||
| signature-v0.10-default-v1.bin | ||
| signature-v0.10-null.bin | ||
| toencrypt.txt | ||
| tosign.txt | ||
| tpmstate-v0.9-null.bin | ||
| tpmstate-v0.10-default-v1.bin | ||
| tpmstate-v0.10-null.bin | ||
The state files in this directory were created with the following commands.
Note that there is an RSA-3072 signing key persisted at 81000000 and an RSA-3072
storage key at 81000001.
profile=default-v1
version=v0.10 ; means that libtpms v0.10 was used to create the state
swtpm socket \
--tpmstate backend-uri=file://data/tpm2state8/tpmstate-${version}-${profile}.bin \
--tpm2 \
--ctrl type=tcp,port=2322 \
--server type=tcp,port=2321 \
--flags not-need-init,startup-clear \
--profile name=${profile}
tsscreateprimary -hi o -rsa 3072 -si
tssevictcontrol -hi o -ho 80000000 -hp 81000000
tsscreateprimary -hi o -rsa 3072 -des
tssevictcontrol -hi o -ho 80000001 -hp 81000001
tsssign \
-if ./tests/data/tpm2state8/tosign.txt \
-hk 81000000 \
-halg sha256 \
-os ./tests/data/tpm2state8/signature-v0.10-default-v1.bin \
-scheme rsapss
tssencryptdecrypt \
-hk 81000001 \
-if ./tests/data/tpm2state8/toencrypt.txt \
-of ./tests/data/tpm2state8/encrypted-v0.10-default.bin