diff options
author | Stef Walter <stef@memberwebs.com> | 2010-01-06 14:20:48 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2010-01-06 14:20:48 +0000 |
commit | da12b4f09752f192eb66a2a044e40a086025237c (patch) | |
tree | 21ff3753a9f0fe7632b1a4e04a9d6a62670c0880 | |
parent | 19e2998a5c0d5144f3dc87db8969d6d4c957a2c1 (diff) |
-rw-r--r-- | Makefile.win32 | 16 | ||||
-rw-r--r-- | README | 10 | ||||
-rw-r--r-- | autogen.sh | 21 | ||||
-rw-r--r-- | configure.in | 10 | ||||
-rw-r--r-- | module/Makefile.am | 12 | ||||
-rw-r--r-- | module/p11-constants.c (renamed from module/cryptoki-constants.c) | 0 | ||||
-rw-r--r-- | module/p11-log.c (renamed from module/cryptoki-log.c) | 14 |
7 files changed, 49 insertions, 34 deletions
diff --git a/Makefile.win32 b/Makefile.win32 index f6932e6..78e3a83 100644 --- a/Makefile.win32 +++ b/Makefile.win32 @@ -10,26 +10,26 @@ RSC=rc.exe OUTDIR=.\win32 -ALL : "$(OUTDIR)\cklog.dll" +ALL : "$(OUTDIR)\p11-log.dll" CLEAN : -@erase "$(OUTDIR)\*.obj" -@erase "$(OUTDIR)\vc60.*" - -@erase "$(OUTDIR)\cklog.*" + -@erase "$(OUTDIR)\p11-log.*" INCLUDES = /I pkcs11 "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" -CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Fp"$(OUTDIR)\cklog.pch" /YX /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\" /FD /GZ /c +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Fp"$(OUTDIR)\p11-log.pch" /YX /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\" /FD /GZ /c MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 LINK32=link.exe -LINK32_FLAGS=kernel32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\cklog.pdb" /debug /machine:I386 /out:"$(OUTDIR)\cklog.dll" /implib:"$(OUTDIR)\cklog.lib" /pdbtype:sept +LINK32_FLAGS=kernel32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\p11-log.pdb" /debug /machine:I386 /out:"$(OUTDIR)\p11-log.dll" /implib:"$(OUTDIR)\p11-log.lib" /pdbtype:sept -$(OUTDIR)\cryptoki-log.obj : .\module\cryptoki-log.c "$(OUTDIR)" - $(CPP) $(INCLUDES) $(CPP_PROJ) .\module\cryptoki-log.c +$(OUTDIR)\p11-log.obj : .\module\p11-log.c "$(OUTDIR)" + $(CPP) $(INCLUDES) $(CPP_PROJ) .\module\p11-log.c -"$(OUTDIR)\cklog.dll" : "$(OUTDIR)" "$(OUTDIR)\cryptoki-log.obj" - $(LINK32) $(LINK32_FLAGS) "$(OUTDIR)\cryptoki-log.obj" +"$(OUTDIR)\p11-log.dll" : "$(OUTDIR)" "$(OUTDIR)\p11-log.obj" + $(LINK32) $(LINK32_FLAGS) "$(OUTDIR)\p11-log.obj" @@ -1,15 +1,15 @@ -cryptoki-log: A PKCS#11 log module +p11-log: A PKCS#11 log module -cryptoki-log is a PKCS#11 module which filters requests for any other module and prints out the calls either to stderr or a file. This is only useful to developers working with PKCS#11. +p11-log is a PKCS#11 module which filters requests for any other module and prints out the calls either to stderr or a file. This is only useful to developers working with PKCS#11. Don't use this unless you understand why you want to. Here's how to log all calls to firefox's libnssckbi.so module: -# export CRYPTOKI_LOG_MODULE=/usr/lib/firefox/libnssckbi.so -# export CRYPTOKI_LOG_FILE=/tmp/cryptoki.log +# export P11_LOG_MODULE=/usr/lib/firefox/libnssckbi.so +# export P11_LOG_FILE=/tmp/p11.log # mv /usr/lib/firefox/libnssckbi.so /usr/lib/firefox/libnssckbi.so.real -# ln -s /usr/lib/cryptoki-log.so /usr/lib/firefox/libnssckbi.so +# ln -s /usr/lib/p11-log.so /usr/lib/firefox/libnssckbi.so # firefox # mv /usr/lib/firefox/libnssckbi.so.real /usr/lib/firefox/libnssckbi.so diff --git a/autogen.sh b/autogen.sh new file mode 100644 index 0000000..ec0a21a --- /dev/null +++ b/autogen.sh @@ -0,0 +1,21 @@ +#!/bin/sh -e + +set -e + +# Some boiler plate to get git setup as expected +if test -d .git; then + if test -f .git/hooks/pre-commit.sample && \ + test ! -f .git/hooks/pre-commit; then + cp -pv .git/hooks/pre-commit.sample .git/hooks/pre-commit + fi +fi + +set -x + +aclocal +autoheader +libtoolize +automake -a +autoconf +./configure "$@" + diff --git a/configure.in b/configure.in index 7b9f3b0..3084028 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ -AC_INIT(module/cryptoki-log.c) -AM_INIT_AUTOMAKE(cryptoki-log, 0.2) +AC_INIT(module/p11-log.c) +AM_INIT_AUTOMAKE(p11-log, 0.2) AC_CONFIG_HEADERS(config.h) AM_PROG_LIBTOOL @@ -14,16 +14,10 @@ if test "$enable_debug" = "yes"; then AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode]) echo "enabling debug compile mode" else - dnl AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions]) echo "disabling debug compile mode" fi AC_CHECK_LIB(dl, dlopen, , [echo "ERROR: libdl not found."; exit 1]) -# TODO: We don't need this once we switch to glib -dnl ACX_PTHREAD( , [echo "ERROR: Pthread support not found."; exit 1] ) -dnl LIBS="$PTHREAD_LIBS $LIBS" -dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - AC_OUTPUT([Makefile pkcs11/Makefile module/Makefile]) diff --git a/module/Makefile.am b/module/Makefile.am index ed0a17b..7510b34 100644 --- a/module/Makefile.am +++ b/module/Makefile.am @@ -1,15 +1,15 @@ -MODULE_SRCS = cryptoki-log.c -EXTRA_DIST = cryptoki-constants.c export.map +MODULE_SRCS = p11-log.c +EXTRA_DIST = p11-constants.c export.map -lib_LTLIBRARIES = cryptoki-log.la -cryptoki_log_la_LDFLAGS = \ +lib_LTLIBRARIES = p11-log.la +p11_log_la_LDFLAGS = \ -module \ -version-info 0:0:0 \ -Wl,--no-undefined \ -Wl,--version-script=$(srcdir)/export.map -cryptoki_log_la_CFLAGS = \ +p11_log_la_CFLAGS = \ -I$(top_srcdir)/pkcs11 -I. -cryptoki_log_la_SOURCES = $(MODULE_SRCS) +p11_log_la_SOURCES = $(MODULE_SRCS) diff --git a/module/cryptoki-constants.c b/module/p11-constants.c index d13488f..d13488f 100644 --- a/module/cryptoki-constants.c +++ b/module/p11-constants.c diff --git a/module/cryptoki-log.c b/module/p11-log.c index c03a016..5061546 100644 --- a/module/cryptoki-log.c +++ b/module/p11-log.c @@ -164,7 +164,7 @@ cklog(const char* msg, ...) } /* The constant logging */ -#include "cryptoki-constants.c" +#include "p11-constants.c" static void log_some_bytes (CK_BYTE_PTR arr, CK_ULONG num) @@ -712,7 +712,7 @@ CL_C_Initialize (CK_VOID_PTR pInitArgs) fclose (output_file); output_file = stderr; - output = getenv("CRYPTOKI_LOG_FILE"); + output = getenv("P11_LOG_FILE"); if (output && !output[0]) output = NULL; if (output) { @@ -728,9 +728,9 @@ CL_C_Initialize (CK_VOID_PTR pInitArgs) #endif /* Load the other module */ - module = getenv("CRYPTOKI_LOG_MODULE"); + module = getenv("P11_LOG_MODULE"); if (!module || !module[0]) { - cklog ("CRYPTOKI_LOG_MODULE not set\n"); + cklog ("P11_LOG_MODULE not set\n"); return CKR_DEVICE_ERROR; } @@ -791,10 +791,10 @@ CL_C_Initialize (CK_VOID_PTR pInitArgs) return CKR_CANT_LOCK; } - cklog ("INITIALIZE cryptoki-log debugging (%s / %s)\n", + cklog ("INITIALIZE p11-log debugging (%s / %s)\n", module, output ? output : "ods"); #else - cklog ("INITIALIZE cryptoki-log debugging (%s / %s)\n", + cklog ("INITIALIZE p11-log debugging (%s / %s)\n", module, output ? output : "stderr"); #endif @@ -814,7 +814,7 @@ CL_C_Finalize (CK_VOID_PTR pReserved) PROCESS_CALL ((pReserved)) DONE_CALL - cklog ("FINALIZE cryptoki-log debugging\n"); + cklog ("FINALIZE p11-log debugging\n"); } static CK_RV |