Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jiazhang0/cryptfs-tpm2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7b7a5ea
Choose a base ref
...
head repository: lainwir3d/cryptfs-tpm2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 53097c2
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Feb 10, 2023

  1. Copy the full SHA
    53097c2 View commit details
Showing with 19 additions and 3 deletions.
  1. +8 −0 src/include/cryptfs_tpm2.h
  2. +11 −3 src/lib/tcti.c
8 changes: 8 additions & 0 deletions src/include/cryptfs_tpm2.h
Original file line number Diff line number Diff line change
@@ -64,13 +64,21 @@
#ifndef TSS2_LEGACY_V1
#include <tss2/tss2_tcti_mssim.h>
#include <tss2/tss2_tcti_device.h>

#ifndef TSS2_NO_ABRMD
#include <tss2/tss2-tcti-tabrmd.h>
#endif

#else
#include <tcti/tcti_socket.h>
#include <tcti/tcti_device.h>

#ifndef TSS2_NO_ABRMD
#include <tcti/tcti-tabrmd.h>
#endif

#endif

#define stringify(x) #x

#ifndef offsetof
14 changes: 11 additions & 3 deletions src/lib/tcti.c
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@

static void *tcti_handle;

#ifndef TSS2_NO_ABRMD
TSS2_TCTI_CONTEXT *
init_tcti_tabrmd(void)
{
@@ -94,6 +95,7 @@ init_tcti_tabrmd(void)

return ctx;
}
#endif

TSS2_TCTI_CONTEXT *
init_tcti_device(void)
@@ -190,17 +192,23 @@ cryptfs_tpm2_tcti_init_context(void)

tcti_str = getenv("TSS2_TCTI");
if (!tcti_str) {
#ifndef TSS2_NO_ABRMD
tcti_str = "tabrmd";
#else
tcti_str = "device";
#endif

info("Use %s as the default tcti interface\n", tcti_str);
}

if (!strcmp(tcti_str, "tabrmd"))
return init_tcti_tabrmd();
else if (!strcmp(tcti_str, "device"))
if (!strcmp(tcti_str, "device"))
return init_tcti_device();
else if (!strcmp(tcti_str, "socket"))
return init_tcti_socket();
#ifndef TSS2_NO_ABRMD
else if (!strcmp(tcti_str, "tabrmd"))
return init_tcti_tabrmd();
#endif
else
err("Invalid tcti interface specified (%s)\n", tcti_str);