aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2023-03-01 12:13:17 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2023-03-17 15:50:10 +0000
commit7ec176bfcd7d92aec0e89ab736899da0666f1948 (patch)
treeb2749a65647f6d0394a704be597d9ba1194f2c39
parentd954f97da5780fb23dc72b531484c90bbd04c582 (diff)
downloadopenssl_tpm2_engine-7ec176bfcd7d92aec0e89ab736899da0666f1948.tar.gz
Restructure the subdirectories to follow a more common approach
Eventually we're going to need to build engine and provider objects with the same name, so they'll need to be built in different directories and thus the project needs restructuring to allow this. engine is now in src/engine tpm2-common.c is now built as a library and in src/libcommon common includes are in src/include All the key creation and manipulation tools are in src/tools The tests have been rejigged to change where they look for the engine and consolidate bindir (which is now the src/tools) to a central location in the Makefile.am Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am52
-rw-r--r--configure.ac12
-rw-r--r--src/engine/Makefile.am15
-rw-r--r--src/engine/e_tpm2-ecc.c (renamed from e_tpm2-ecc.c)0
-rw-r--r--src/engine/e_tpm2-ecc.h (renamed from e_tpm2-ecc.h)0
-rw-r--r--src/engine/e_tpm2-rsa.c (renamed from e_tpm2-rsa.c)0
-rw-r--r--src/engine/e_tpm2-rsa.h (renamed from e_tpm2-rsa.h)0
-rw-r--r--src/engine/e_tpm2.c (renamed from e_tpm2.c)0
-rw-r--r--src/engine/e_tpm2.h (renamed from e_tpm2.h)0
-rw-r--r--src/include/ibm-tss.h (renamed from ibm-tss.h)0
-rw-r--r--src/include/intel-tss.h (renamed from intel-tss.h)0
-rw-r--r--src/include/tpm2-asn.h (renamed from tpm2-asn.h)0
-rw-r--r--src/include/tpm2-common.h (renamed from tpm2-common.h)0
-rw-r--r--src/include/tpm2-tss.h (renamed from tpm2-tss.h)0
-rw-r--r--src/libcommon/Makefile.am6
-rw-r--r--src/libcommon/tpm2-common.c (renamed from tpm2-common.c)0
-rw-r--r--src/tools/Makefile.am37
-rw-r--r--src/tools/create_tpm2_key.1.in (renamed from create_tpm2_key.1.in)0
-rw-r--r--src/tools/create_tpm2_key.c (renamed from create_tpm2_key.c)0
-rw-r--r--src/tools/load_tpm2_key.1.in (renamed from load_tpm2_key.1.in)0
-rw-r--r--src/tools/load_tpm2_key.c (renamed from load_tpm2_key.c)0
-rw-r--r--src/tools/seal_tpm2_data.1.in (renamed from seal_tpm2_data.1.in)0
-rw-r--r--src/tools/seal_tpm2_data.c (renamed from seal_tpm2_data.c)0
-rw-r--r--src/tools/signed_tpm2_policy.1.in (renamed from signed_tpm2_policy.1.in)0
-rw-r--r--src/tools/signed_tpm2_policy.c (renamed from signed_tpm2_policy.c)0
-rw-r--r--src/tools/unseal_tpm2_data.1.in (renamed from unseal_tpm2_data.1.in)0
-rw-r--r--src/tools/unseal_tpm2_data.c (renamed from unseal_tpm2_data.c)0
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/check_auth.sh1
-rwxr-xr-xtests/check_counter_timer.sh1
-rwxr-xr-xtests/check_curves.sh1
-rwxr-xr-xtests/check_der.sh1
-rwxr-xr-xtests/check_enhanced_auth.sh1
-rwxr-xr-xtests/check_importable.sh1
-rwxr-xr-xtests/check_old_keys.sh1
-rwxr-xr-xtests/check_rsa_oaep_pss.sh1
-rwxr-xr-xtests/check_signed_policies.sh1
-rwxr-xr-xtests/check_tpm_directory.sh2
-rwxr-xr-xtests/check_wrap_auth.sh1
-rwxr-xr-xtests/create_ecc.sh1
-rwxr-xr-xtests/create_non_tpm_keys.sh1
-rwxr-xr-xtests/create_nonopenssl_ecc.sh1
-rwxr-xr-xtests/create_tpm_key.sh1
-rwxr-xr-xtests/create_tpm_key_auth.sh1
-rwxr-xr-xtests/da_check.sh1
-rwxr-xr-xtests/derive_ecc.sh1
-rwxr-xr-xtests/dynamic_engine.sh3
-rwxr-xr-xtests/fail_connect.sh2
-rw-r--r--tests/openssl.cnf2
-rwxr-xr-xtests/restricted_parent.sh1
-rwxr-xr-xtests/seal_unseal.sh1
-rwxr-xr-xtests/test_nv_key.sh1
-rwxr-xr-xtests/wrap_ecc.sh1
-rwxr-xr-xtests/wrap_generic_ecc.sh1
-rwxr-xr-xtests/wrap_pkcs12.sh1
-rwxr-xr-xtests/wrap_tpm_key.sh1
57 files changed, 74 insertions, 83 deletions
diff --git a/.gitignore b/.gitignore
index 255ae38..af8d20c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
*.la
+*.a
*.lo
*.o
*.1
diff --git a/Makefile.am b/Makefile.am
index 58b6cb0..00dd801 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,53 +1,3 @@
EXTRA_DIST = README openssl.cnf.sample
-if NATIVE_BUILD
-EXTRA_DIST += create_tpm2_key.1 load_tpm2_key.1 seal_tpm2_data.1 \
- unseal_tpm2_data.1 signed_tpm2_policy.1
-man1_MANS = create_tpm2_key.1 load_tpm2_key.1 seal_tpm2_data.1 \
- unseal_tpm2_data.1 signed_tpm2_policy.1
-
-CLEANFILES = $(man1_MANS)
-endif
-
-if HAVE_OPENSSL3
-CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L
-endif
-
-openssl_engine_LTLIBRARIES=libtpm2.la
-bin_PROGRAMS=create_tpm2_key load_tpm2_key seal_tpm2_data unseal_tpm2_data \
- signed_tpm2_policy
-openssl_enginedir=@enginesdir@
-
-libtpm2_la_LDFLAGS= -no-undefined -avoid-version
-libtpm2_la_LIBADD=${DEPS_LIBS}
-libtpm2_la_SOURCES=e_tpm2.c e_tpm2-rsa.c e_tpm2-ecc.c tpm2-common.c
-libtpm2_la_CFLAGS=${DEPS_CFLAGS} -g -Werror
-
-create_tpm2_key_SOURCES=create_tpm2_key.c tpm2-common.c
-create_tpm2_key_LDADD=${DEPS_LIBS}
-create_tpm2_key_CFLAGS=${DEPS_CFLAGS} -Werror
-
-load_tpm2_key_SOURCES=load_tpm2_key.c tpm2-common.c
-load_tpm2_key_LDADD=${DEPS_LIBS}
-load_tpm2_key_CFLAGS=${DEPS_CFLAGS} -Werror
-
-seal_tpm2_data_SOURCES=seal_tpm2_data.c tpm2-common.c
-seal_tpm2_data_LDADD=${DEPS_LIBS}
-seal_tpm2_data_CFLAGS=${DEPS_CFLAGS} -Werror
-
-unseal_tpm2_data_SOURCES=unseal_tpm2_data.c tpm2-common.c
-unseal_tpm2_data_LDADD=${DEPS_LIBS}
-unseal_tpm2_data_CFLAGS=${DEPS_CFLAGS} -Werror
-
-signed_tpm2_policy_SOURCES=signed_tpm2_policy.c tpm2-common.c
-signed_tpm2_policy_LDADD=${DEPS_LIBS}
-signed_tpm2_policy_CFLAGS=${DEPS_CFLAGS} -g -Werror
-
-$(builddir)/%.1: $(srcdir)/%.1.in $(top_builddir)/%
- $(HELP2MAN) --no-info -i $< -o $@ $(top_builddir)/$*
-
-# openssl from 1.1.0 looks for engine.so not libengine.so
-install-data-hook:
- cd $(DESTDIR)$(openssl_enginedir) && $(LN_S) -f libtpm2@SHREXT@ tpm2@SHREXT@
-
-SUBDIRS = tests doc
+SUBDIRS = tests doc src/libcommon src/engine src/tools
diff --git a/configure.ac b/configure.ac
index ff572a7..2144b95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,8 +137,11 @@ AC_PATH_PROG(SWTPM, swtpm,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
AC_PATH_PROG(SWTPM_IOCTL, swtpm_ioctl,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
AC_CHECK_PROG(XML2RFC, xml2rfc, xml2rfc)
AM_CONDITIONAL(HAVE_XML2RFC, test -n "${XML2RFC}")
-CFLAGS="$CFLAGS -Wall"
+CFLAGS="$CFLAGS -Wall -Werror"
SHREXT=$shrext_cmds
+if test -n "$ac_have_openssl3"; then
+ CFLAGS="$CFLAGS -DOPENSSL_API_COMPAT=0x10100000L"
+fi
AC_SUBST(CFLAGS)
AC_SUBST(TSS_INCLUDE)
AC_SUBST(SHREXT)
@@ -156,7 +159,12 @@ fi
AC_SUBST(testtpm)
-AC_OUTPUT([Makefile tests/Makefile doc/Makefile])
+AC_OUTPUT([Makefile
+ tests/Makefile
+ doc/Makefile
+ src/libcommon/Makefile
+ src/engine/Makefile
+ src/tools/Makefile])
cat <<EOF
diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am
new file mode 100644
index 0000000..f9bebb7
--- /dev/null
+++ b/src/engine/Makefile.am
@@ -0,0 +1,15 @@
+AM_CPPFLAGS = -I ../include
+
+openssl_engine_LTLIBRARIES=libtpm2.la
+openssl_enginedir=@enginesdir@
+
+COMMONLIB = ../libcommon/libcommon.a
+
+libtpm2_la_LDFLAGS= -no-undefined -avoid-version
+libtpm2_la_LIBADD=${COMMONLIB} ${DEPS_LIBS}
+libtpm2_la_SOURCES=e_tpm2.c e_tpm2-rsa.c e_tpm2-ecc.c
+libtpm2_la_CFLAGS=${DEPS_CFLAGS}
+
+# openssl from 1.1.0 looks for engine.so not libengine.so
+install-data-hook:
+ cd $(DESTDIR)$(openssl_enginedir) && $(LN_S) -f libtpm2@SHREXT@ tpm2@SHREXT@
diff --git a/e_tpm2-ecc.c b/src/engine/e_tpm2-ecc.c
index 92ea12d..92ea12d 100644
--- a/e_tpm2-ecc.c
+++ b/src/engine/e_tpm2-ecc.c
diff --git a/e_tpm2-ecc.h b/src/engine/e_tpm2-ecc.h
index d8000ec..d8000ec 100644
--- a/e_tpm2-ecc.h
+++ b/src/engine/e_tpm2-ecc.h
diff --git a/e_tpm2-rsa.c b/src/engine/e_tpm2-rsa.c
index a886f96..a886f96 100644
--- a/e_tpm2-rsa.c
+++ b/src/engine/e_tpm2-rsa.c
diff --git a/e_tpm2-rsa.h b/src/engine/e_tpm2-rsa.h
index c59a358..c59a358 100644
--- a/e_tpm2-rsa.h
+++ b/src/engine/e_tpm2-rsa.h
diff --git a/e_tpm2.c b/src/engine/e_tpm2.c
index 22772a0..22772a0 100644
--- a/e_tpm2.c
+++ b/src/engine/e_tpm2.c
diff --git a/e_tpm2.h b/src/engine/e_tpm2.h
index a720acc..a720acc 100644
--- a/e_tpm2.h
+++ b/src/engine/e_tpm2.h
diff --git a/ibm-tss.h b/src/include/ibm-tss.h
index b28b522..b28b522 100644
--- a/ibm-tss.h
+++ b/src/include/ibm-tss.h
diff --git a/intel-tss.h b/src/include/intel-tss.h
index 85c4031..85c4031 100644
--- a/intel-tss.h
+++ b/src/include/intel-tss.h
diff --git a/tpm2-asn.h b/src/include/tpm2-asn.h
index ce0074b..ce0074b 100644
--- a/tpm2-asn.h
+++ b/src/include/tpm2-asn.h
diff --git a/tpm2-common.h b/src/include/tpm2-common.h
index 526591c..526591c 100644
--- a/tpm2-common.h
+++ b/src/include/tpm2-common.h
diff --git a/tpm2-tss.h b/src/include/tpm2-tss.h
index 39f61ba..39f61ba 100644
--- a/tpm2-tss.h
+++ b/src/include/tpm2-tss.h
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
new file mode 100644
index 0000000..a142014
--- /dev/null
+++ b/src/libcommon/Makefile.am
@@ -0,0 +1,6 @@
+noinst_LIBRARIES = libcommon.a
+
+AM_CPPFLAGS = -I ../include/
+
+libcommon_a_SOURCES = tpm2-common.c
+libcommon_a_CFLAGS = -fPIC
diff --git a/tpm2-common.c b/src/libcommon/tpm2-common.c
index 17159ab..17159ab 100644
--- a/tpm2-common.c
+++ b/src/libcommon/tpm2-common.c
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
new file mode 100644
index 0000000..187d3fc
--- /dev/null
+++ b/src/tools/Makefile.am
@@ -0,0 +1,37 @@
+if NATIVE_BUILD
+EXTRA_DIST = create_tpm2_key.1 load_tpm2_key.1 seal_tpm2_data.1 \
+ unseal_tpm2_data.1 signed_tpm2_policy.1
+man1_MANS = create_tpm2_key.1 load_tpm2_key.1 seal_tpm2_data.1 \
+ unseal_tpm2_data.1 signed_tpm2_policy.1
+
+CLEANFILES = $(man1_MANS)
+endif
+
+AM_CPPFLAGS = -I ../include
+
+bin_PROGRAMS=create_tpm2_key load_tpm2_key seal_tpm2_data unseal_tpm2_data \
+ signed_tpm2_policy
+COMMONLIB = ../libcommon/libcommon.a
+
+create_tpm2_key_SOURCES=create_tpm2_key.c
+create_tpm2_key_LDADD=${COMMONLIB} ${DEPS_LIBS}
+create_tpm2_key_CFLAGS=${DEPS_CFLAGS}
+
+load_tpm2_key_SOURCES=load_tpm2_key.c
+load_tpm2_key_LDADD=${COMMONLIB} ${DEPS_LIBS}
+load_tpm2_key_CFLAGS=${DEPS_CFLAGS}
+
+seal_tpm2_data_SOURCES=seal_tpm2_data.c
+seal_tpm2_data_LDADD=${COMMONLIB} ${DEPS_LIBS}
+seal_tpm2_data_CFLAGS=${DEPS_CFLAGS}
+
+unseal_tpm2_data_SOURCES=unseal_tpm2_data.c
+unseal_tpm2_data_LDADD=${COMMONLIB} ${DEPS_LIBS}
+unseal_tpm2_data_CFLAGS=${DEPS_CFLAGS}
+
+signed_tpm2_policy_SOURCES=signed_tpm2_policy.c
+signed_tpm2_policy_LDADD=${COMMONLIB} ${DEPS_LIBS}
+signed_tpm2_policy_CFLAGS=${DEPS_CFLAGS}
+
+$(builddir)/%.1: $(srcdir)/%.1.in $(builddir)/%
+ $(HELP2MAN) --no-info -i $< -o $@ $(builddir)/$*
diff --git a/create_tpm2_key.1.in b/src/tools/create_tpm2_key.1.in
index bbdfa9a..bbdfa9a 100644
--- a/create_tpm2_key.1.in
+++ b/src/tools/create_tpm2_key.1.in
diff --git a/create_tpm2_key.c b/src/tools/create_tpm2_key.c
index f701a93..f701a93 100644
--- a/create_tpm2_key.c
+++ b/src/tools/create_tpm2_key.c
diff --git a/load_tpm2_key.1.in b/src/tools/load_tpm2_key.1.in
index 20914e3..20914e3 100644
--- a/load_tpm2_key.1.in
+++ b/src/tools/load_tpm2_key.1.in
diff --git a/load_tpm2_key.c b/src/tools/load_tpm2_key.c
index 35dcdb2..35dcdb2 100644
--- a/load_tpm2_key.c
+++ b/src/tools/load_tpm2_key.c
diff --git a/seal_tpm2_data.1.in b/src/tools/seal_tpm2_data.1.in
index fe7b7c4..fe7b7c4 100644
--- a/seal_tpm2_data.1.in
+++ b/src/tools/seal_tpm2_data.1.in
diff --git a/seal_tpm2_data.c b/src/tools/seal_tpm2_data.c
index 1e4474c..1e4474c 100644
--- a/seal_tpm2_data.c
+++ b/src/tools/seal_tpm2_data.c
diff --git a/signed_tpm2_policy.1.in b/src/tools/signed_tpm2_policy.1.in
index a299d94..a299d94 100644
--- a/signed_tpm2_policy.1.in
+++ b/src/tools/signed_tpm2_policy.1.in
diff --git a/signed_tpm2_policy.c b/src/tools/signed_tpm2_policy.c
index 1ddf9b4..1ddf9b4 100644
--- a/signed_tpm2_policy.c
+++ b/src/tools/signed_tpm2_policy.c
diff --git a/unseal_tpm2_data.1.in b/src/tools/unseal_tpm2_data.1.in
index 3533f13..3533f13 100644
--- a/unseal_tpm2_data.1.in
+++ b/src/tools/unseal_tpm2_data.1.in
diff --git a/unseal_tpm2_data.c b/src/tools/unseal_tpm2_data.c
index 43b846d..43b846d 100644
--- a/unseal_tpm2_data.c
+++ b/src/tools/unseal_tpm2_data.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 718ef14..8666e69 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -37,6 +37,7 @@ tpm_server_found:
AM_TESTS_ENVIRONMENT = TPM_INTERFACE_TYPE=socsim; export TPM_INTERFACE_TYPE; \
srcdir=$(abs_srcdir); export srcdir; \
+ bindir=$(abs_srcdir)/../src/tools; export bindir; \
OPENSSL_CONF=$(abs_srcdir)/openssl.cnf; export OPENSSL_CONF; \
TPMSERVER=$(TPMSERVER); export TPMSERVER; \
TSSTYPE=@TSSTYPE@; export TSSTYPE; \
diff --git a/tests/check_auth.sh b/tests/check_auth.sh
index 632e97d..e6cc50f 100755
--- a/tests/check_auth.sh
+++ b/tests/check_auth.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/check_counter_timer.sh b/tests/check_counter_timer.sh
index b3505d7..ac87009 100755
--- a/tests/check_counter_timer.sh
+++ b/tests/check_counter_timer.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# create a policy based on the tpm current clock the failing policy
diff --git a/tests/check_curves.sh b/tests/check_curves.sh
index f50259f..90e48d5 100755
--- a/tests/check_curves.sh
+++ b/tests/check_curves.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/check_der.sh b/tests/check_der.sh
index 0cbfe06..c06516b 100755
--- a/tests/check_der.sh
+++ b/tests/check_der.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/check_enhanced_auth.sh b/tests/check_enhanced_auth.sh
index c262a97..1118a46 100755
--- a/tests/check_enhanced_auth.sh
+++ b/tests/check_enhanced_auth.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
tss_pcrreset_cmd=tsspcrreset
tss_pcrextend_cmd=tsspcrextend
diff --git a/tests/check_importable.sh b/tests/check_importable.sh
index d30a8e2..93ac4e4 100755
--- a/tests/check_importable.sh
+++ b/tests/check_importable.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
# export the parent key as a public key
prim=$(tsscreateprimary -ecc nistp256 -hi o -opem srk.pub | sed 's/Handle //') || exit 1
diff --git a/tests/check_old_keys.sh b/tests/check_old_keys.sh
index 799ad25..b5778a2 100755
--- a/tests/check_old_keys.sh
+++ b/tests/check_old_keys.sh
@@ -1,7 +1,6 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/check_rsa_oaep_pss.sh b/tests/check_rsa_oaep_pss.sh
index 76793a6..b0ecdba 100755
--- a/tests/check_rsa_oaep_pss.sh
+++ b/tests/check_rsa_oaep_pss.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
openssl genrsa 2048 > key.priv || exit 1
openssl rsa -in key.priv -out key.pub -pubout || exit 1
diff --git a/tests/check_signed_policies.sh b/tests/check_signed_policies.sh
index 39c0022..b3eaddf 100755
--- a/tests/check_signed_policies.sh
+++ b/tests/check_signed_policies.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
tss_pcrreset_cmd=tsspcrreset
tss_pcrextend_cmd=tsspcrextend
diff --git a/tests/check_tpm_directory.sh b/tests/check_tpm_directory.sh
index d18c04d..f40e192 100755
--- a/tests/check_tpm_directory.sh
+++ b/tests/check_tpm_directory.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
printenv|grep dir
@@ -38,7 +37,6 @@ cur_user=$(id -u -n -r)
cur_group=$(id -g -n -r)
fakeroot sh -c '
-bindir=${srcdir}/..
printenv|grep dir
diff --git a/tests/check_wrap_auth.sh b/tests/check_wrap_auth.sh
index 3dd0901..25bdc7d 100755
--- a/tests/check_wrap_auth.sh
+++ b/tests/check_wrap_auth.sh
@@ -1,7 +1,6 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/create_ecc.sh b/tests/create_ecc.sh
index 8c2c0c8..9fecdd2 100755
--- a/tests/create_ecc.sh
+++ b/tests/create_ecc.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/create_non_tpm_keys.sh b/tests/create_non_tpm_keys.sh
index 0487d94..275c2d5 100755
--- a/tests/create_non_tpm_keys.sh
+++ b/tests/create_non_tpm_keys.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/create_nonopenssl_ecc.sh b/tests/create_nonopenssl_ecc.sh
index 5c1f004..6774584 100755
--- a/tests/create_nonopenssl_ecc.sh
+++ b/tests/create_nonopenssl_ecc.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/create_tpm_key.sh b/tests/create_tpm_key.sh
index dab50d1..a56b4be 100755
--- a/tests/create_tpm_key.sh
+++ b/tests/create_tpm_key.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# The Intel tss currently fails with the null seed, so skip the test
diff --git a/tests/create_tpm_key_auth.sh b/tests/create_tpm_key_auth.sh
index c34c24c..4edd703 100755
--- a/tests/create_tpm_key_auth.sh
+++ b/tests/create_tpm_key_auth.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
auth=4ffsiurh4
diff --git a/tests/da_check.sh b/tests/da_check.sh
index b2e996b..b2134a4 100755
--- a/tests/da_check.sh
+++ b/tests/da_check.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/derive_ecc.sh b/tests/derive_ecc.sh
index 7a8a11e..5475b60 100755
--- a/tests/derive_ecc.sh
+++ b/tests/derive_ecc.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is to check that the key derivation works
diff --git a/tests/dynamic_engine.sh b/tests/dynamic_engine.sh
index d0a0615..002cbed 100755
--- a/tests/dynamic_engine.sh
+++ b/tests/dynamic_engine.sh
@@ -1,12 +1,11 @@
#!/bin/bash
set -x
-bindir=${srcdir}/..
# to work with the dynamic engine, we unset the openssl.cnf that
# specifies a built in engine
unset OPENSSL_CONF
-export OPENSSL_ENGINES=${srcdir}/../.libs
+export OPENSSL_ENGINES=${srcdir}/../src/engine/.libs
ln -s libtpm2.so ${OPENSSL_ENGINES}/tpm2.so
testkey() {
diff --git a/tests/fail_connect.sh b/tests/fail_connect.sh
index eb3edf9..a69907f 100755
--- a/tests/fail_connect.sh
+++ b/tests/fail_connect.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
+set -x
##
# test is
diff --git a/tests/openssl.cnf b/tests/openssl.cnf
index 22a9332..8ac239a 100644
--- a/tests/openssl.cnf
+++ b/tests/openssl.cnf
@@ -18,7 +18,7 @@ engines = engines_section
tpm2 = tpm2_section
[tpm2_section]
-dynamic_path = $ENV::srcdir/../.libs/libtpm2.so
+dynamic_path = $ENV::srcdir/../src/engine/.libs/libtpm2.so
init = 1
PIN = $ENV::SRKPIN
NVPREFIX = $ENV::NVPREFIX
diff --git a/tests/restricted_parent.sh b/tests/restricted_parent.sh
index 95de78e..2119ff4 100755
--- a/tests/restricted_parent.sh
+++ b/tests/restricted_parent.sh
@@ -2,7 +2,6 @@
set -x
-bindir=${srcdir}/..
NV=81000101
NV2=81000102
diff --git a/tests/seal_unseal.sh b/tests/seal_unseal.sh
index e677dc7..22ac1d4 100755
--- a/tests/seal_unseal.sh
+++ b/tests/seal_unseal.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
for n in sha1 sha256 sha384; do
echo "Checking Name Hash $n"
diff --git a/tests/test_nv_key.sh b/tests/test_nv_key.sh
index 298284c..5b56b50 100755
--- a/tests/test_nv_key.sh
+++ b/tests/test_nv_key.sh
@@ -1,7 +1,6 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/wrap_ecc.sh b/tests/wrap_ecc.sh
index bfebce4..e2ca530 100755
--- a/tests/wrap_ecc.sh
+++ b/tests/wrap_ecc.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/wrap_generic_ecc.sh b/tests/wrap_generic_ecc.sh
index 60bc9a9..6a49943 100755
--- a/tests/wrap_generic_ecc.sh
+++ b/tests/wrap_generic_ecc.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/wrap_pkcs12.sh b/tests/wrap_pkcs12.sh
index 57b0477..5603eff 100755
--- a/tests/wrap_pkcs12.sh
+++ b/tests/wrap_pkcs12.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# test is
diff --git a/tests/wrap_tpm_key.sh b/tests/wrap_tpm_key.sh
index a916fd9..6621275 100755
--- a/tests/wrap_tpm_key.sh
+++ b/tests/wrap_tpm_key.sh
@@ -1,6 +1,5 @@
#!/bin/bash
-bindir=${srcdir}/..
##
# The Intel tss currently fails with the null seed, so skip the test