diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2023-09-28 06:26:52 +0200 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2023-10-06 02:52:26 +0200 |
commit | 8d0819346db8943b519ea7685569382c56776d15 (patch) | |
tree | ca9a4c03ad098a95c3dfd0d20bfd60a12305fea0 /tpm2d | |
parent | agent: fix tpm2d keytotpm handling (diff) | |
download | gnupg2-8d0819346db8943b519ea7685569382c56776d15.tar.xz gnupg2-8d0819346db8943b519ea7685569382c56776d15.zip |
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>
Diffstat (limited to 'tpm2d')
-rw-r--r-- | tpm2d/intel-tss.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tpm2d/intel-tss.h b/tpm2d/intel-tss.h index 615f81e2f..53da5cee2 100644 --- a/tpm2d/intel-tss.h +++ b/tpm2d/intel-tss.h @@ -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"; |