tpm2d: Check SWTPM environment variable for swtpm support.

* tpm2d/intel-tss.h (TSS_Create): Check SWTPM.

--

Cherry-picked from master commit of:
	1da40db03e

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
NIIBE Yutaka 2023-09-28 13:26:52 +09:00
parent 9909f622f6
commit 8d0819346d
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
1 changed files with 9 additions and 3 deletions

View File

@ -285,9 +285,15 @@ TSS_Create(TSS_CONTEXT **tssContext)
*/
if (intType)
{
if (strcmp("socsim", intType) == 0) {
tctildr = "mssim";
}
if (strcmp("socsim", intType) == 0)
{
char *swtpm = getenv("SWTPM");
if (!swtpm || strlen(swtpm) == 0)
tctildr = "mssim";
else
tctildr = "swtpm";
}
else if (strcmp("dev", intType) == 0)
{
tctildr = "device";