Still use recursive for documentation and translation.
-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
--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 \
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
+++ /dev/null
-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
+++ /dev/null
-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
# 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
-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 \
$(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)
+++ /dev/null
-
-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
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
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:
-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 = \
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
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)
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)
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");
{
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));
{
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 ());
}
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 ());
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 ());
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 ());
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 ());
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);
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);
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"));
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"));
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 ());
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"));
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);
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);
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;
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;
+++ /dev/null
-
-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)
-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 = \
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)
-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)
#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>
#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 */
#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>
#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>
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);
}
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);
}
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
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"
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);
}
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);
}
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
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"
return p11_test_run (argc, argv);
}
+
+#include "enumerate.c"
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;
/* 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;
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;
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
#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");
return p11_test_run (argc, argv);
}
+
+#include "enumerate.c"
+#include "extract-openssl.c"
+#include "save.c"
};
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);
};
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);
};
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);
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);
* 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);
};
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);
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);
};
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);
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);
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 */
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
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
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
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
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
"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");
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");
+++ /dev/null
-
-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