1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

tpm2d: Check SWTPM environment variable for swtpm support.

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

--

Cherry-picked from master commit of:
	1da40db03eba4aa056f7cdf8ef90292272a4147d

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

View File

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