diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2023-06-25 08:56:15 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2023-06-26 10:13:45 -0400 |
commit | fdbab95dc58c30095da8c2d542fbc612b1fa3689 (patch) | |
tree | 1f7889868b711daa112e0e8a3318608234623e32 | |
parent | c07bc504269211f88beca012dad934de8cc6027b (diff) | |
download | openssl_tpm2_engine-fdbab95dc58c30095da8c2d542fbc612b1fa3689.tar.gz |
intel-tss: fix Intel TSS for swtpm
Apparently the Intel TSS insists on sending a command to the control
socket for the mssim tcti backend. This fails for swtpm (because it
isn't listening), so set the swtpm backend for this case.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | src/include/intel-tss.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/include/intel-tss.h b/src/include/intel-tss.h index b82d09f..db38fee 100644 --- a/src/include/intel-tss.h +++ b/src/include/intel-tss.h @@ -276,7 +276,12 @@ TSS_Create(TSS_CONTEXT **tssContext) */ if (intType) { if (strcmp("socsim", intType) == 0) { - tctildr = "mssim"; + char *swtpm = getenv("SWTPM"); + + if (!swtpm || strlen(swtpm) == 0) + tctildr = "mssim"; + else + tctildr = "swtpm"; } else if (strcmp("dev", intType) == 0) { tctildr = "device"; } else { |