summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2014-08-15 08:41:43 +0200
committerStef Walter <stef@thewalter.net>2014-08-15 10:43:04 +0200
commit677dee1a04058aefe8c7689f88da52afe3b4b4bb (patch)
tree570bf0fb53fa659954f03e146696969ab97abe3a
parent2a35a67923c26cd38839197aee51c274e5c2550e (diff)
downloadp11-kit-677dee1a04058aefe8c7689f88da52afe3b4b4bb.tar.gz
Move to non-recursive Makefile for building bins and libs
Still use recursive for documentation and translation.
-rw-r--r--Makefile.am66
-rw-r--r--build/Makefile.decl16
-rw-r--r--build/Makefile.tests21
-rw-r--r--build/certs/Makefile38
-rw-r--r--common/Makefile.am113
-rw-r--r--common/frob-getauxval.c (renamed from common/tests/frob-getauxval.c)0
-rw-r--r--common/test-array.c (renamed from common/tests/test-array.c)0
-rw-r--r--common/test-attrs.c (renamed from common/tests/test-attrs.c)0
-rw-r--r--common/test-buffer.c (renamed from common/tests/test-buffer.c)0
-rw-r--r--common/test-compat.c (renamed from common/tests/test-compat.c)0
-rw-r--r--common/test-constants.c (renamed from common/tests/test-constants.c)0
-rw-r--r--common/test-dict.c (renamed from common/tests/test-dict.c)0
-rw-r--r--common/test-hash.c (renamed from common/tests/test-hash.c)0
-rw-r--r--common/test-lexer.c (renamed from common/tests/test-lexer.c)0
-rw-r--r--common/test-message.c (renamed from common/tests/test-message.c)0
-rw-r--r--common/test-path.c (renamed from common/tests/test-path.c)0
-rw-r--r--common/test-tests.c (renamed from common/tests/test-tests.c)0
-rw-r--r--common/test-url.c (renamed from common/tests/test-url.c)0
-rw-r--r--common/tests/Makefile.am39
-rw-r--r--configure.ac8
-rw-r--r--doc/manual/Makefile.am8
-rw-r--r--p11-kit/Makefile.am244
-rw-r--r--p11-kit/fixtures/package-modules/four.module (renamed from p11-kit/tests/files/package-modules/four.module)0
-rw-r--r--p11-kit/fixtures/package-modules/win32/four.module (renamed from p11-kit/tests/files/package-modules/win32/four.module)0
-rw-r--r--p11-kit/fixtures/system-modules/one.module (renamed from p11-kit/tests/files/system-modules/one.module)0
-rw-r--r--p11-kit/fixtures/system-modules/two-duplicate.module (renamed from p11-kit/tests/files/system-modules/two-duplicate.module)0
-rw-r--r--p11-kit/fixtures/system-modules/two.badname (renamed from p11-kit/tests/files/system-modules/two.badname)0
-rw-r--r--p11-kit/fixtures/system-modules/win32/one.module (renamed from p11-kit/tests/files/system-modules/win32/one.module)0
-rw-r--r--p11-kit/fixtures/system-modules/win32/two-duplicate.module (renamed from p11-kit/tests/files/system-modules/win32/two-duplicate.module)0
-rw-r--r--p11-kit/fixtures/system-modules/win32/two.badname (renamed from p11-kit/tests/files/system-modules/win32/two.badname)0
-rw-r--r--p11-kit/fixtures/system-pkcs11.conf (renamed from p11-kit/tests/files/system-pkcs11.conf)0
-rw-r--r--p11-kit/fixtures/test-1.conf (renamed from p11-kit/tests/files/test-1.conf)0
-rw-r--r--p11-kit/fixtures/test-pinfile (renamed from p11-kit/tests/files/test-pinfile)0
-rw-r--r--p11-kit/fixtures/test-pinfile-large (renamed from p11-kit/tests/files/test-pinfile-large)0
-rw-r--r--p11-kit/fixtures/test-system-invalid.conf (renamed from p11-kit/tests/files/test-system-invalid.conf)0
-rw-r--r--p11-kit/fixtures/test-system-merge.conf (renamed from p11-kit/tests/files/test-system-merge.conf)0
-rw-r--r--p11-kit/fixtures/test-system-none.conf (renamed from p11-kit/tests/files/test-system-none.conf)0
-rw-r--r--p11-kit/fixtures/test-system-only.conf (renamed from p11-kit/tests/files/test-system-only.conf)0
-rw-r--r--p11-kit/fixtures/test-user-invalid.conf (renamed from p11-kit/tests/files/test-user-invalid.conf)0
-rw-r--r--p11-kit/fixtures/test-user-only.conf (renamed from p11-kit/tests/files/test-user-only.conf)0
-rw-r--r--p11-kit/fixtures/test-user.conf (renamed from p11-kit/tests/files/test-user.conf)0
-rw-r--r--p11-kit/fixtures/user-modules/one.module (renamed from p11-kit/tests/files/user-modules/one.module)0
-rw-r--r--p11-kit/fixtures/user-modules/three.module (renamed from p11-kit/tests/files/user-modules/three.module)0
-rw-r--r--p11-kit/fixtures/user-modules/win32/one.module (renamed from p11-kit/tests/files/user-modules/win32/one.module)0
-rw-r--r--p11-kit/fixtures/user-modules/win32/three.module (renamed from p11-kit/tests/files/user-modules/win32/three.module)0
-rw-r--r--p11-kit/frob-setuid.c (renamed from p11-kit/tests/frob-setuid.c)0
-rw-r--r--p11-kit/mock-module-ep.c (renamed from p11-kit/tests/mock-module-ep.c)0
-rw-r--r--p11-kit/mock-module-ep2.c (renamed from p11-kit/tests/mock-module-ep2.c)0
-rw-r--r--p11-kit/print-messages.c (renamed from p11-kit/tests/print-messages.c)0
-rw-r--r--p11-kit/test-conf.c (renamed from p11-kit/tests/test-conf.c)54
-rw-r--r--p11-kit/test-deprecated.c (renamed from p11-kit/tests/test-deprecated.c)0
-rw-r--r--p11-kit/test-init.c (renamed from p11-kit/tests/test-init.c)0
-rw-r--r--p11-kit/test-iter.c (renamed from p11-kit/tests/test-iter.c)0
-rw-r--r--p11-kit/test-log.c (renamed from p11-kit/tests/test-log.c)0
-rw-r--r--p11-kit/test-managed.c (renamed from p11-kit/tests/test-managed.c)0
-rw-r--r--p11-kit/test-mock.c (renamed from p11-kit/tests/test-mock.c)0
-rw-r--r--p11-kit/test-modules.c (renamed from p11-kit/tests/test-modules.c)0
-rw-r--r--p11-kit/test-pin.c (renamed from p11-kit/tests/test-pin.c)6
-rw-r--r--p11-kit/test-progname.c (renamed from p11-kit/tests/test-progname.c)0
-rw-r--r--p11-kit/test-proxy.c (renamed from p11-kit/tests/test-proxy.c)0
-rw-r--r--p11-kit/test-rpc.c (renamed from p11-kit/tests/test-rpc.c)0
-rw-r--r--p11-kit/test-transport.c (renamed from p11-kit/tests/test-transport.c)2
-rw-r--r--p11-kit/test-uri.c (renamed from p11-kit/tests/test-uri.c)0
-rw-r--r--p11-kit/test-util.c (renamed from p11-kit/tests/test-util.c)0
-rw-r--r--p11-kit/test-virtual.c (renamed from p11-kit/tests/test-virtual.c)0
-rw-r--r--p11-kit/tests/Makefile.am91
-rw-r--r--trust/Makefile.am273
-rw-r--r--trust/anchor.c5
-rw-r--r--trust/enumerate.h5
-rw-r--r--trust/extract.c5
-rw-r--r--trust/fixtures/cacert-ca.der (renamed from trust/tests/files/cacert-ca.der)bin1857 -> 1857 bytes
-rw-r--r--trust/fixtures/cacert3-distrust-all.pem (renamed from trust/tests/files/cacert3-distrust-all.pem)0
-rw-r--r--trust/fixtures/cacert3-distrusted-all.pem (renamed from trust/tests/files/cacert3-distrusted-all.pem)0
-rw-r--r--trust/fixtures/cacert3-not-trusted.pem (renamed from trust/tests/files/cacert3-not-trusted.pem)0
-rw-r--r--trust/fixtures/cacert3-trusted-alias.pem (renamed from trust/tests/files/cacert3-trusted-alias.pem)0
-rw-r--r--trust/fixtures/cacert3-trusted-keyid.pem (renamed from trust/tests/files/cacert3-trusted-keyid.pem)0
-rw-r--r--trust/fixtures/cacert3-trusted-server-alias.pem (renamed from trust/tests/files/cacert3-trusted-server-alias.pem)0
-rw-r--r--trust/fixtures/cacert3-trusted.pem (renamed from trust/tests/files/cacert3-trusted.pem)0
-rw-r--r--trust/fixtures/cacert3-twice.pem (renamed from trust/tests/files/cacert3-twice.pem)0
-rw-r--r--trust/fixtures/cacert3.der (renamed from trust/tests/files/cacert3.der)bin1885 -> 1885 bytes
-rw-r--r--trust/fixtures/cacert3.pem (renamed from trust/tests/files/cacert3.pem)0
-rw-r--r--trust/fixtures/distrusted.pem (renamed from trust/tests/files/distrusted.pem)0
-rw-r--r--trust/fixtures/empty-file (renamed from trust/tests/files/empty-file)0
-rw-r--r--trust/fixtures/multiple.pem (renamed from trust/tests/files/multiple.pem)0
-rw-r--r--trust/fixtures/openssl-trust-no-trust.pem (renamed from trust/tests/files/openssl-trust-no-trust.pem)0
-rw-r--r--trust/fixtures/redhat-ca.der (renamed from trust/tests/files/redhat-ca.der)bin948 -> 948 bytes
-rw-r--r--trust/fixtures/self-signed-with-eku.der (renamed from trust/tests/files/self-signed-with-eku.der)bin480 -> 480 bytes
-rw-r--r--trust/fixtures/self-signed-with-ku.der (renamed from trust/tests/files/self-signed-with-ku.der)bin478 -> 478 bytes
-rw-r--r--trust/fixtures/simple-string (renamed from trust/tests/files/simple-string)0
-rw-r--r--trust/fixtures/testing-server.der (renamed from trust/tests/files/testing-server.der)bin554 -> 554 bytes
-rw-r--r--trust/fixtures/thawte.pem (renamed from trust/tests/files/thawte.pem)0
-rw-r--r--trust/fixtures/unrecognized-file.txt (renamed from trust/tests/files/unrecognized-file.txt)0
-rw-r--r--trust/fixtures/verisign-v1.der (renamed from trust/tests/files/verisign-v1.der)bin576 -> 576 bytes
-rw-r--r--trust/fixtures/verisign-v1.pem (renamed from trust/tests/files/verisign-v1.pem)0
-rw-r--r--trust/frob-bc.c (renamed from trust/tests/frob-bc.c)0
-rw-r--r--trust/frob-cert.c (renamed from trust/tests/frob-cert.c)0
-rw-r--r--trust/frob-eku.c (renamed from trust/tests/frob-eku.c)0
-rw-r--r--trust/frob-ext.c (renamed from trust/tests/frob-ext.c)0
-rw-r--r--trust/frob-ku.c (renamed from trust/tests/frob-ku.c)0
-rw-r--r--trust/frob-multi-init.c (renamed from trust/tests/frob-multi-init.c)0
-rw-r--r--trust/frob-nss-trust.c (renamed from trust/tests/frob-nss-trust.c)0
-rw-r--r--trust/frob-oid.c (renamed from trust/tests/frob-oid.c)0
-rw-r--r--trust/frob-pow.c (renamed from trust/tests/frob-pow.c)0
-rw-r--r--trust/frob-token.c (renamed from trust/tests/frob-token.c)0
-rw-r--r--trust/input/anchors/cacert3.der (renamed from trust/tests/input/anchors/cacert3.der)bin1885 -> 1885 bytes
-rw-r--r--trust/input/anchors/testing-ca.der (renamed from trust/tests/input/anchors/testing-ca.der)bin970 -> 970 bytes
-rw-r--r--trust/input/blacklist/self-server.der (renamed from trust/tests/input/blacklist/self-server.der)bin396 -> 396 bytes
-rw-r--r--trust/input/cacert-ca.der (renamed from trust/tests/input/cacert-ca.der)bin1857 -> 1857 bytes
-rw-r--r--trust/input/distrusted.pem (renamed from trust/tests/input/distrusted.pem)0
-rw-r--r--trust/input/verisign-v1.p11-kit (renamed from trust/tests/input/verisign-v1.p11-kit)0
-rw-r--r--trust/list.c5
-rw-r--r--trust/test-asn1.c (renamed from trust/tests/test-asn1.c)0
-rw-r--r--trust/test-base64.c (renamed from trust/tests/test-base64.c)0
-rw-r--r--trust/test-builder.c (renamed from trust/tests/test-builder.c)0
-rw-r--r--trust/test-bundle.c (renamed from trust/tests/test-bundle.c)12
-rw-r--r--trust/test-cer.c (renamed from trust/tests/test-cer.c)12
-rw-r--r--trust/test-digest.c (renamed from trust/tests/test-digest.c)0
-rw-r--r--trust/test-enumerate.c (renamed from trust/tests/test-enumerate.c)2
-rw-r--r--trust/test-extract.in (renamed from trust/tests/test-extract.in)0
-rw-r--r--trust/test-index.c (renamed from trust/tests/test-index.c)0
-rw-r--r--trust/test-module.c (renamed from trust/tests/test-module.c)16
-rw-r--r--trust/test-oid.c (renamed from trust/tests/test-oid.c)0
-rw-r--r--trust/test-openssl.c (renamed from trust/tests/test-openssl.c)20
-rw-r--r--trust/test-parser.c (renamed from trust/tests/test-parser.c)20
-rw-r--r--trust/test-pem.c (renamed from trust/tests/test-pem.c)0
-rw-r--r--trust/test-persist.c (renamed from trust/tests/test-persist.c)0
-rw-r--r--trust/test-save.c (renamed from trust/tests/test-save.c)14
-rw-r--r--trust/test-token.c (renamed from trust/tests/test-token.c)4
-rw-r--r--trust/test-trust.c (renamed from trust/tests/test-trust.c)0
-rw-r--r--trust/test-trust.h (renamed from trust/tests/test-trust.h)0
-rw-r--r--trust/test-utf8.c (renamed from trust/tests/test-utf8.c)0
-rw-r--r--trust/test-x509.c (renamed from trust/tests/test-x509.c)0
-rw-r--r--trust/tests/Makefile.am122
133 files changed, 632 insertions, 589 deletions
diff --git a/Makefile.am b/Makefile.am
index bef51cf..9032154 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,21 +1,44 @@
-include $(top_srcdir)/build/Makefile.decl
-
+NULL =
WEBHOST = anarchy.freedesktop.org
WEBBASE = /srv/p11-glue.freedesktop.org/www
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/common \
+ -DBINDIR=\"$(bindir)\" \
+ -DBUILDDIR=\"$(abs_builddir)\" \
+ -DDATADIR=\"$(datadir)\" \
+ -DPRIVATEDIR=\"$(privatedir)\" \
+ -DSRCDIR=\"$(abs_srcdir)\" \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DP11_KIT_FUTURE_UNSTABLE_API
+
+bin_PROGRAMS =
+
+CHECK_PROGS =
+
+EXTRA_DIST = HACKING
+
+incdir = $(includedir)/p11-kit-1/p11-kit
+inc_HEADERS =
+
+lib_LTLIBRARIES =
+
+noinst_LTLIBRARIES =
+noinst_PROGRAMS = $(CHECK_PROGS)
+noinst_SCRIPTS =
+
+TESTS = $(CHECK_PROGS)
+
+include common/Makefile.am
+include p11-kit/Makefile.am
+
if WITH_TRUST_MODULE
-TRUST_DIR = trust
-else
-TRUST_DIR =
+include trust/Makefile.am
endif
-SUBDIRS = \
- common \
- p11-kit \
- $(TRUST_DIR) \
- doc \
- po
+SUBDIRS = . doc po
ACLOCAL_AMFLAGS = -I build/m4
@@ -25,6 +48,22 @@ DISTCHECK_CONFIGURE_FLAGS = \
--enable-strict \
CFLAGS='-O2'
+
+MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet
+
+LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes
+
+HELLCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=82 --quiet --tool=helgrind
+
+memcheck: all
+ make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS
+
+leakcheck: all
+ make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS
+
+hellcheck: all
+ make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(HELLCHECK_ENV)" check-TESTS
+
dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
@@ -64,10 +103,5 @@ upload-release: $(DIST_ARCHIVES)
gpg --detach-sign --local-user 'stef@thewalter.net' $<
scp $< $<.sig $(WEBHOST):$(WEBBASE)/releases/
-EXTRA_DIST = \
- build/Makefile.tests \
- build/Makefile.decl \
- HACKING
-
transifex:
cd $(srcdir) && sh build/tx-update
diff --git a/build/Makefile.decl b/build/Makefile.decl
deleted file mode 100644
index 8dca4e7..0000000
--- a/build/Makefile.decl
+++ /dev/null
@@ -1,16 +0,0 @@
-NULL =
-
-memcheck:
- @for dir in $(SUBDIRS); do \
- test "$$dir" = "." || $(MAKE) -C $$dir memcheck; \
- done
-
-leakcheck:
- @for dir in $(SUBDIRS); do \
- test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \
- done
-
-hellcheck:
- @for dir in $(SUBDIRS); do \
- test "$$dir" = "." || $(MAKE) -C $$dir hellcheck; \
- done
diff --git a/build/Makefile.tests b/build/Makefile.tests
deleted file mode 100644
index c26e689..0000000
--- a/build/Makefile.tests
+++ /dev/null
@@ -1,21 +0,0 @@
-NULL =
-
-TEST_CFLAGS = \
- -DSRCDIR=\"$(abs_srcdir)\" \
- -DBUILDDIR=\"$(abs_builddir)\" \
- -DP11_KIT_FUTURE_UNSTABLE_API
-
-MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet
-
-LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes
-
-HELLCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=82 --quiet --tool=helgrind
-
-memcheck: all
- make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS
-
-leakcheck: all
- make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS
-
-hellcheck: all
- make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(HELLCHECK_ENV)" check-TESTS
diff --git a/build/certs/Makefile b/build/certs/Makefile
index 4e61b14..033ecde 100644
--- a/build/certs/Makefile
+++ b/build/certs/Makefile
@@ -3,39 +3,39 @@
# We copy everything into its final location, and those test files are
# distributed in the tarballs
-TRUST = ../../trust/tests
+TRUST = ../../trust
prepare-certs:
cp -v cacert3.der $(TRUST)/input/anchors
- cp -v cacert3.der $(TRUST)/files
- cp -v cacert3.der $(TRUST)/files
- openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3.pem
- openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3.pem
- cat $(TRUST)/files/cacert3.pem $(TRUST)/files/cacert3.pem > $(TRUST)/files/cacert3-twice.pem
- openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-trusted.pem \
+ cp -v cacert3.der $(TRUST)/fixtures
+ cp -v cacert3.der $(TRUST)/fixtures
+ openssl x509 -in cacert3.der -inform DER -out $(TRUST)/fixtures/cacert3.pem
+ openssl x509 -in cacert3.der -inform DER -out $(TRUST)/fixtures/cacert3.pem
+ cat $(TRUST)/fixtures/cacert3.pem $(TRUST)/fixtures/cacert3.pem > $(TRUST)/fixtures/cacert3-twice.pem
+ openssl x509 -in cacert3.der -inform DER -out $(TRUST)/fixtures/cacert3-trusted.pem \
-addtrust serverAuth -addreject emailProtection \
-setalias "Custom Label"
- cp $(TRUST)/files/cacert3-trusted.pem $(TRUST)/files/cacert3-trusted-server-alias.pem
- openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-trusted-alias.pem \
+ cp $(TRUST)/fixtures/cacert3-trusted.pem $(TRUST)/fixtures/cacert3-trusted-server-alias.pem
+ openssl x509 -in cacert3.der -inform DER -out $(TRUST)/fixtures/cacert3-trusted-alias.pem \
-setalias "Custom Label"
- openssl x509 -in cacert3.der -inform DER -out $(TRUST)/files/cacert3-distrust-all.pem \
+ openssl x509 -in cacert3.der -inform DER -out $(TRUST)/fixtures/cacert3-distrust-all.pem \
-addreject serverAuth -addreject clientAuth -addreject codeSigning \
-addreject emailProtection -addreject ipsecEndSystem -addreject ipsecTunnel \
-addreject ipsecUser -addreject timeStamping
- openssl x509 -in verisign-v1.der -inform DER -out $(TRUST)/files/verisign-v1.pem \
+ openssl x509 -in verisign-v1.der -inform DER -out $(TRUST)/fixtures/verisign-v1.pem \
-setalias "Custom Label"
- cat $(TRUST)/files/cacert3-trusted-server-alias.pem \
- $(TRUST)/files/verisign-v1.pem > $(TRUST)/files/multiple.pem
+ cat $(TRUST)/fixtures/cacert3-trusted-server-alias.pem \
+ $(TRUST)/fixtures/verisign-v1.pem > $(TRUST)/fixtures/multiple.pem
cp -v cacert-ca.der $(TRUST)/input
- cp -v cacert-ca.der $(TRUST)/files
- openssl x509 -in redhat-newca.der -inform DER -out $(TRUST)/files/distrusted.pem \
+ cp -v cacert-ca.der $(TRUST)/fixtures
+ openssl x509 -in redhat-newca.der -inform DER -out $(TRUST)/fixtures/distrusted.pem \
-addreject clientAuth -setalias "Red Hat Is the CA"
- cp -v $(TRUST)/files/distrusted.pem $(TRUST)/input
+ cp -v $(TRUST)/fixtures/distrusted.pem $(TRUST)/input
cp -v self-server.der $(TRUST)/input/blacklist
- cp -v self-signed-with-eku.der $(TRUST)/files
- cp -v self-signed-with-ku.der $(TRUST)/files
+ cp -v self-signed-with-eku.der $(TRUST)/fixtures
+ cp -v self-signed-with-ku.der $(TRUST)/fixtures
cp -v testing-ca.der $(TRUST)/input/anchors
- cp -v testing-server.der $(TRUST)/files
+ cp -v testing-server.der $(TRUST)/fixtures
# Rebuild the self-signed certificates. This is almost never necessary and
# will require other changes in the code, mostly here as documentation
diff --git a/common/Makefile.am b/common/Makefile.am
index 2df3915..5f185b8 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -1,15 +1,9 @@
-include $(top_srcdir)/build/Makefile.decl
-
-SUBDIRS = . tests
-
-incdir = $(includedir)/p11-kit-1/p11-kit
-
-inc_HEADERS = \
- pkcs11.h \
+inc_HEADERS += \
+ common/pkcs11.h \
$(NULL)
-noinst_LTLIBRARIES = \
+noinst_LTLIBRARIES += \
libp11-common.la \
libp11-library.la \
libp11-test.la \
@@ -17,31 +11,94 @@ noinst_LTLIBRARIES = \
$(NULL)
libp11_common_la_SOURCES = \
- argv.c argv.h \
- attrs.c attrs.h \
- array.c array.h \
- buffer.c buffer.h \
- compat.c compat.h \
- constants.c constants.h \
- debug.c debug.h \
- dict.c dict.h \
- hash.c hash.h \
- lexer.c lexer.h \
- message.c message.h \
- path.c path.h \
- pkcs11.h pkcs11x.h \
- url.c url.h \
+ common/argv.c common/argv.h \
+ common/attrs.c common/attrs.h \
+ common/array.c common/array.h \
+ common/buffer.c common/buffer.h \
+ common/compat.c common/compat.h \
+ common/constants.c common/constants.h \
+ common/debug.c common/debug.h \
+ common/dict.c common/dict.h \
+ common/hash.c common/hash.h \
+ common/lexer.c common/lexer.h \
+ common/message.c common/message.h \
+ common/path.c common/path.h \
+ common/pkcs11.h common/pkcs11x.h \
+ common/url.c common/url.h \
$(NULL)
libp11_library_la_SOURCES = \
- library.c library.h \
+ common/library.c common/library.h \
$(NULL)
libp11_test_la_SOURCES = \
- mock.c mock.h \
- test.c test.h \
+ common/mock.c common/mock.h \
+ common/test.c common/test.h \
$(NULL)
libp11_tool_la_SOURCES = \
- tool.c tool.h \
- $(NULL) \ No newline at end of file
+ common/tool.c common/tool.h \
+ $(NULL)
+
+# Tests ----------------------------------------------------------------
+
+common_LIBS = \
+ libp11-test.la \
+ libp11-common.la \
+ $(NULL)
+
+CHECK_PROGS += \
+ test-tests \
+ test-compat \
+ test-hash \
+ test-dict \
+ test-array \
+ test-constants \
+ test-attrs \
+ test-buffer \
+ test-url \
+ test-path \
+ test-lexer \
+ test-message \
+ $(NULL)
+
+test_array_SOURCES = common/test-array.c
+test_array_LDADD = $(common_LIBS)
+
+test_attrs_SOURCES = common/test-attrs.c
+test_attrs_LDADD = $(common_LIBS)
+
+test_buffer_SOURCES = common/test-buffer.c
+test_buffer_LDADD = $(common_LIBS)
+
+test_compat_SOURCES = common/test-compat.c
+test_compat_LDADD = $(common_LIBS)
+
+test_constants_SOURCES = common/test-constants.c
+test_constants_LDADD = $(common_LIBS)
+
+test_dict_SOURCES = common/test-dict.c
+test_dict_LDADD = $(common_LIBS)
+
+test_hash_SOURCES = common/test-hash.c
+test_hash_LDADD = $(common_LIBS)
+
+test_lexer_SOURCES = common/test-lexer.c
+test_lexer_LDADD = $(common_LIBS)
+
+test_message_SOURCES = common/test-message.c
+test_message_LDADD = $(common_LIBS)
+
+test_path_SOURCES = common/test-path.c
+test_path_LDADD = $(common_LIBS)
+
+test_tests_SOURCES = common/test-tests.c
+test_tests_LDADD = $(common_LIBS)
+
+test_url_SOURCES = common/test-url.c
+test_url_LDADD = $(common_LIBS)
+
+noinst_PROGRAMS += frob-getauxval
+
+frob_getauxval_SOURCES = common/frob-getauxval.c
+frob_getauxval_LDADD = $(common_LIBS)
diff --git a/common/tests/frob-getauxval.c b/common/frob-getauxval.c
index 02745be..02745be 100644
--- a/common/tests/frob-getauxval.c
+++ b/common/frob-getauxval.c
diff --git a/common/tests/test-array.c b/common/test-array.c
index 695917a..695917a 100644
--- a/common/tests/test-array.c
+++ b/common/test-array.c
diff --git a/common/tests/test-attrs.c b/common/test-attrs.c
index 79895e2..79895e2 100644
--- a/common/tests/test-attrs.c
+++ b/common/test-attrs.c
diff --git a/common/tests/test-buffer.c b/common/test-buffer.c
index 4fd060d..4fd060d 100644
--- a/common/tests/test-buffer.c
+++ b/common/test-buffer.c
diff --git a/common/tests/test-compat.c b/common/test-compat.c
index 42471ae..42471ae 100644
--- a/common/tests/test-compat.c
+++ b/common/test-compat.c
diff --git a/common/tests/test-constants.c b/common/test-constants.c
index 9adc81a..9adc81a 100644
--- a/common/tests/test-constants.c
+++ b/common/test-constants.c
diff --git a/common/tests/test-dict.c b/common/test-dict.c
index f12a34e..f12a34e 100644
--- a/common/tests/test-dict.c
+++ b/common/test-dict.c
diff --git a/common/tests/test-hash.c b/common/test-hash.c
index a12d5a4..a12d5a4 100644
--- a/common/tests/test-hash.c
+++ b/common/test-hash.c
diff --git a/common/tests/test-lexer.c b/common/test-lexer.c
index 7d18e87..7d18e87 100644
--- a/common/tests/test-lexer.c
+++ b/common/test-lexer.c
diff --git a/common/tests/test-message.c b/common/test-message.c
index 63ecf31..63ecf31 100644
--- a/common/tests/test-message.c
+++ b/common/test-message.c
diff --git a/common/tests/test-path.c b/common/test-path.c
index 57619c8..57619c8 100644
--- a/common/tests/test-path.c
+++ b/common/test-path.c
diff --git a/common/tests/test-tests.c b/common/test-tests.c
index ba31d83..ba31d83 100644
--- a/common/tests/test-tests.c
+++ b/common/test-tests.c
diff --git a/common/tests/test-url.c b/common/test-url.c
index 892bf3c..892bf3c 100644
--- a/common/tests/test-url.c
+++ b/common/test-url.c
diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
deleted file mode 100644
index 7bbc4ce..0000000
--- a/common/tests/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-
-include $(top_srcdir)/build/Makefile.tests
-
-COMMON = $(top_srcdir)/common
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(srcdir)/.. \
- -I$(COMMON) \
- -DBUILDDIR=\"$(abs_builddir)\" \
- $(TEST_CFLAGS)
-
-LDADD = \
- $(NULL)
-
-CHECK_PROGS = \
- test-tests \
- test-compat \
- test-hash \
- test-dict \
- test-array \
- test-constants \
- test-attrs \
- test-buffer \
- test-url \
- test-path \
- test-lexer \
- test-message \
- $(NULL)
-
-noinst_PROGRAMS = \
- frob-getauxval \
- $(CHECK_PROGS)
-
-TESTS = $(CHECK_PROGS)
-
-LDADD += \
- $(top_builddir)/common/libp11-test.la \
- $(top_builddir)/common/libp11-common.la
diff --git a/configure.ac b/configure.ac
index 7d738b3..f487900 100644
--- a/configure.ac
+++ b/configure.ac
@@ -503,19 +503,13 @@ privatedir='${libdir}/p11-kit'
AC_SUBST(privatedir)
AC_CONFIG_FILES([Makefile
- common/Makefile
- common/tests/Makefile
doc/Makefile
doc/manual/Makefile
po/Makefile.in
- p11-kit/Makefile
- p11-kit/tests/Makefile
p11-kit/p11-kit-1.pc
p11-kit/pkcs11.conf.example
- trust/Makefile
trust/trust-extract-compat
- trust/tests/Makefile
- trust/tests/test-extract
+ trust/test-extract
])
AC_OUTPUT
diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am
index dc15075..300fc3f 100644
--- a/doc/manual/Makefile.am
+++ b/doc/manual/Makefile.am
@@ -102,10 +102,10 @@ expand_content_files= $(generate_files)
GTKDOC_LIBS=
# Hacks around gtk-doc brokenness for out of tree builds
-p11-kit-sections.txt: $(srcdir)/p11-kit-sections.txt
- cp $(srcdir)/p11-kit-sections.txt p11-kit-sections.txt
-p11-kit-overrides.txt: $(srcdir)/p11-kit-overrides.txt
- cp $(srcdir)/p11-kit-overrides.txt p11-kit-overrides.txt
+$(builddir)/p11-kit-sections.txt: $(srcdir)/p11-kit-sections.txt
+ cp $(srcdir)/p11-kit-sections.txt $(builddir)/p11-kit-sections.txt
+$(builddir)/p11-kit-overrides.txt: $(srcdir)/p11-kit-overrides.txt
+ cp $(srcdir)/p11-kit-overrides.txt $(builddir)/p11-kit-overrides.txt
# Generate our files with variables
sysdir.xml:
diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am
index dd2716d..b4b4886 100644
--- a/p11-kit/Makefile.am
+++ b/p11-kit/Makefile.am
@@ -1,51 +1,34 @@
-include $(top_srcdir)/build/Makefile.decl
-
-SUBDIRS = . tests
-
-COMMON = $(top_srcdir)/common
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(COMMON) \
- -DSRCDIR=\"$(srcdir)\" \
- -DBINDIR=\"$(bindir)\" \
- -DPRIVATEDIR=\"$(privatedir)\" \
- -DP11_KIT_FUTURE_UNSTABLE_API \
- $(NULL)
-
-incdir = $(includedir)/p11-kit-1/p11-kit
-
-inc_HEADERS = \
- deprecated.h \
- iter.h \
- p11-kit.h \
- pin.h \
- remote.h \
- uri.h \
+inc_HEADERS += \
+ p11-kit/deprecated.h \
+ p11-kit/iter.h \
+ p11-kit/p11-kit.h \
+ p11-kit/pin.h \
+ p11-kit/remote.h \
+ p11-kit/uri.h \
$(NULL)
MODULE_SRCS = \
- util.c \
- conf.c conf.h \
- iter.c \
- log.c log.h \
- modules.c modules.h \
- pkcs11.h \
- pin.c \
- pkcs11.h \
- proxy.c proxy.h \
- private.h \
- messages.c \
- remote.c \
- rpc-transport.c rpc.h \
- rpc-message.c rpc-message.h \
- rpc-client.c rpc-server.c \
- uri.c \
- virtual.c virtual.h \
+ p11-kit/util.c \
+ p11-kit/conf.c p11-kit/conf.h \
+ p11-kit/iter.c \
+ p11-kit/log.c p11-kit/log.h \
+ p11-kit/modules.c p11-kit/modules.h \
+ p11-kit/pkcs11.h \
+ p11-kit/pin.c \
+ p11-kit/pkcs11.h \
+ p11-kit/private.h \
+ p11-kit/proxy.c p11-kit/proxy.h \
+ p11-kit/messages.c \
+ p11-kit/remote.c \
+ p11-kit/rpc-transport.c p11-kit/rpc.h \
+ p11-kit/rpc-message.c p11-kit/rpc-message.h \
+ p11-kit/rpc-client.c p11-kit/rpc-server.c \
+ p11-kit/uri.c \
+ p11-kit/virtual.c p11-kit/virtual.h \
$(inc_HEADERS)
-lib_LTLIBRARIES = \
+lib_LTLIBRARIES += \
libp11-kit.la
libp11_kit_la_CFLAGS = \
@@ -66,13 +49,13 @@ libp11_kit_la_LDFLAGS = \
libp11_kit_la_SOURCES = $(MODULE_SRCS)
libp11_kit_la_LIBADD = \
- $(top_builddir)/common/libp11-common.la \
- $(top_builddir)/common/libp11-library.la \
+ libp11-common.la \
+ libp11-library.la \
$(LIBFFI_LIBS) \
$(LTLIBINTL) \
$(NULL)
-noinst_LTLIBRARIES = \
+noinst_LTLIBRARIES += \
libp11-kit-testable.la
libp11_kit_testable_la_LDFLAGS = -no-undefined
@@ -82,24 +65,24 @@ libp11_kit_testable_la_LIBADD = $(libp11_kit_la_LIBADD)
if OS_WIN32
libp11_kit_testable_la_CFLAGS = \
- -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \
- -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules/win32"\" \
- -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules/win32"\" \
- -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \
- -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules/win32"\" \
- -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \
+ -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/fixtures/system-pkcs11.conf"\" \
+ -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/fixtures/system-modules/win32"\" \
+ -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/fixtures/package-modules/win32"\" \
+ -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/fixtures/user-pkcs11.conf"\" \
+ -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/fixtures/user-modules/win32"\" \
+ -DP11_MODULE_PATH=\""$(abs_top_builddir)/.libs"\" \
$(LIBFFI_CFLAGS) \
$(NULL)
else
libp11_kit_testable_la_CFLAGS = \
- -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \
- -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules"\" \
- -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules"\" \
- -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \
- -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules"\" \
- -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \
+ -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/fixtures/system-pkcs11.conf"\" \
+ -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/fixtures/system-modules"\" \
+ -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/fixtures/package-modules"\" \
+ -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/fixtures/user-pkcs11.conf"\" \
+ -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/fixtures/user-modules"\" \
+ -DP11_MODULE_PATH=\""$(abs_top_builddir)/.libs"\" \
$(LIBFFI_CFLAGS) \
$(NULL)
@@ -111,31 +94,144 @@ install-exec-hook:
endif
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = p11-kit-1.pc
+pkgconfig_DATA = p11-kit/p11-kit-1.pc
exampledir = $(p11_system_config)
-example_DATA = pkcs11.conf.example
+example_DATA = p11-kit/pkcs11.conf.example
-EXTRA_DIST = \
- p11-kit-1.pc.in \
- pkcs11.conf.example.in \
- docs.h \
+EXTRA_DIST += \
+ p11-kit/p11-kit-1.pc.in \
+ p11-kit/pkcs11.conf.example.in \
+ p11-kit/docs.h \
$(NULL)
-bin_PROGRAMS = \
- p11-kit
-
-p11_kit_SOURCES = \
- lists.c \
- p11-kit.c \
- $(NULL)
+bin_PROGRAMS += p11-kit/p11-kit
-p11_kit_CFLAGS = \
+p11_kit_p11_kit_SOURCES = \
+ p11-kit/lists.c \
+ p11-kit/p11-kit.c \
$(NULL)
-p11_kit_LDADD = \
+p11_kit_p11_kit_LDADD = \
libp11-kit.la \
- $(top_builddir)/common/libp11-tool.la \
- $(top_builddir)/common/libp11-common.la \
+ libp11-tool.la \
+ libp11-common.la \
$(LTLIBINTL) \
$(NULL)
+
+# Tests ----------------------------------------------------------------
+
+p11_kit_LIBS = \
+ libp11-kit-testable.la \
+ libp11-test.la \
+ libp11-common.la \
+ $(LTLIBINTL)
+
+CHECK_PROGS += \
+ test-progname \
+ test-util \
+ test-conf \
+ test-uri \
+ test-pin \
+ test-init \
+ test-modules \
+ test-deprecated \
+ test-proxy \
+ test-iter \
+ test-rpc \
+ $(NULL)
+
+test_conf_SOURCES = p11-kit/test-conf.c
+test_conf_LDADD = $(p11_kit_LIBS)
+
+test_deprecated_SOURCES = p11-kit/test-deprecated.c
+test_deprecated_LDADD = $(p11_kit_LIBS)
+
+test_init_SOURCES = p11-kit/test-init.c
+test_init_LDADD = $(p11_kit_LIBS)
+
+test_iter_SOURCES = p11-kit/test-iter.c
+test_iter_LDADD = $(p11_kit_LIBS)
+
+test_modules_SOURCES = p11-kit/test-modules.c
+test_modules_LDADD = $(p11_kit_LIBS)
+
+test_pin_SOURCES = p11-kit/test-pin.c
+test_pin_LDADD = $(p11_kit_LIBS)
+
+test_progname_SOURCES = p11-kit/test-progname.c
+test_progname_LDADD = $(p11_kit_LIBS)
+
+test_proxy_SOURCES = p11-kit/test-proxy.c
+test_proxy_LDADD = $(p11_kit_LIBS)
+
+test_rpc_SOURCES = p11-kit/test-rpc.c
+test_rpc_LDADD = $(p11_kit_LIBS)
+
+test_uri_SOURCES = p11-kit/test-uri.c
+test_uri_LDADD = $(p11_kit_LIBS)
+
+test_util_SOURCES = p11-kit/test-util.c
+test_util_LDADD = $(p11_kit_LIBS)
+
+noinst_PROGRAMS += \
+ print-messages \
+ frob-setuid
+
+print_messages_SOURCES = p11-kit/print-messages.c
+print_messages_LDADD = $(p11_kit_LIBS)
+
+frob_setuid_SOURCES = p11-kit/frob-setuid.c
+frob_setuid_LDADD = $(p11_kit_LIBS)
+
+if WITH_FFI
+
+CHECK_PROGS += \
+ test-virtual \
+ test-managed \
+ test-log \
+ test-transport \
+ $(NULL)
+
+test_log_SOURCES = p11-kit/test-log.c
+test_log_LDADD = $(p11_kit_LIBS)
+
+test_managed_SOURCES = p11-kit/test-managed.c
+test_managed_LDADD = $(p11_kit_LIBS)
+
+test_transport_SOURCES = p11-kit/test-transport.c
+test_transport_LDADD = $(p11_kit_LIBS)
+
+test_virtual_SOURCES = p11-kit/test-virtual.c
+test_virtual_LDADD = $(p11_kit_LIBS)
+
+endif
+
+noinst_LTLIBRARIES += \
+ mock-one.la \
+ mock-two.la \
+ mock-three.la \
+ mock-four.la
+
+mock_one_la_SOURCES = p11-kit/mock-module-ep.c
+mock_one_la_LIBADD = libp11-test.la libp11-common.la
+mock_one_la_LDFLAGS = \
+ -module -avoid-version -rpath /nowhere \
+ -no-undefined -export-symbols-regex 'C_GetFunctionList'
+
+mock_two_la_SOURCES = p11-kit/mock-module-ep2.c
+mock_two_la_LDFLAGS = $(mock_one_la_LDFLAGS)
+mock_two_la_LIBADD = $(mock_one_la_LIBADD)
+
+mock_three_la_SOURCES = $(mock_one_la_SOURCES)
+mock_three_la_LDFLAGS = $(mock_one_la_LDFLAGS)
+mock_three_la_LIBADD = $(mock_one_la_LIBADD)
+
+mock_four_la_SOURCES = $(mock_one_la_SOURCES)
+mock_four_la_LDFLAGS = $(mock_one_la_LDFLAGS)
+mock_four_la_LIBADD = $(mock_one_la_LIBADD)
+
+EXTRA_DIST += \
+ p11-kit/fixtures \
+ p11-kit/test-mock.c \
+ $(NULL)
diff --git a/p11-kit/tests/files/package-modules/four.module b/p11-kit/fixtures/package-modules/four.module
index 933af2b..933af2b 100644
--- a/p11-kit/tests/files/package-modules/four.module
+++ b/p11-kit/fixtures/package-modules/four.module
diff --git a/p11-kit/tests/files/package-modules/win32/four.module b/p11-kit/fixtures/package-modules/win32/four.module
index 6dc87c9..6dc87c9 100644
--- a/p11-kit/tests/files/package-modules/win32/four.module
+++ b/p11-kit/fixtures/package-modules/win32/four.module
diff --git a/p11-kit/tests/files/system-modules/one.module b/p11-kit/fixtures/system-modules/one.module
index 5f49a8f..5f49a8f 100644
--- a/p11-kit/tests/files/system-modules/one.module
+++ b/p11-kit/fixtures/system-modules/one.module
diff --git a/p11-kit/tests/files/system-modules/two-duplicate.module b/p11-kit/fixtures/system-modules/two-duplicate.module
index 756af69..756af69 100644
--- a/p11-kit/tests/files/system-modules/two-duplicate.module
+++ b/p11-kit/fixtures/system-modules/two-duplicate.module
diff --git a/p11-kit/tests/files/system-modules/two.badname b/p11-kit/fixtures/system-modules/two.badname
index eec3af0..eec3af0 100644
--- a/p11-kit/tests/files/system-modules/two.badname
+++ b/p11-kit/fixtures/system-modules/two.badname
diff --git a/p11-kit/tests/files/system-modules/win32/one.module b/p11-kit/fixtures/system-modules/win32/one.module
index d153ce5..d153ce5 100644
--- a/p11-kit/tests/files/system-modules/win32/one.module
+++ b/p11-kit/fixtures/system-modules/win32/one.module
diff --git a/p11-kit/tests/files/system-modules/win32/two-duplicate.module b/p11-kit/fixtures/system-modules/win32/two-duplicate.module
index 54ef1cc..54ef1cc 100644
--- a/p11-kit/tests/files/system-modules/win32/two-duplicate.module
+++ b/p11-kit/fixtures/system-modules/win32/two-duplicate.module
diff --git a/p11-kit/tests/files/system-modules/win32/two.badname b/p11-kit/fixtures/system-modules/win32/two.badname
index af63cf9..af63cf9 100644
--- a/p11-kit/tests/files/system-modules/win32/two.badname
+++ b/p11-kit/fixtures/system-modules/win32/two.badname
diff --git a/p11-kit/tests/files/system-pkcs11.conf b/p11-kit/fixtures/system-pkcs11.conf
index a3aa273..a3aa273 100644
--- a/p11-kit/tests/files/system-pkcs11.conf
+++ b/p11-kit/fixtures/system-pkcs11.conf
diff --git a/p11-kit/tests/files/test-1.conf b/p11-kit/fixtures/test-1.conf
index d4ae0a1..d4ae0a1 100644
--- a/p11-kit/tests/files/test-1.conf
+++ b/p11-kit/fixtures/test-1.conf
diff --git a/p11-kit/tests/files/test-pinfile b/p11-kit/fixtures/test-pinfile
index f646f3d..f646f3d 100644
--- a/p11-kit/tests/files/test-pinfile
+++ b/p11-kit/fixtures/test-pinfile
diff --git a/p11-kit/tests/files/test-pinfile-large b/p11-kit/fixtures/test-pinfile-large
index 506668d..506668d 100644
--- a/p11-kit/tests/files/test-pinfile-large
+++ b/p11-kit/fixtures/test-pinfile-large
diff --git a/p11-kit/tests/files/test-system-invalid.conf b/p11-kit/fixtures/test-system-invalid.conf
index 344ee96..344ee96 100644
--- a/p11-kit/tests/files/test-system-invalid.conf
+++ b/p11-kit/fixtures/test-system-invalid.conf
diff --git a/p11-kit/tests/files/test-system-merge.conf b/p11-kit/fixtures/test-system-merge.conf
index 978427d..978427d 100644
--- a/p11-kit/tests/files/test-system-merge.conf
+++ b/p11-kit/fixtures/test-system-merge.conf
diff --git a/p11-kit/tests/files/test-system-none.conf b/p11-kit/fixtures/test-system-none.conf
index 95351e6..95351e6 100644
--- a/p11-kit/tests/files/test-system-none.conf
+++ b/p11-kit/fixtures/test-system-none.conf
diff --git a/p11-kit/tests/files/test-system-only.conf b/p11-kit/fixtures/test-system-only.conf
index 589f1c7..589f1c7 100644
--- a/p11-kit/tests/files/test-system-only.conf
+++ b/p11-kit/fixtures/test-system-only.conf
diff --git a/p11-kit/tests/files/test-user-invalid.conf b/p11-kit/fixtures/test-user-invalid.conf
index 344ee96..344ee96 100644
--- a/p11-kit/tests/files/test-user-invalid.conf
+++ b/p11-kit/fixtures/test-user-invalid.conf
diff --git a/p11-kit/tests/files/test-user-only.conf b/p11-kit/fixtures/test-user-only.conf
index 3224c01..3224c01 100644
--- a/p11-kit/tests/files/test-user-only.conf
+++ b/p11-kit/fixtures/test-user-only.conf
diff --git a/p11-kit/tests/files/test-user.conf b/p11-kit/fixtures/test-user.conf
index 369544a..369544a 100644
--- a/p11-kit/tests/files/test-user.conf
+++ b/p11-kit/fixtures/test-user.conf
diff --git a/p11-kit/tests/files/user-modules/one.module b/p11-kit/fixtures/user-modules/one.module
index 5197daf..5197daf 100644
--- a/p11-kit/tests/files/user-modules/one.module
+++ b/p11-kit/fixtures/user-modules/one.module
diff --git a/p11-kit/tests/files/user-modules/three.module b/p11-kit/fixtures/user-modules/three.module
index 3a2366d..3a2366d 100644
--- a/p11-kit/tests/files/user-modules/three.module
+++ b/p11-kit/fixtures/user-modules/three.module
diff --git a/p11-kit/tests/files/user-modules/win32/one.module b/p11-kit/fixtures/user-modules/win32/one.module
index c371e4a..c371e4a 100644
--- a/p11-kit/tests/files/user-modules/win32/one.module
+++ b/p11-kit/fixtures/user-modules/win32/one.module
diff --git a/p11-kit/tests/files/user-modules/win32/three.module b/p11-kit/fixtures/user-modules/win32/three.module
index 30a3b63..30a3b63 100644
--- a/p11-kit/tests/files/user-modules/win32/three.module
+++ b/p11-kit/fixtures/user-modules/win32/three.module
diff --git a/p11-kit/tests/frob-setuid.c b/p11-kit/frob-setuid.c
index e546ece..e546ece 100644
--- a/p11-kit/tests/frob-setuid.c
+++ b/p11-kit/frob-setuid.c
diff --git a/p11-kit/tests/mock-module-ep.c b/p11-kit/mock-module-ep.c
index 9ba739a..9ba739a 100644
--- a/p11-kit/tests/mock-module-ep.c
+++ b/p11-kit/mock-module-ep.c
diff --git a/p11-kit/tests/mock-module-ep2.c b/p11-kit/mock-module-ep2.c
index ee71711..ee71711 100644
--- a/p11-kit/tests/mock-module-ep2.c
+++ b/p11-kit/mock-module-ep2.c
diff --git a/p11-kit/tests/print-messages.c b/p11-kit/print-messages.c
index 5870ad1..5870ad1 100644
--- a/p11-kit/tests/print-messages.c
+++ b/p11-kit/print-messages.c
diff --git a/p11-kit/tests/test-conf.c b/p11-kit/test-conf.c
index d5dc415..94b8b01 100644
--- a/p11-kit/tests/test-conf.c
+++ b/p11-kit/test-conf.c
@@ -58,7 +58,7 @@ test_parse_conf_1 (void)
p11_dict *map;
const char *value;
- map = _p11_conf_parse_file (SRCDIR "/files/test-1.conf", NULL, 0);
+ map = _p11_conf_parse_file (SRCDIR "/p11-kit/fixtures/test-1.conf", NULL, 0);
assert_ptr_not_null (map);
value = p11_dict_get (map, "key1");
@@ -81,7 +81,7 @@ test_parse_ignore_missing (void)
{
p11_dict *map;
- map = _p11_conf_parse_file (SRCDIR "/files/non-existant.conf", NULL, CONF_IGNORE_MISSING);
+ map = _p11_conf_parse_file (SRCDIR "/p11-kit/fixtures/non-existant.conf", NULL, CONF_IGNORE_MISSING);
assert_ptr_not_null (map);
assert_num_eq (0, p11_dict_size (map));
@@ -94,7 +94,7 @@ test_parse_fail_missing (void)
{
p11_dict *map;
- map = _p11_conf_parse_file (SRCDIR "/files/non-existant.conf", NULL, 0);
+ map = _p11_conf_parse_file (SRCDIR "/p11-kit/fixtures/non-existant.conf", NULL, 0);
assert (map == NULL);
assert_ptr_not_null (p11_message_last ());
}
@@ -134,8 +134,8 @@ test_load_globals_merge (void)
p11_message_clear ();
- config = _p11_conf_load_globals (SRCDIR "/files/test-system-merge.conf",
- SRCDIR "/files/test-user.conf",
+ config = _p11_conf_load_globals (SRCDIR "/p11-kit/fixtures/test-system-merge.conf",
+ SRCDIR "/p11-kit/fixtures/test-user.conf",
&user_mode);
assert_ptr_not_null (config);
assert (NULL == p11_message_last ());
@@ -156,8 +156,8 @@ test_load_globals_no_user (void)
p11_message_clear ();
- config = _p11_conf_load_globals (SRCDIR "/files/test-system-none.conf",
- SRCDIR "/files/test-user.conf",
+ config = _p11_conf_load_globals (SRCDIR "/p11-kit/fixtures/test-system-none.conf",
+ SRCDIR "/p11-kit/fixtures/test-user.conf",
&user_mode);
assert_ptr_not_null (config);
assert (NULL == p11_message_last ());
@@ -178,8 +178,8 @@ test_load_globals_user_sets_only (void)
p11_message_clear ();
- config = _p11_conf_load_globals (SRCDIR "/files/test-system-merge.conf",
- SRCDIR "/files/test-user-only.conf",
+ config = _p11_conf_load_globals (SRCDIR "/p11-kit/fixtures/test-system-merge.conf",
+ SRCDIR "/p11-kit/fixtures/test-user-only.conf",
&user_mode);
assert_ptr_not_null (config);
assert (NULL == p11_message_last ());
@@ -200,8 +200,8 @@ test_load_globals_system_sets_only (void)
p11_message_clear ();
- config = _p11_conf_load_globals (SRCDIR "/files/test-system-only.conf",
- SRCDIR "/files/test-user.conf",
+ config = _p11_conf_load_globals (SRCDIR "/p11-kit/fixtures/test-system-only.conf",
+ SRCDIR "/p11-kit/fixtures/test-user.conf",
&user_mode);
assert_ptr_not_null (config);
assert (NULL == p11_message_last ());
@@ -223,8 +223,8 @@ test_load_globals_system_sets_invalid (void)
p11_message_clear ();
- config = _p11_conf_load_globals (SRCDIR "/files/test-system-invalid.conf",
- SRCDIR "/files/non-existant.conf",
+ config = _p11_conf_load_globals (SRCDIR "/p11-kit/fixtures/test-system-invalid.conf",
+ SRCDIR "/p11-kit/fixtures/non-existant.conf",
&user_mode);
error = errno;
assert_ptr_eq (NULL, config);
@@ -243,8 +243,8 @@ test_load_globals_user_sets_invalid (void)
p11_message_clear ();
- config = _p11_conf_load_globals (SRCDIR "/files/test-system-merge.conf",
- SRCDIR "/files/test-user-invalid.conf",
+ config = _p11_conf_load_globals (SRCDIR "/p11-kit/fixtures/test-system-merge.conf",
+ SRCDIR "/p11-kit/fixtures/test-user-invalid.conf",
&user_mode);
error = errno;
assert_ptr_eq (NULL, config);
@@ -270,9 +270,9 @@ test_load_modules_merge (void)
p11_message_clear ();
configs = _p11_conf_load_modules (CONF_USER_MERGE,
- SRCDIR "/files/package-modules",
- SRCDIR "/files/system-modules",
- SRCDIR "/files/user-modules");
+ SRCDIR "/p11-kit/fixtures/package-modules",
+ SRCDIR "/p11-kit/fixtures/system-modules",
+ SRCDIR "/p11-kit/fixtures/user-modules");
assert_ptr_not_null (configs);
assert (assert_msg_contains (p11_message_last (), "invalid config filename"));
@@ -303,9 +303,9 @@ test_load_modules_user_none (void)
p11_message_clear ();
configs = _p11_conf_load_modules (CONF_USER_NONE,
- SRCDIR "/files/package-modules",
- SRCDIR "/files/system-modules",
- SRCDIR "/files/user-modules");
+ SRCDIR "/p11-kit/fixtures/package-modules",
+ SRCDIR "/p11-kit/fixtures/system-modules",
+ SRCDIR "/p11-kit/fixtures/user-modules");
assert_ptr_not_null (configs);
assert (assert_msg_contains (p11_message_last (), "invalid config filename"));
@@ -334,9 +334,9 @@ test_load_modules_user_only (void)
p11_message_clear ();
configs = _p11_conf_load_modules (CONF_USER_ONLY,
- SRCDIR "/files/package-modules",
- SRCDIR "/files/system-modules",
- SRCDIR "/files/user-modules");
+ SRCDIR "/p11-kit/fixtures/package-modules",
+ SRCDIR "/p11-kit/fixtures/system-modules",
+ SRCDIR "/p11-kit/fixtures/user-modules");
assert_ptr_not_null (configs);
assert_ptr_eq (NULL, (void *)p11_message_last ());
@@ -365,9 +365,9 @@ test_load_modules_no_user (void)
p11_message_clear ();
configs = _p11_conf_load_modules (CONF_USER_MERGE,
- SRCDIR "/files/package-modules",
- SRCDIR "/files/system-modules",
- SRCDIR "/files/non-existant");
+ SRCDIR "/p11-kit/fixtures/package-modules",
+ SRCDIR "/p11-kit/fixtures/system-modules",
+ SRCDIR "/p11-kit/fixtures/non-existant");
assert_ptr_not_null (configs);
assert (assert_msg_contains (p11_message_last (), "invalid config filename"));
diff --git a/p11-kit/tests/test-deprecated.c b/p11-kit/test-deprecated.c
index c8b8001..c8b8001 100644
--- a/p11-kit/tests/test-deprecated.c
+++ b/p11-kit/test-deprecated.c
diff --git a/p11-kit/tests/test-init.c b/p11-kit/test-init.c
index c4fcecb..c4fcecb 100644
--- a/p11-kit/tests/test-init.c
+++ b/p11-kit/test-init.c
diff --git a/p11-kit/tests/test-iter.c b/p11-kit/test-iter.c
index 055a4b3..055a4b3 100644
--- a/p11-kit/tests/test-iter.c
+++ b/p11-kit/test-iter.c
diff --git a/p11-kit/tests/test-log.c b/p11-kit/test-log.c
index e7dab70..e7dab70 100644
--- a/p11-kit/tests/test-log.c
+++ b/p11-kit/test-log.c
diff --git a/p11-kit/tests/test-managed.c b/p11-kit/test-managed.c
index c4ccd9a..c4ccd9a 100644
--- a/p11-kit/tests/test-managed.c
+++ b/p11-kit/test-managed.c
diff --git a/p11-kit/tests/test-mock.c b/p11-kit/test-mock.c
index 8454f1f..8454f1f 100644
--- a/p11-kit/tests/test-mock.c
+++ b/p11-kit/test-mock.c
diff --git a/p11-kit/tests/test-modules.c b/p11-kit/test-modules.c
index f274502..f274502 100644
--- a/p11-kit/tests/test-modules.c
+++ b/p11-kit/test-modules.c
diff --git a/p11-kit/tests/test-pin.c b/p11-kit/test-pin.c
index ebe3efc..27e20c8 100644
--- a/p11-kit/tests/test-pin.c
+++ b/p11-kit/test-pin.c
@@ -234,7 +234,7 @@ test_pin_file (void)
p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback,
NULL, NULL);
- pin = p11_kit_pin_request (SRCDIR "/files/test-pinfile", uri, "The token",
+ pin = p11_kit_pin_request (SRCDIR "/p11-kit/fixtures/test-pinfile", uri, "The token",
P11_KIT_PIN_FLAGS_USER_LOGIN);
assert_ptr_not_null (pin);
@@ -243,7 +243,7 @@ test_pin_file (void)
assert (memcmp (ptr, "yogabbagabba", length) == 0);
p11_kit_pin_unref (pin);
- pin = p11_kit_pin_request (SRCDIR "/files/nonexistant", uri, "The token",
+ pin = p11_kit_pin_request (SRCDIR "/p11-kit/fixtures/nonexistant", uri, "The token",
P11_KIT_PIN_FLAGS_USER_LOGIN);
assert_ptr_eq (NULL, pin);
@@ -266,7 +266,7 @@ test_pin_file_large (void)
p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback,
NULL, NULL);
- pin = p11_kit_pin_request (SRCDIR "/files/test-pinfile-large", uri, "The token",
+ pin = p11_kit_pin_request (SRCDIR "/p11-kit/fixtures/test-pinfile-large", uri, "The token",
P11_KIT_PIN_FLAGS_USER_LOGIN);
error = errno;
diff --git a/p11-kit/tests/test-progname.c b/p11-kit/test-progname.c
index 76b136d..76b136d 100644
--- a/p11-kit/tests/test-progname.c
+++ b/p11-kit/test-progname.c
diff --git a/p11-kit/tests/test-proxy.c b/p11-kit/test-proxy.c
index bf5007d..bf5007d 100644
--- a/p11-kit/tests/test-proxy.c
+++ b/p11-kit/test-proxy.c
diff --git a/p11-kit/tests/test-rpc.c b/p11-kit/test-rpc.c
index 0ce2c55..0ce2c55 100644
--- a/p11-kit/tests/test-rpc.c
+++ b/p11-kit/test-rpc.c
diff --git a/p11-kit/tests/test-transport.c b/p11-kit/test-transport.c
index 4656d34..c302230 100644
--- a/p11-kit/tests/test-transport.c
+++ b/p11-kit/test-transport.c
@@ -68,7 +68,7 @@ setup_remote (void *unused)
test.user_config = p11_path_build (test.directory, "pkcs11.conf", NULL);
p11_test_file_write (NULL, test.user_config, data, strlen (data));
- data = "remote: |" BUILDDIR "/../p11-kit remote " BUILDDIR "/.libs/mock-two.so\n";
+ data = "remote: |" BUILDDIR "/p11-kit/p11-kit remote " BUILDDIR "/.libs/mock-two.so\n";
p11_test_file_write (test.user_modules, "remote.module", data, strlen (data));
p11_config_user_modules = test.user_modules;
diff --git a/p11-kit/tests/test-uri.c b/p11-kit/test-uri.c
index 9b5b293..9b5b293 100644
--- a/p11-kit/tests/test-uri.c
+++ b/p11-kit/test-uri.c
diff --git a/p11-kit/tests/test-util.c b/p11-kit/test-util.c
index 0e579cd..0e579cd 100644
--- a/p11-kit/tests/test-util.c
+++ b/p11-kit/test-util.c
diff --git a/p11-kit/tests/test-virtual.c b/p11-kit/test-virtual.c
index 73777d3..73777d3 100644
--- a/p11-kit/tests/test-virtual.c
+++ b/p11-kit/test-virtual.c
diff --git a/p11-kit/tests/Makefile.am b/p11-kit/tests/Makefile.am
deleted file mode 100644
index a7049a4..0000000
--- a/p11-kit/tests/Makefile.am
+++ /dev/null
@@ -1,91 +0,0 @@
-
-include $(top_srcdir)/build/Makefile.tests
-
-COMMON = $(top_srcdir)/common
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(srcdir)/.. \
- -I$(COMMON) \
- $(TEST_CFLAGS)
-
-LDADD = \
- $(top_builddir)/p11-kit/libp11-kit-testable.la \
- $(top_builddir)/common/libp11-test.la \
- $(top_builddir)/common/libp11-common.la \
- $(LTLIBINTL)
-
-CHECK_PROGS = \
- test-progname \
- test-util \
- test-conf \
- test-uri \
- test-pin \
- test-init \
- test-modules \
- test-deprecated \
- test-proxy \
- test-iter \
- test-rpc \
- $(NULL)
-
-noinst_PROGRAMS = \
- print-messages \
- frob-setuid \
- $(CHECK_PROGS)
-
-if WITH_FFI
-
-CHECK_PROGS += \
- test-virtual \
- test-managed \
- test-log \
- test-transport \
- $(NULL)
-
-endif
-
-TESTS = $(CHECK_PROGS)
-
-noinst_LTLIBRARIES = \
- mock-one.la \
- mock-two.la \
- mock-three.la \
- mock-four.la
-
-mock_one_la_SOURCES = \
- mock-module-ep.c
-
-mock_one_la_CFLAGS = \
- $(AM_CFLAGS)
-
-mock_one_la_LIBADD = \
- $(top_builddir)/common/libp11-test.la \
- $(top_builddir)/common/libp11-common.la \
- $(NULL)
-
-mock_one_la_LDFLAGS = \
- -module -avoid-version -rpath /nowhere \
- -no-undefined -export-symbols-regex 'C_GetFunctionList'
-
-mock_two_la_SOURCES = \
- mock-module-ep2.c
-
-mock_two_la_CFLAGS = $(mock_one_la_CFLAGS)
-mock_two_la_LDFLAGS = $(mock_one_la_LDFLAGS)
-mock_two_la_LIBADD = $(mock_one_la_LIBADD)
-
-mock_three_la_SOURCES = $(mock_one_la_SOURCES)
-mock_three_la_CFLAGS = $(mock_one_la_CFLAGS)
-mock_three_la_LDFLAGS = $(mock_one_la_LDFLAGS)
-mock_three_la_LIBADD = $(mock_one_la_LIBADD)
-
-mock_four_la_SOURCES = $(mock_one_la_SOURCES)
-mock_four_la_CFLAGS = $(mock_one_la_CFLAGS)
-mock_four_la_LDFLAGS = $(mock_one_la_LDFLAGS)
-mock_four_la_LIBADD = $(mock_one_la_LIBADD)
-
-EXTRA_DIST = \
- files \
- test-mock.c \
- $(NULL)
diff --git a/trust/Makefile.am b/trust/Makefile.am
index d6d291f..322f812 100644
--- a/trust/Makefile.am
+++ b/trust/Makefile.am
@@ -1,50 +1,35 @@
-include $(top_srcdir)/build/Makefile.decl
-
-SUBDIRS = . tests
-
-COMMON = $(top_srcdir)/common
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/common \
- -DDATADIR=\"$(datadir)\" \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DPRIVATEDIR=\"$(privatedir)\" \
- $(LIBTASN1_CFLAGS) \
- $(NULL)
-
-noinst_LTLIBRARIES = \
+noinst_LTLIBRARIES += \
libtrust-testable.la \
libtrust-data.la
libtrust_data_la_SOURCES = \
- asn1.c asn1.h \
- basic.asn basic.asn.h \
- base64.c base64.h \
- pem.c pem.h \
- pkix.asn pkix.asn.h \
- oid.c oid.h \
- openssl.asn openssl.asn.h \
- utf8.c utf8.h \
- x509.c x509.h \
+ trust/asn1.c trust/asn1.h \
+ trust/basic.asn trust/basic.asn.h \
+ trust/base64.c trust/base64.h \
+ trust/pem.c trust/pem.h \
+ trust/pkix.asn trust/pkix.asn.h \
+ trust/oid.c trust/oid.h \
+ trust/openssl.asn trust/openssl.asn.h \
+ trust/utf8.c trust/utf8.h \
+ trust/x509.c trust/x509.h \
$(NULL)
-MODULE_SRCS = \
- builder.c builder.h \
- digest.c digest.h \
- index.c index.h \
- parser.c parser.h \
- persist.c persist.h \
- module.c module.h \
- save.c save.h \
- session.c session.h \
- token.c token.h \
- types.h \
+TRUST_SRCS = \
+ trust/builder.c trust/builder.h \
+ trust/digest.c trust/digest.h \
+ trust/index.c trust/index.h \
+ trust/parser.c trust/parser.h \
+ trust/persist.c trust/persist.h \
+ trust/module.c trust/module.h \
+ trust/save.c trust/save.h \
+ trust/session.c trust/session.h \
+ trust/token.c trust/token.h \
+ trust/types.h \
$(NULL)
configdir = $(p11_package_config_modules)
-config_DATA = p11-kit-trust.module
+config_DATA = trust/p11-kit-trust.module
moduledir = $(p11_module_path)
module_LTLIBRARIES = \
@@ -55,8 +40,8 @@ p11_kit_trust_la_CFLAGS = \
p11_kit_trust_la_LIBADD = \
libtrust-data.la \
- $(top_builddir)/common/libp11-library.la \
- $(top_builddir)/common/libp11-common.la \
+ libp11-library.la \
+ libp11-common.la \
$(LIBTASN1_LIBS) \
$(HASH_LIBS) \
$(NULL)
@@ -67,57 +52,205 @@ p11_kit_trust_la_LDFLAGS = \
-export-symbols-regex 'C_GetFunctionList' \
$(NULL)
-p11_kit_trust_la_SOURCES = $(MODULE_SRCS)
+p11_kit_trust_la_SOURCES = $(TRUST_SRCS)
libtrust_testable_la_LDFLAGS = \
-no-undefined
-libtrust_testable_la_SOURCES = $(MODULE_SRCS)
+libtrust_testable_la_SOURCES = $(TRUST_SRCS)
-bin_PROGRAMS = \
- trust
+bin_PROGRAMS += trust/trust
-trust_LDADD = \
+trust_trust_LDADD = \
libtrust-data.la \
- $(top_builddir)/p11-kit/libp11-kit.la \
- $(top_builddir)/common/libp11-common.la \
- $(top_builddir)/common/libp11-tool.la \
+ libp11-kit.la \
+ libp11-common.la \
+ libp11-tool.la \
$(LTLIBINTL) \
$(LIBTASN1_LIBS) \
$(HASH_LIBS) \
$(NULL)
-trust_CFLAGS = \
- -I$(top_srcdir)/p11-kit \
+trust_trust_CFLAGS = \
-DP11_KIT_FUTURE_UNSTABLE_API \
$(LIBTASN1_CFLAGS) \
$(NULL)
-trust_SOURCES = \
- anchor.c anchor.h \
- parser.c parser.h \
- persist.c persist.h \
- digest.c digest.h \
- enumerate.c enumerate.h \
- extract.c extract.h \
- extract-jks.c \
- extract-openssl.c \
- extract-pem.c \
- extract-cer.c \
- list.c list.h \
- openssl.asn openssl.asn.h \
- save.c save.h \
- trust.c \
+trust_trust_SOURCES = \
+ trust/anchor.c trust/anchor.h \
+ trust/parser.c trust/parser.h \
+ trust/persist.c trust/persist.h \
+ trust/digest.c trust/digest.h \
+ trust/enumerate.c trust/enumerate.h \
+ trust/extract.c trust/extract.h \
+ trust/extract-jks.c \
+ trust/extract-openssl.c \
+ trust/extract-pem.c \
+ trust/extract-cer.c \
+ trust/list.c trust/list.h \
+ trust/openssl.asn trust/openssl.asn.h \
+ trust/save.c trust/save.h \
+ trust/trust.c \
$(NULL)
externaldir = $(privatedir)
external_SCRIPTS = \
- trust-extract-compat
+ trust/trust-extract-compat
-EXTRA_DIST = \
- p11-kit-trust.module
+EXTRA_DIST += \
+ trust/p11-kit-trust.module
asn:
- asn1Parser -o pkix.asn.h pkix.asn
- asn1Parser -o openssl.asn.h openssl.asn
- asn1Parser -o basic.asn.h basic.asn
+ asn1Parser -o $(srcdir)/trust/pkix.asn.h $(srcdir)/trust/pkix.asn
+ asn1Parser -o $(srcdir)/trust/openssl.asn.h $(srcdir)/trust/openssl.asn
+ asn1Parser -o $(srcdir)/trust/basic.asn.h $(srcdir)/trust/basic.asn
+
+# Tests ----------------------------------------------------------------
+
+trust_LIBS = \
+ libtrust-testable.la \
+ libtrust-data.la \
+ libtrust-test.la \
+ libp11-kit.la \
+ libp11-library.la \
+ libp11-test.la \
+ libp11-common.la \
+ $(LIBTASN1_LIBS) \
+ $(HASH_LIBS) \
+ $(NULL)
+
+noinst_LTLIBRARIES += \
+ libtrust-test.la
+
+libtrust_test_la_SOURCES = \
+ trust/test-trust.c trust/test-trust.h \
+ trust/digest.c \
+ $(NULL)
+
+CHECK_PROGS += \
+ test-digest \
+ test-asn1 \
+ test-base64 \
+ test-pem \
+ test-oid \
+ test-utf8 \
+ test-x509 \
+ test-persist \
+ test-index \
+ test-parser \
+ test-builder \
+ test-token \
+ test-module \
+ test-save \
+ test-enumerate \
+ test-cer \
+ test-bundle \
+ test-openssl \
+ $(NULL)
+
+test_asn1_SOURCES = trust/test-asn1.c
+test_asn1_LDADD = $(trust_LIBS)
+
+test_base64_SOURCES = trust/test-base64.c
+test_base64_LDADD = $(trust_LIBS)
+
+test_builder_SOURCES = trust/test-builder.c
+test_builder_LDADD = $(trust_LIBS)
+
+test_bundle_SOURCES = trust/test-bundle.c
+test_bundle_LDADD = $(trust_LIBS)
+
+test_cer_SOURCES = trust/test-cer.c
+test_cer_LDADD = $(trust_LIBS)
+
+test_digest_SOURCES = trust/test-digest.c
+test_digest_LDADD = $(trust_LIBS)
+
+test_enumerate_SOURCES = trust/test-enumerate.c
+test_enumerate_LDADD = $(trust_LIBS)
+
+test_index_SOURCES = trust/test-index.c
+test_index_LDADD = $(trust_LIBS)
+
+test_module_SOURCES = trust/test-module.c
+test_module_LDADD = $(trust_LIBS)
+
+test_oid_SOURCES = trust/test-oid.c
+test_oid_LDADD = $(trust_LIBS)
+
+test_openssl_SOURCES = trust/test-openssl.c
+test_openssl_LDADD = $(trust_LIBS)
+
+test_parser_SOURCES = trust/test-parser.c
+test_parser_LDADD = $(trust_LIBS)
+
+test_pem_SOURCES = trust/test-pem.c
+test_pem_LDADD = $(trust_LIBS)
+
+test_persist_SOURCES = trust/test-persist.c
+test_persist_LDADD = $(trust_LIBS)
+
+test_save_SOURCES = trust/test-save.c
+test_save_LDADD = $(trust_LIBS)
+
+test_token_SOURCES = trust/test-token.c
+test_token_LDADD = $(trust_LIBS)
+
+test_utf8_SOURCES = trust/test-utf8.c
+test_utf8_LDADD = $(trust_LIBS)
+
+test_x509_SOURCES = trust/test-x509.c
+test_x509_LDADD = $(trust_LIBS)
+
+noinst_PROGRAMS += \
+ frob-pow \
+ frob-token \
+ frob-nss-trust \
+ frob-cert \
+ frob-bc \
+ frob-ku \
+ frob-eku \
+ frob-ext \
+ frob-oid \
+ $(NULL)
+
+frob_bc_SOURCES = trust/frob-bc.c
+frob_bc_LDADD = $(trust_LIBS)
+
+frob_cert_SOURCES = trust/frob-cert.c
+frob_cert_LDADD = $(trust_LIBS)
+
+frob_eku_SOURCES = trust/frob-eku.c
+frob_eku_LDADD = $(trust_LIBS)
+
+frob_ext_SOURCES = trust/frob-ext.c
+frob_ext_LDADD = $(trust_LIBS)
+
+frob_ku_SOURCES = trust/frob-ku.c
+frob_ku_LDADD = $(trust_LIBS)
+
+frob_nss_trust_SOURCES = trust/frob-nss-trust.c
+frob_nss_trust_LDADD = \
+ libp11-common.la \
+ libp11-kit.la \
+ $(HASH_LIBS) \
+ $(NULL)
+
+frob_oid_SOURCES = trust/frob-oid.c
+frob_oid_LDADD = $(trust_LIBS)
+
+frob_pow_SOURCES = trust/frob-pow.c
+frob_pow_LDADD = $(trust_LIBS)
+
+frob_token_SOURCES = trust/frob-token.c
+frob_token_LDADD = $(trust_LIBS)
+
+noinst_SCRIPTS += trust/test-extract
+
+installcheck-local:
+ sh $(builddir)/trust/test-extract
+
+EXTRA_DIST += \
+ trust/input \
+ trust/fixtures \
+ $(NULL)
diff --git a/trust/anchor.c b/trust/anchor.c
index cdc6486..baa1aeb 100644
--- a/trust/anchor.c
+++ b/trust/anchor.c
@@ -41,12 +41,13 @@
#include "debug.h"
#include "constants.h"
#include "extract.h"
-#include "iter.h"
#include "message.h"
#include "parser.h"
-#include "p11-kit.h"
#include "tool.h"
+#include "p11-kit/iter.h"
+#include "p11-kit/p11-kit.h"
+
#include <assert.h>
#include <getopt.h>
#include <stdio.h>
diff --git a/trust/enumerate.h b/trust/enumerate.h
index d49bf16..8a18b06 100644
--- a/trust/enumerate.h
+++ b/trust/enumerate.h
@@ -40,8 +40,9 @@
#include "array.h"
#include "asn1.h"
#include "dict.h"
-#include "iter.h"
-#include "pkcs11.h"
+
+#include "p11-kit/iter.h"
+#include "p11-kit/pkcs11.h"
enum {
/* These overlap with the flags in save.h, so start higher */
diff --git a/trust/extract.c b/trust/extract.c
index 1bc406c..a008270 100644
--- a/trust/extract.c
+++ b/trust/extract.c
@@ -38,15 +38,16 @@
#include "compat.h"
#include "debug.h"
#include "extract.h"
-#include "iter.h"
#include "message.h"
#include "oid.h"
#include "path.h"
-#include "pkcs11.h"
#include "pkcs11x.h"
#include "save.h"
#include "tool.h"
+#include "p11-kit/iter.h"
+#include "p11-kit/pkcs11.h"
+
#include <assert.h>
#include <ctype.h>
#include <errno.h>
diff --git a/trust/tests/files/cacert-ca.der b/trust/fixtures/cacert-ca.der
index 719b0ff..719b0ff 100644
--- a/trust/tests/files/cacert-ca.der
+++ b/trust/fixtures/cacert-ca.der
Binary files differ
diff --git a/trust/tests/files/cacert3-distrust-all.pem b/trust/fixtures/cacert3-distrust-all.pem
index ce5d887..ce5d887 100644
--- a/trust/tests/files/cacert3-distrust-all.pem
+++ b/trust/fixtures/cacert3-distrust-all.pem
diff --git a/trust/tests/files/cacert3-distrusted-all.pem b/trust/fixtures/cacert3-distrusted-all.pem
index 4a04a39..4a04a39 100644
--- a/trust/tests/files/cacert3-distrusted-all.pem
+++ b/trust/fixtures/cacert3-distrusted-all.pem
diff --git a/trust/tests/files/cacert3-not-trusted.pem b/trust/fixtures/cacert3-not-trusted.pem
index eaa2e54..eaa2e54 100644
--- a/trust/tests/files/cacert3-not-trusted.pem
+++ b/trust/fixtures/cacert3-not-trusted.pem
diff --git a/trust/tests/files/cacert3-trusted-alias.pem b/trust/fixtures/cacert3-trusted-alias.pem
index 44601ea..44601ea 100644
--- a/trust/tests/files/cacert3-trusted-alias.pem
+++ b/trust/fixtures/cacert3-trusted-alias.pem
diff --git a/trust/tests/files/cacert3-trusted-keyid.pem b/trust/fixtures/cacert3-trusted-keyid.pem
index e652733..e652733 100644
--- a/trust/tests/files/cacert3-trusted-keyid.pem
+++ b/trust/fixtures/cacert3-trusted-keyid.pem
diff --git a/trust/tests/files/cacert3-trusted-server-alias.pem b/trust/fixtures/cacert3-trusted-server-alias.pem
index 55593ec..55593ec 100644
--- a/trust/tests/files/cacert3-trusted-server-alias.pem
+++ b/trust/fixtures/cacert3-trusted-server-alias.pem
diff --git a/trust/tests/files/cacert3-trusted.pem b/trust/fixtures/cacert3-trusted.pem
index 55593ec..55593ec 100644
--- a/trust/tests/files/cacert3-trusted.pem
+++ b/trust/fixtures/cacert3-trusted.pem
diff --git a/trust/tests/files/cacert3-twice.pem b/trust/fixtures/cacert3-twice.pem
index c73202d..c73202d 100644
--- a/trust/tests/files/cacert3-twice.pem
+++ b/trust/fixtures/cacert3-twice.pem
diff --git a/trust/tests/files/cacert3.der b/trust/fixtures/cacert3.der
index 56f8c88..56f8c88 100644
--- a/trust/tests/files/cacert3.der
+++ b/trust/fixtures/cacert3.der
Binary files differ
diff --git a/trust/tests/files/cacert3.pem b/trust/fixtures/cacert3.pem
index 087ca0e..087ca0e 100644
--- a/trust/tests/files/cacert3.pem
+++ b/trust/fixtures/cacert3.pem
diff --git a/trust/tests/files/distrusted.pem b/trust/fixtures/distrusted.pem
index 8de6ff0..8de6ff0 100644
--- a/trust/tests/files/distrusted.pem
+++ b/trust/fixtures/distrusted.pem
diff --git a/trust/tests/files/empty-file b/trust/fixtures/empty-file
index e69de29..e69de29 100644
--- a/trust/tests/files/empty-file
+++ b/trust/fixtures/empty-file
diff --git a/trust/tests/files/multiple.pem b/trust/fixtures/multiple.pem
index d3e1775..d3e1775 100644
--- a/trust/tests/files/multiple.pem
+++ b/trust/fixtures/multiple.pem
diff --git a/trust/tests/files/openssl-trust-no-trust.pem b/trust/fixtures/openssl-trust-no-trust.pem
index 07e3917..07e3917 100644
--- a/trust/tests/files/openssl-trust-no-trust.pem
+++ b/trust/fixtures/openssl-trust-no-trust.pem
diff --git a/trust/tests/files/redhat-ca.der b/trust/fixtures/redhat-ca.der
index affae24..affae24 100644
--- a/trust/tests/files/redhat-ca.der
+++ b/trust/fixtures/redhat-ca.der
Binary files differ
diff --git a/trust/tests/files/self-signed-with-eku.der b/trust/fixtures/self-signed-with-eku.der
index 33e0760..33e0760 100644
--- a/trust/tests/files/self-signed-with-eku.der
+++ b/trust/fixtures/self-signed-with-eku.der
Binary files differ
diff --git a/trust/tests/files/self-signed-with-ku.der b/trust/fixtures/self-signed-with-ku.der
index 51bb227..51bb227 100644
--- a/trust/tests/files/self-signed-with-ku.der
+++ b/trust/fixtures/self-signed-with-ku.der
Binary files differ
diff --git a/trust/tests/files/simple-string b/trust/fixtures/simple-string
index be13474..be13474 100644
--- a/trust/tests/files/simple-string
+++ b/trust/fixtures/simple-string
diff --git a/trust/tests/files/testing-server.der b/trust/fixtures/testing-server.der
index cf2de65..cf2de65 100644
--- a/trust/tests/files/testing-server.der
+++ b/trust/fixtures/testing-server.der
Binary files differ
diff --git a/trust/tests/files/thawte.pem b/trust/fixtures/thawte.pem
index 34af29e..34af29e 100644
--- a/trust/tests/files/thawte.pem
+++ b/trust/fixtures/thawte.pem
diff --git a/trust/tests/files/unrecognized-file.txt b/trust/fixtures/unrecognized-file.txt
index 4d5bac3..4d5bac3 100644
--- a/trust/tests/files/unrecognized-file.txt
+++ b/trust/fixtures/unrecognized-file.txt
diff --git a/trust/tests/files/verisign-v1.der b/trust/fixtures/verisign-v1.der
index bcd5ebb..bcd5ebb 100644
--- a/trust/tests/files/verisign-v1.der
+++ b/trust/fixtures/verisign-v1.der
Binary files differ
diff --git a/trust/tests/files/verisign-v1.pem b/trust/fixtures/verisign-v1.pem
index ace4da5..ace4da5 100644
--- a/trust/tests/files/verisign-v1.pem
+++ b/trust/fixtures/verisign-v1.pem
diff --git a/trust/tests/frob-bc.c b/trust/frob-bc.c
index 41fbc58..41fbc58 100644
--- a/trust/tests/frob-bc.c
+++ b/trust/frob-bc.c
diff --git a/trust/tests/frob-cert.c b/trust/frob-cert.c
index c1bc45c..c1bc45c 100644
--- a/trust/tests/frob-cert.c
+++ b/trust/frob-cert.c
diff --git a/trust/tests/frob-eku.c b/trust/frob-eku.c
index f467b36..f467b36 100644
--- a/trust/tests/frob-eku.c
+++ b/trust/frob-eku.c
diff --git a/trust/tests/frob-ext.c b/trust/frob-ext.c
index 2017205..2017205 100644
--- a/trust/tests/frob-ext.c
+++ b/trust/frob-ext.c
diff --git a/trust/tests/frob-ku.c b/trust/frob-ku.c
index 99ac217..99ac217 100644
--- a/trust/tests/frob-ku.c
+++ b/trust/frob-ku.c
diff --git a/trust/tests/frob-multi-init.c b/trust/frob-multi-init.c
index d966540..d966540 100644
--- a/trust/tests/frob-multi-init.c
+++ b/trust/frob-multi-init.c
diff --git a/trust/tests/frob-nss-trust.c b/trust/frob-nss-trust.c
index fd69573..fd69573 100644
--- a/trust/tests/frob-nss-trust.c
+++ b/trust/frob-nss-trust.c
diff --git a/trust/tests/frob-oid.c b/trust/frob-oid.c
index 5a2499a..5a2499a 100644
--- a/trust/tests/frob-oid.c
+++ b/trust/frob-oid.c
diff --git a/trust/tests/frob-pow.c b/trust/frob-pow.c
index f029b2a..f029b2a 100644
--- a/trust/tests/frob-pow.c
+++ b/trust/frob-pow.c
diff --git a/trust/tests/frob-token.c b/trust/frob-token.c
index 5d57ec1..5d57ec1 100644
--- a/trust/tests/frob-token.c
+++ b/trust/frob-token.c
diff --git a/trust/tests/input/anchors/cacert3.der b/trust/input/anchors/cacert3.der
index 56f8c88..56f8c88 100644
--- a/trust/tests/input/anchors/cacert3.der
+++ b/trust/input/anchors/cacert3.der
Binary files differ
diff --git a/trust/tests/input/anchors/testing-ca.der b/trust/input/anchors/testing-ca.der
index d3f70ea..d3f70ea 100644
--- a/trust/tests/input/anchors/testing-ca.der
+++ b/trust/input/anchors/testing-ca.der
Binary files differ
diff --git a/trust/tests/input/blacklist/self-server.der b/trust/input/blacklist/self-server.der
index 68fe9af..68fe9af 100644
--- a/trust/tests/input/blacklist/self-server.der
+++ b/trust/input/blacklist/self-server.der
Binary files differ
diff --git a/trust/tests/input/cacert-ca.der b/trust/input/cacert-ca.der
index 719b0ff..719b0ff 100644
--- a/trust/tests/input/cacert-ca.der
+++ b/trust/input/cacert-ca.der
Binary files differ
diff --git a/trust/tests/input/distrusted.pem b/trust/input/distrusted.pem
index 8de6ff0..8de6ff0 100644
--- a/trust/tests/input/distrusted.pem
+++ b/trust/input/distrusted.pem
diff --git a/trust/tests/input/verisign-v1.p11-kit b/trust/input/verisign-v1.p11-kit
index eaa080d..eaa080d 100644
--- a/trust/tests/input/verisign-v1.p11-kit
+++ b/trust/input/verisign-v1.p11-kit
diff --git a/trust/list.c b/trust/list.c
index 8a172eb..a7fa4d9 100644
--- a/trust/list.c
+++ b/trust/list.c
@@ -40,12 +40,13 @@
#include "constants.h"
#include "debug.h"
#include "enumerate.h"
-#include "iter.h"
#include "list.h"
-#include "pkcs11x.h"
#include "message.h"
+#include "pkcs11x.h"
#include "tool.h"
+#include "p11-kit/iter.h"
+
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/trust/tests/test-asn1.c b/trust/test-asn1.c
index df75dfd..df75dfd 100644
--- a/trust/tests/test-asn1.c
+++ b/trust/test-asn1.c
diff --git a/trust/tests/test-base64.c b/trust/test-base64.c
index ce303e8..ce303e8 100644
--- a/trust/tests/test-base64.c
+++ b/trust/test-base64.c
diff --git a/trust/tests/test-builder.c b/trust/test-builder.c
index 29bac07..29bac07 100644
--- a/trust/tests/test-builder.c
+++ b/trust/test-builder.c
diff --git a/trust/tests/test-bundle.c b/trust/test-bundle.c
index 85c0b5f..a12d8a1 100644
--- a/trust/tests/test-bundle.c
+++ b/trust/test-bundle.c
@@ -128,7 +128,7 @@ test_file (void)
ret = p11_extract_pem_bundle (&test.ex, destination);
assert_num_eq (true, ret);
- test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3.pem");
+ test_check_file (test.directory, "extract.pem", SRCDIR "/trust/fixtures/cacert3.pem");
free (destination);
}
@@ -151,7 +151,7 @@ test_file_multiple (void)
ret = p11_extract_pem_bundle (&test.ex, destination);
assert_num_eq (true, ret);
- test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3-twice.pem");
+ test_check_file (test.directory, "extract.pem", SRCDIR "/trust/fixtures/cacert3-twice.pem");
free (destination);
}
@@ -195,8 +195,8 @@ test_directory (void)
assert_num_eq (true, ret);
test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem", NULL));
- test_check_file (test.directory, "Cacert3_Here.pem", SRCDIR "/files/cacert3.pem");
- test_check_file (test.directory, "Cacert3_Here.1.pem", SRCDIR "/files/cacert3.pem");
+ test_check_file (test.directory, "Cacert3_Here.pem", SRCDIR "/trust/fixtures/cacert3.pem");
+ test_check_file (test.directory, "Cacert3_Here.1.pem", SRCDIR "/trust/fixtures/cacert3.pem");
}
static void
@@ -231,3 +231,7 @@ main (int argc,
p11_test (test_directory_empty, "/pem/test_directory_empty");
return p11_test_run (argc, argv);
}
+
+#include "enumerate.c"
+#include "extract-pem.c"
+#include "save.c"
diff --git a/trust/tests/test-cer.c b/trust/test-cer.c
index ba0b9ca..422b528 100644
--- a/trust/tests/test-cer.c
+++ b/trust/test-cer.c
@@ -128,7 +128,7 @@ test_file (void)
ret = p11_extract_x509_file (&test.ex, destination);
assert_num_eq (true, ret);
- test_check_file (test.directory, "extract.cer", SRCDIR "/files/cacert3.der");
+ test_check_file (test.directory, "extract.cer", SRCDIR "/trust/fixtures/cacert3.der");
free (destination);
}
@@ -157,7 +157,7 @@ test_file_multiple (void)
p11_message_loud ();
- test_check_file (test.directory, "extract.cer", SRCDIR "/files/cacert3.der");
+ test_check_file (test.directory, "extract.cer", SRCDIR "/trust/fixtures/cacert3.der");
free (destination);
}
@@ -205,8 +205,8 @@ test_directory (void)
assert_num_eq (true, ret);
test_check_directory (test.directory, ("Cacert3_Here.cer", "Cacert3_Here.1.cer", NULL));
- test_check_file (test.directory, "Cacert3_Here.cer", SRCDIR "/files/cacert3.der");
- test_check_file (test.directory, "Cacert3_Here.1.cer", SRCDIR "/files/cacert3.der");
+ test_check_file (test.directory, "Cacert3_Here.cer", SRCDIR "/trust/fixtures/cacert3.der");
+ test_check_file (test.directory, "Cacert3_Here.1.cer", SRCDIR "/trust/fixtures/cacert3.der");
}
static void
@@ -241,3 +241,7 @@ main (int argc,
p11_test (test_directory_empty, "/x509/test_directory_empty");
return p11_test_run (argc, argv);
}
+
+#include "enumerate.c"
+#include "extract-cer.c"
+#include "save.c"
diff --git a/trust/tests/test-digest.c b/trust/test-digest.c
index f2cb669..f2cb669 100644
--- a/trust/tests/test-digest.c
+++ b/trust/test-digest.c
diff --git a/trust/tests/test-enumerate.c b/trust/test-enumerate.c
index 75d3f16..e11373f 100644
--- a/trust/tests/test-enumerate.c
+++ b/trust/test-enumerate.c
@@ -534,3 +534,5 @@ main (int argc,
return p11_test_run (argc, argv);
}
+
+#include "enumerate.c"
diff --git a/trust/tests/test-extract.in b/trust/test-extract.in
index 59f6cd6..59f6cd6 100644
--- a/trust/tests/test-extract.in
+++ b/trust/test-extract.in
diff --git a/trust/tests/test-index.c b/trust/test-index.c
index fc861b2..fc861b2 100644
--- a/trust/tests/test-index.c
+++ b/trust/test-index.c
diff --git a/trust/tests/test-module.c b/trust/test-module.c
index c272a88..3eedc1b 100644
--- a/trust/tests/test-module.c
+++ b/trust/test-module.c
@@ -88,9 +88,9 @@ setup (void *unused)
assert (rv == CKR_OK);
memset (&args, 0, sizeof (args));
- paths = SRCDIR "/input" P11_PATH_SEP \
- SRCDIR "/files/self-signed-with-ku.der" P11_PATH_SEP \
- SRCDIR "/files/thawte.pem";
+ paths = SRCDIR "/trust/input" P11_PATH_SEP \
+ SRCDIR "/trust/fixtures/self-signed-with-ku.der" P11_PATH_SEP \
+ SRCDIR "/trust/fixtures/thawte.pem";
if (asprintf (&arguments, "paths='%s'", paths) < 0)
assert (false && "not reached");
args.pReserved = arguments;
@@ -266,9 +266,9 @@ test_get_slot_info (void)
/* These are the paths passed in in setup() */
const char *paths[] = {
- SRCDIR "/input",
- SRCDIR "/files/self-signed-with-ku.der",
- SRCDIR "/files/thawte.pem"
+ SRCDIR "/trust/input",
+ SRCDIR "/trust/fixtures/self-signed-with-ku.der",
+ SRCDIR "/trust/fixtures/thawte.pem"
};
count = NUM_SLOTS;
@@ -314,8 +314,8 @@ test_get_token_info (void)
memset (&args, 0, sizeof (args));
args.pReserved = "paths='" \
- SYSCONFDIR "/input" P11_PATH_SEP \
- DATADIR "/files/blah" P11_PATH_SEP \
+ SYSCONFDIR "/trust/input" P11_PATH_SEP \
+ DATADIR "/trust/fixtures/blah" P11_PATH_SEP \
"/some/other/path/the-basename'";
args.flags = CKF_OS_LOCKING_OK;
diff --git a/trust/tests/test-oid.c b/trust/test-oid.c
index 0635d0a..0635d0a 100644
--- a/trust/tests/test-oid.c
+++ b/trust/test-oid.c
diff --git a/trust/tests/test-openssl.c b/trust/test-openssl.c
index 583ce24..9f7c4d6 100644
--- a/trust/tests/test-openssl.c
+++ b/trust/test-openssl.c
@@ -192,7 +192,7 @@ test_file (void)
assert_num_eq (true, ret);
test_check_file (test.directory, "extract.pem",
- SRCDIR "/files/cacert3-trusted-server-alias.pem");
+ SRCDIR "/trust/fixtures/cacert3-trusted-server-alias.pem");
free (destination);
}
@@ -215,7 +215,7 @@ test_plain (void)
assert_num_eq (true, ret);
test_check_file (test.directory, "extract.pem",
- SRCDIR "/files/cacert3-trusted-alias.pem");
+ SRCDIR "/trust/fixtures/cacert3-trusted-alias.pem");
free (destination);
}
@@ -256,7 +256,7 @@ test_keyid (void)
assert_num_eq (true, ret);
test_check_file (test.directory, "extract.pem",
- SRCDIR "/files/cacert3-trusted-keyid.pem");
+ SRCDIR "/trust/fixtures/cacert3-trusted-keyid.pem");
free (destination);
}
@@ -287,7 +287,7 @@ test_not_authority (void)
assert_num_eq (true, ret);
test_check_file (test.directory, "extract.pem",
- SRCDIR "/files/cacert3-not-trusted.pem");
+ SRCDIR "/trust/fixtures/cacert3-not-trusted.pem");
free (destination);
}
@@ -319,7 +319,7 @@ test_distrust_all (void)
assert_num_eq (true, ret);
test_check_file (test.directory, "extract.pem",
- SRCDIR "/files/cacert3-distrust-all.pem");
+ SRCDIR "/trust/fixtures/cacert3-distrust-all.pem");
free (destination);
}
@@ -347,7 +347,7 @@ test_file_multiple (void)
ret = p11_extract_openssl_bundle (&test.ex, destination);
assert_num_eq (true, ret);
- test_check_file (test.directory, "extract.pem", SRCDIR "/files/multiple.pem");
+ test_check_file (test.directory, "extract.pem", SRCDIR "/trust/fixtures/multiple.pem");
free (destination);
}
@@ -600,9 +600,9 @@ test_directory (void)
#endif
NULL));
test_check_file (test.directory, "Custom_Label.pem",
- SRCDIR "/files/cacert3-trusted-server-alias.pem");
+ SRCDIR "/trust/fixtures/cacert3-trusted-server-alias.pem");
test_check_file (test.directory, "Custom_Label.1.pem",
- SRCDIR "/files/cacert3-trusted-server-alias.pem");
+ SRCDIR "/trust/fixtures/cacert3-trusted-server-alias.pem");
#ifdef OS_UNIX
test_check_symlink (test.directory, "e5662767.0", "Custom_Label.pem");
test_check_symlink (test.directory, "e5662767.1", "Custom_Label.1.pem");
@@ -656,3 +656,7 @@ main (int argc,
return p11_test_run (argc, argv);
}
+
+#include "enumerate.c"
+#include "extract-openssl.c"
+#include "save.c"
diff --git a/trust/tests/test-parser.c b/trust/test-parser.c
index c6cfe9a..bdb67df 100644
--- a/trust/tests/test-parser.c
+++ b/trust/test-parser.c
@@ -118,7 +118,7 @@ test_parse_der_certificate (void)
};
p11_parser_formats (test.parser, p11_parser_format_x509, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/cacert3.der", NULL,
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -146,7 +146,7 @@ test_parse_pem_certificate (void)
};
p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.pem", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/cacert3.pem", NULL,
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -173,7 +173,7 @@ test_parse_p11_kit_persist (void)
};
p11_parser_formats (test.parser, p11_parser_format_persist, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/input/verisign-v1.p11-kit", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/input/verisign-v1.p11-kit", NULL,
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -226,7 +226,7 @@ test_parse_openssl_trusted (void)
int i;
p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3-trusted.pem", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/cacert3-trusted.pem", NULL,
P11_PARSE_FLAG_ANCHOR);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -310,7 +310,7 @@ test_parse_openssl_distrusted (void)
* so we parse this as an anchor, but expect it to be blacklisted
*/
p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/distrusted.pem", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/distrusted.pem", NULL,
P11_PARSE_FLAG_ANCHOR);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -426,7 +426,7 @@ test_openssl_trusted_no_trust (void)
};
p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/openssl-trust-no-trust.pem", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/openssl-trust-no-trust.pem", NULL,
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -454,7 +454,7 @@ test_parse_anchor (void)
int ret;
p11_parser_formats (test.parser, p11_parser_format_x509, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/cacert3.der", NULL,
P11_PARSE_FLAG_ANCHOR);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -484,7 +484,7 @@ test_parse_thawte (void)
};
p11_parser_formats (test.parser, p11_parser_format_pem, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/thawte.pem", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/thawte.pem", NULL,
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
@@ -520,7 +520,7 @@ test_parse_unrecognized (void)
p11_message_quiet ();
p11_parser_formats (test.parser, p11_parser_format_x509, NULL);
- ret = p11_parse_file (test.parser, SRCDIR "/files/unrecognized-file.txt", NULL,
+ ret = p11_parse_file (test.parser, SRCDIR "/trust/fixtures/unrecognized-file.txt", NULL,
P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_UNRECOGNIZED, ret);
@@ -537,7 +537,7 @@ test_parse_no_asn1_cache (void)
assert_ptr_not_null (parser);
p11_parser_formats (parser, p11_parser_format_x509, NULL);
- ret = p11_parse_file (parser, SRCDIR "/files/cacert3.der", NULL, P11_PARSE_FLAG_NONE);
+ ret = p11_parse_file (parser, SRCDIR "/trust/fixtures/cacert3.der", NULL, P11_PARSE_FLAG_NONE);
assert_num_eq (P11_PARSE_SUCCESS, ret);
/* Should have gotten certificate */
diff --git a/trust/tests/test-pem.c b/trust/test-pem.c
index 0c7d60a..0c7d60a 100644
--- a/trust/tests/test-pem.c
+++ b/trust/test-pem.c
diff --git a/trust/tests/test-persist.c b/trust/test-persist.c
index 107f131..107f131 100644
--- a/trust/tests/test-persist.c
+++ b/trust/test-persist.c
diff --git a/trust/tests/test-save.c b/trust/test-save.c
index be16141..1de798d 100644
--- a/trust/tests/test-save.c
+++ b/trust/test-save.c
@@ -110,7 +110,7 @@ test_file_write (void)
assert_num_eq (true, ret);
free (filename);
- test_check_file (test.directory, "extract-file", SRCDIR "/files/cacert3.der");
+ test_check_file (test.directory, "extract-file", SRCDIR "/trust/fixtures/cacert3.der");
}
static void
@@ -176,7 +176,7 @@ test_file_overwrite (void)
assert_num_eq (true, ret);
free (filename);
- test_check_file (test.directory, "extract-file", SRCDIR "/files/cacert3.der");
+ test_check_file (test.directory, "extract-file", SRCDIR "/trust/fixtures/cacert3.der");
}
static void
@@ -198,8 +198,8 @@ test_file_unique (void)
assert_num_eq (true, ret);
free (filename);
- test_check_file (test.directory, "extract-file", SRCDIR "/files/empty-file");
- test_check_file (test.directory, "extract-file.1", SRCDIR "/files/cacert3.der");
+ test_check_file (test.directory, "extract-file", SRCDIR "/trust/fixtures/empty-file");
+ test_check_file (test.directory, "extract-file.1", SRCDIR "/trust/fixtures/cacert3.der");
}
static void
@@ -219,7 +219,7 @@ test_file_auto_empty (void)
assert_num_eq (true, ret);
free (filename);
- test_check_file (test.directory, "extract-file", SRCDIR "/files/empty-file");
+ test_check_file (test.directory, "extract-file", SRCDIR "/trust/fixtures/empty-file");
}
static void
@@ -239,7 +239,7 @@ test_file_auto_length (void)
assert_num_eq (true, ret);
free (filename);
- test_check_file (test.directory, "extract-file", SRCDIR "/files/simple-string");
+ test_check_file (test.directory, "extract-file", SRCDIR "/trust/fixtures/simple-string");
}
static void
@@ -362,7 +362,7 @@ test_directory_files (void)
"link.ext",
#endif
NULL));
- test_check_file (subdir, "blah.cer", SRCDIR "/files/cacert3.der");
+ test_check_file (subdir, "blah.cer", SRCDIR "/trust/fixtures/cacert3.der");
test_check_data (subdir, "file.txt", test_text, strlen (test_text));
#ifdef OS_UNIX
test_check_symlink (subdir, "link.ext", "/the/destination");
diff --git a/trust/tests/test-token.c b/trust/test-token.c
index a24539e..c643f7e 100644
--- a/trust/tests/test-token.c
+++ b/trust/test-token.c
@@ -760,8 +760,8 @@ main (int argc,
char *argv[])
{
p11_fixture (setup, teardown);
- p11_testx (test_token_load, SRCDIR "/input", "/token/load");
- p11_testx (test_token_flags, SRCDIR "/input", "/token/flags");
+ p11_testx (test_token_load, SRCDIR "/trust/input", "/token/load");
+ p11_testx (test_token_flags, SRCDIR "/trust/input", "/token/flags");
p11_testx (test_token_path, "/wheee", "/token/path");
p11_testx (test_token_label, "/wheee", "/token/label");
p11_testx (test_token_slot, "/unneeded", "/token/slot");
diff --git a/trust/tests/test-trust.c b/trust/test-trust.c
index 20306e0..20306e0 100644
--- a/trust/tests/test-trust.c
+++ b/trust/test-trust.c
diff --git a/trust/tests/test-trust.h b/trust/test-trust.h
index b70bbdb..b70bbdb 100644
--- a/trust/tests/test-trust.h
+++ b/trust/test-trust.h
diff --git a/trust/tests/test-utf8.c b/trust/test-utf8.c
index 9b2c3d5..9b2c3d5 100644
--- a/trust/tests/test-utf8.c
+++ b/trust/test-utf8.c
diff --git a/trust/tests/test-x509.c b/trust/test-x509.c
index 9f7d258..9f7d258 100644
--- a/trust/tests/test-x509.c
+++ b/trust/test-x509.c
diff --git a/trust/tests/Makefile.am b/trust/tests/Makefile.am
deleted file mode 100644
index 1f13b2a..0000000
--- a/trust/tests/Makefile.am
+++ /dev/null
@@ -1,122 +0,0 @@
-
-include $(top_srcdir)/build/Makefile.tests
-
-COMMON = $(top_srcdir)/common
-TRUST = $(top_srcdir)/trust
-
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(srcdir)/.. \
- -I$(top_srcdir)/p11-kit \
- -I$(COMMON) \
- -DDATADIR=\"$(datadir)\" \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DP11_KIT_FUTURE_UNSTABLE_API \
- $(LIBTASN1_CFLAGS) \
- $(TEST_CFLAGS) \
- $(NULL)
-
-noinst_LTLIBRARIES = \
- libtrust-test.la
-
-libtrust_test_la_SOURCES = \
- test-trust.c test-trust.h \
- $(TRUST)/digest.c
-
-LDADD = \
- $(top_builddir)/trust/libtrust-testable.la \
- $(top_builddir)/trust/libtrust-data.la \
- $(builddir)/libtrust-test.la \
- $(top_builddir)/p11-kit/libp11-kit.la \
- $(top_builddir)/common/libp11-library.la \
- $(top_builddir)/common/libp11-test.la \
- $(top_builddir)/common/libp11-common.la \
- $(LIBTASN1_LIBS) \
- $(HASH_LIBS) \
- $(NULL)
-
-CHECK_PROGS = \
- test-digest \
- test-asn1 \
- test-base64 \
- test-pem \
- test-oid \
- test-utf8 \
- test-x509 \
- test-persist \
- test-index \
- test-parser \
- test-builder \
- test-token \
- test-module \
- test-save \
- test-enumerate \
- test-cer \
- test-bundle \
- test-openssl \
- $(NULL)
-
-noinst_PROGRAMS = \
- frob-pow \
- frob-token \
- frob-nss-trust \
- frob-cert \
- frob-bc \
- frob-ku \
- frob-eku \
- frob-ext \
- frob-cert \
- frob-oid \
- $(CHECK_PROGS)
-
-frob_nss_trust_LDADD = \
- $(top_builddir)/common/libp11-common.la \
- $(top_builddir)/p11-kit/libp11-kit.la \
- $(HASH_LIBS) \
- $(NULL)
-
-TESTS = $(CHECK_PROGS)
-
-EXTRA_DIST = \
- input \
- files \
- $(NULL)
-
-TEST_RUNNER = libtool --mode=execute
-
-test_save_SOURCES = \
- test-save.c \
- $(TRUST)/save.c \
- $(NULL)
-
-test_enumerate_SOURCES = \
- test-enumerate.c \
- $(TRUST)/enumerate.c \
- $(NULL)
-
-test_cer_SOURCES = \
- test-cer.c \
- $(TRUST)/enumerate.c \
- $(TRUST)/extract-cer.c \
- $(TRUST)/save.c \
- $(NULL)
-
-test_bundle_SOURCES = \
- test-bundle.c \
- $(TRUST)/enumerate.c \
- $(TRUST)/extract-pem.c \
- $(TRUST)/save.c \
- $(NULL)
-
-test_openssl_SOURCES = \
- test-openssl.c \
- $(TRUST)/enumerate.c \
- $(TRUST)/extract-openssl.c \
- $(TRUST)/save.c \
- $(NULL)
-
-noinst_SCRIPTS = \
- test-extract
-
-installcheck-local:
- sh $(builddir)/test-extract