aboutsummaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/Makefile.am7
-rw-r--r--agent/agent.h26
2 files changed, 31 insertions, 2 deletions
diff --git a/agent/Makefile.am b/agent/Makefile.am
index 4fe74f539..3abdde4fc 100644
--- a/agent/Makefile.am
+++ b/agent/Makefile.am
@@ -51,12 +51,15 @@ gpg_agent_SOURCES = \
protect.c \
trustlist.c \
divert-scd.c \
- divert-tpm2.c \
- tpm2.c tpm2.h \
cvt-openpgp.c cvt-openpgp.h \
call-scd.c \
learncard.c
+if HAVE_LIBTSS
+gpg_agent_SOURCES += tpm2.c tpm2.h \
+ divert-tpm2.c
+endif
+
common_libs = $(libcommon)
commonpth_libs = $(libcommonpth)
if HAVE_W32CE_SYSTEM
diff --git a/agent/agent.h b/agent/agent.h
index 7a77eb629..67e82b763 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -535,6 +535,7 @@ gpg_error_t agent_marktrusted (ctrl_t ctrl, const char *name,
void agent_reload_trustlist (void);
/*-- divert-tpm2.c --*/
+#ifdef HAVE_LIBTSS
int divert_tpm2_pksign (ctrl_t ctrl, const char *desc_text,
const unsigned char *digest, size_t digestlen, int algo,
const unsigned char *shadow_info, unsigned char **r_sig,
@@ -545,6 +546,31 @@ int divert_tpm2_pkdecrypt (ctrl_t ctrl, const char *desc_text,
char **r_buf, size_t *r_len, int *r_padding);
int divert_tpm2_writekey (ctrl_t ctrl, const unsigned char *grip,
gcry_sexp_t s_skey);
+#else
+static inline int divert_tpm2_pksign (ctrl_t ctrl, const char *desc_text,
+ const unsigned char *digest,
+ size_t digestlen, int algo,
+ const unsigned char *shadow_info,
+ unsigned char **r_sig,
+ size_t *r_siglen)
+{
+ return -EINVAL;
+}
+static inline int divert_tpm2_pkdecrypt (ctrl_t ctrl, const char *desc_text,
+ const unsigned char *cipher,
+ const unsigned char *shadow_info,
+ char **r_buf, size_t *r_len,
+ int *r_padding)
+{
+ return -EINVAL;
+}
+static inline int divert_tpm2_writekey (ctrl_t ctrl, const unsigned char *grip,
+ gcry_sexp_t s_skey)
+{
+ return -EINVAL;
+}
+#endif
+
/*-- divert-scd.c --*/