From fcc3a83cc4d540bc2c4096524b5e8003046ba561 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 2 Apr 2013 20:40:53 +0200 Subject: Separate library init from message code Put library init/uninit code its into their own statically linked library so that they don't get linked into the p11-kit executable. Refactor the message code so that the library initialization can plug in its per thread message buffer. https://bugs.freedesktop.org/show_bug.cgi?id=63046 --- trust/Makefile.am | 2 +- trust/builder.c | 2 +- trust/module.c | 1 + trust/parser.c | 2 +- trust/session.c | 2 +- trust/tests/Makefile.am | 5 ++--- trust/tests/test-builder.c | 3 +-- trust/tests/test-index.c | 3 +-- trust/tests/test-module.c | 2 -- trust/tests/test-parser.c | 3 +-- trust/tests/test-persist.c | 3 +-- trust/tests/test-token.c | 3 +-- trust/token.c | 2 +- 13 files changed, 13 insertions(+), 20 deletions(-) (limited to 'trust') diff --git a/trust/Makefile.am b/trust/Makefile.am index 60323a8..264ea7c 100644 --- a/trust/Makefile.am +++ b/trust/Makefile.am @@ -36,7 +36,7 @@ p11_kit_trust_la_CFLAGS = \ p11_kit_trust_la_LIBADD = \ $(top_builddir)/common/libp11-data.la \ $(top_builddir)/common/libp11-library.la \ - $(top_builddir)/common/libp11-compat.la \ + $(top_builddir)/common/libp11-common.la \ $(LIBTASN1_LIBS) \ $(NULL) diff --git a/trust/builder.c b/trust/builder.c index 32f2d1b..e41d73f 100644 --- a/trust/builder.c +++ b/trust/builder.c @@ -44,7 +44,7 @@ #include "debug.h" #include "hash.h" #include "index.h" -#include "library.h" +#include "message.h" #include "oid.h" #include "pkcs11x.h" #include "x509.h" diff --git a/trust/module.c b/trust/module.c index 51a75e0..46ebeb6 100644 --- a/trust/module.c +++ b/trust/module.c @@ -42,6 +42,7 @@ #include "debug.h" #include "dict.h" #include "library.h" +#include "message.h" #include "module.h" #include "parser.h" #include "pkcs11.h" diff --git a/trust/parser.c b/trust/parser.c index 7ea879a..7eb18c9 100644 --- a/trust/parser.c +++ b/trust/parser.c @@ -41,7 +41,7 @@ #include "debug.h" #include "dict.h" #include "hash.h" -#include "library.h" +#include "message.h" #include "module.h" #include "oid.h" #include "parser.h" diff --git a/trust/session.c b/trust/session.c index 2a8c9f9..b04b8bf 100644 --- a/trust/session.c +++ b/trust/session.c @@ -38,7 +38,7 @@ #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "dict.h" -#include "library.h" +#include "message.h" #include "pkcs11.h" #include "module.h" #include "session.h" diff --git a/trust/tests/Makefile.am b/trust/tests/Makefile.am index 653bd0d..90b9fb5 100644 --- a/trust/tests/Makefile.am +++ b/trust/tests/Makefile.am @@ -19,7 +19,7 @@ LDADD = \ $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/common/libp11-data.la \ $(top_builddir)/common/libp11-library.la \ - $(top_builddir)/common/libp11-compat.la \ + $(top_builddir)/common/libp11-common.la \ $(builddir)/libtestdata.la \ $(LIBTASN1_LIBS) \ $(CUTEST_LIBS) \ @@ -41,8 +41,7 @@ noinst_PROGRAMS = \ $(CHECK_PROGS) frob_nss_trust_LDADD = \ - $(top_builddir)/common/libp11-library.la \ - $(top_builddir)/common/libp11-compat.la \ + $(top_builddir)/common/libp11-common.la \ $(top_builddir)/p11-kit/libp11-kit.la TESTS = $(CHECK_PROGS) diff --git a/trust/tests/test-builder.c b/trust/tests/test-builder.c index 5ce3b22..7cab1f6 100644 --- a/trust/tests/test-builder.c +++ b/trust/tests/test-builder.c @@ -44,7 +44,7 @@ #include "hash.h" #include "debug.h" #include "index.h" -#include "library.h" +#include "message.h" #include "oid.h" #include "pkcs11x.h" @@ -1722,7 +1722,6 @@ main (void) int ret; putenv ("P11_KIT_STRICT=1"); - p11_library_init (); p11_debug_init (); /* p11_message_quiet (); */ diff --git a/trust/tests/test-index.c b/trust/tests/test-index.c index 14f5a8a..8405061 100644 --- a/trust/tests/test-index.c +++ b/trust/tests/test-index.c @@ -41,8 +41,8 @@ #include "attrs.h" #include "debug.h" -#include "library.h" #include "index.h" +#include "message.h" #include "test-data.h" @@ -1036,7 +1036,6 @@ main (void) int ret; putenv ("P11_KIT_STRICT=1"); - p11_library_init (); p11_debug_init (); p11_message_quiet (); diff --git a/trust/tests/test-module.c b/trust/tests/test-module.c index c92e1c3..525a68e 100644 --- a/trust/tests/test-module.c +++ b/trust/tests/test-module.c @@ -42,7 +42,6 @@ #define CRYPTOKI_EXPORTS #include "attrs.h" -#include "debug.h" #include "hash.h" #include "library.h" #include "pkcs11x.h" @@ -898,7 +897,6 @@ main (void) putenv ("P11_KIT_STRICT=1"); p11_library_init (); - p11_debug_init (); SUITE_ADD_TEST (suite, test_get_slot_list); SUITE_ADD_TEST (suite, test_get_slot_info); diff --git a/trust/tests/test-parser.c b/trust/tests/test-parser.c index 94cfc49..147823a 100644 --- a/trust/tests/test-parser.c +++ b/trust/tests/test-parser.c @@ -43,7 +43,7 @@ #include "attrs.h" #include "builder.h" #include "debug.h" -#include "library.h" +#include "message.h" #include "oid.h" #include "parser.h" #include "pkcs11x.h" @@ -570,7 +570,6 @@ main (void) int ret; putenv ("P11_KIT_STRICT=1"); - p11_library_init (); p11_debug_init (); SUITE_ADD_TEST (suite, test_parse_der_certificate); diff --git a/trust/tests/test-persist.c b/trust/tests/test-persist.c index b9a79e9..ee73331 100644 --- a/trust/tests/test-persist.c +++ b/trust/tests/test-persist.c @@ -43,7 +43,7 @@ #include "attrs.h" #include "compat.h" #include "debug.h" -#include "library.h" +#include "message.h" #include "persist.h" #include "pkcs11.h" #include "pkcs11x.h" @@ -441,7 +441,6 @@ main (void) putenv ("P11_KIT_STRICT=1"); p11_debug_init (); - p11_library_init (); SUITE_ADD_TEST (suite, test_magic); SUITE_ADD_TEST (suite, test_simple); diff --git a/trust/tests/test-token.c b/trust/tests/test-token.c index 6cf687b..ffd733f 100644 --- a/trust/tests/test-token.c +++ b/trust/tests/test-token.c @@ -42,7 +42,7 @@ #include "attrs.h" #include "debug.h" #include "pkcs11x.h" -#include "library.h" +#include "message.h" #include "test-data.h" #include "token.h" @@ -235,7 +235,6 @@ main (void) int ret; putenv ("P11_KIT_STRICT=1"); - p11_library_init (); p11_debug_init (); SUITE_ADD_TEST (suite, test_token_load); diff --git a/trust/token.c b/trust/token.c index b562788..e7c91cd 100644 --- a/trust/token.c +++ b/trust/token.c @@ -41,7 +41,7 @@ #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "errno.h" -#include "library.h" +#include "message.h" #include "module.h" #include "parser.h" #include "pkcs11.h" -- cgit v1.1