aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2018-06-19 18:34:52 +0900
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2018-06-19 18:34:52 +0900
commitcb19d668964ac0dc36be23ab0a2e1ed0cf749f61 (patch)
treee647ad26b1ba041049ec3335c51f10d8f19bb62f
parent3956dbc4dabbd3ec88bb7beed476f18006c04075 (diff)
downloadopenssl_tpm2_engine-cb19d668964ac0dc36be23ab0a2e1ed0cf749f61.tar.gz
Add variable header locations
The tss2 includes are moving from /usr/include/tss2 to /usr/include/ibmtss, so add an AC_CHECK_HEADER for both locations and add a variable path include to each file so the whole system still compiles no matter which style of header path is installed. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--configure.ac5
-rw-r--r--create_tpm2_key.c7
-rw-r--r--e_tpm2-ecc.c11
-rw-r--r--e_tpm2-rsa.c11
-rw-r--r--e_tpm2.c11
-rw-r--r--tpm2-common.c11
6 files changed, 33 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac
index 4d382de..d1b3515 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,8 +84,13 @@ AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_PROG_LIBTOOL
+AC_CHECK_HEADER([tss2/tss.h],[AC_DEFINE(TSS_INCLUDE,tss2)],
+ AC_CHECK_HEADER([ibmtss/tss.h],[AC_DEFINE(TSS_INCLUDE,ibmtss)],
+ AC_MSG_ERROR([No TSS2 include directory found])))
+
CFLAGS="$CFLAGS -Wall"
AC_SUBST(CFLAGS)
+AC_SUBST(TSS_INCLUDE)
AC_OUTPUT([Makefile tests/Makefile])
diff --git a/create_tpm2_key.c b/create_tpm2_key.c
index 0f11de5..fa258be 100644
--- a/create_tpm2_key.c
+++ b/create_tpm2_key.c
@@ -19,9 +19,10 @@
#include <openssl/err.h>
#include <openssl/rand.h>
-#include <tss2/tss.h>
-#include <tss2/tssutils.h>
-#include <tss2/tssmarshal.h>
+#define TSSINCLUDE(x) < TSS_INCLUDE/x >
+#include TSSINCLUDE(tss.h)
+#include TSSINCLUDE(tssutils.h)
+#include TSSINCLUDE(tssmarshal.h)
#include "tpm2-asn.h"
#include "tpm2-common.h"
diff --git a/e_tpm2-ecc.c b/e_tpm2-ecc.c
index d9df93d..47c4b88 100644
--- a/e_tpm2-ecc.c
+++ b/e_tpm2-ecc.c
@@ -16,11 +16,12 @@
#include <openssl/sha.h>
#include <openssl/bn.h>
-#include <tss2/tss.h>
-#include <tss2/tssutils.h>
-#include <tss2/tssmarshal.h>
-#include <tss2/tssresponsecode.h>
-#include <tss2/Unmarshal_fp.h>
+#define TSSINCLUDE(x) < TSS_INCLUDE/x >
+#include TSSINCLUDE(tss.h)
+#include TSSINCLUDE(tssutils.h)
+#include TSSINCLUDE(tssmarshal.h)
+#include TSSINCLUDE(tssresponsecode.h)
+#include TSSINCLUDE(Unmarshal_fp.h)
#include "tpm2-common.h"
#include "e_tpm2.h"
diff --git a/e_tpm2-rsa.c b/e_tpm2-rsa.c
index 3b04994..0ebb826 100644
--- a/e_tpm2-rsa.c
+++ b/e_tpm2-rsa.c
@@ -18,11 +18,12 @@
#include <openssl/pem.h>
#include <openssl/x509.h>
-#include <tss2/tss.h>
-#include <tss2/tssutils.h>
-#include <tss2/tssmarshal.h>
-#include <tss2/tssresponsecode.h>
-#include <tss2/Unmarshal_fp.h>
+#define TSSINCLUDE(x) < TSS_INCLUDE/x >
+#include TSSINCLUDE(tss.h)
+#include TSSINCLUDE(tssutils.h)
+#include TSSINCLUDE(tssmarshal.h)
+#include TSSINCLUDE(tssresponsecode.h)
+#include TSSINCLUDE(Unmarshal_fp.h)
#include "tpm2-common.h"
#include "e_tpm2.h"
diff --git a/e_tpm2.c b/e_tpm2.c
index c27c6e6..94be593 100644
--- a/e_tpm2.c
+++ b/e_tpm2.c
@@ -15,11 +15,12 @@
#include <openssl/evp.h>
#include <openssl/pem.h>
-#include <tss2/tss.h>
-#include <tss2/tssutils.h>
-#include <tss2/tssmarshal.h>
-#include <tss2/tssresponsecode.h>
-#include <tss2/Unmarshal_fp.h>
+#define TSSINCLUDE(x) < TSS_INCLUDE/x >
+#include TSSINCLUDE(tss.h)
+#include TSSINCLUDE(tssutils.h)
+#include TSSINCLUDE(tssmarshal.h)
+#include TSSINCLUDE(tssresponsecode.h)
+#include TSSINCLUDE(Unmarshal_fp.h)
#include "tpm2-asn.h"
#include "tpm2-common.h"
diff --git a/tpm2-common.c b/tpm2-common.c
index ab3ce76..e71777b 100644
--- a/tpm2-common.c
+++ b/tpm2-common.c
@@ -13,11 +13,12 @@
#include <openssl/evp.h>
#include <openssl/rsa.h>
-#include <tss2/tss.h>
-#include <tss2/tssresponsecode.h>
-#include <tss2/tssmarshal.h>
-#include <tss2/tsscrypto.h>
-#include <tss2/tsscryptoh.h>
+#define TSSINCLUDE(x) < TSS_INCLUDE/x >
+#include TSSINCLUDE(tss.h)
+#include TSSINCLUDE(tssresponsecode.h)
+#include TSSINCLUDE(tssmarshal.h)
+#include TSSINCLUDE(tsscrypto.h)
+#include TSSINCLUDE(tsscryptoh.h)
#include "tpm2-common.h"