Stef Walter [Mon, 23 Jan 2012 08:09:31 +0000 (09:09 +0100)]
Remove automatic reinitialization of PKCS#11 after fork
* First of all one should only call async-signal-safe functions
from the callbacks of pthread_atfork(), and so we cannot
reinitialize directly.
* Some modules use pthread_atfork() to detect forking and setup
their internal state. If we call into them in our pthread_atfork()
callback then this is inherently racy.
* There was danger of endless loops and deadlocks which are caused
by handlers which fork in their C_Initialize
* Many processes do fork/exec, reinitializing PKCS#11 for these
forks is quite resourc intensive when the child process won't use
PKCS#11 at all.
Stef Walter [Tue, 20 Dec 2011 14:18:37 +0000 (15:18 +0100)]
Reorganize tests, work around optimization bug
* Encountered a gcc optimization bug in gcc 4.6.1 which seems to
be reordering related function calls eroneously. This bug seems
to be fixed in 4.6.2.
* Reorganize test code to get around this bug building on mingw,
and ubuntu 11.10, both of which use gcc 4.6.1
Stef Walter [Sat, 29 Oct 2011 07:46:02 +0000 (00:46 -0700)]
Make build not depend on gtk-doc or pkg-config
* If enabled, gtk-doc can be used, but we no longer expect the
gtkdoc autoconf/automake macro files to be installed.
* pkg-config is no longer used for checks.
* We still do install pkg-config files, and this is the preferred
way to build against and link to p11-kit.
Stef Walter [Mon, 17 Oct 2011 12:51:31 +0000 (14:51 +0200)]
Initial port to win32
* Tests do not all yet pass, at least not on wine
* Added abstraction of some non-portable functions in compat.h/c
* Build with an argument like this for win32 support:
./autogen.sh --host=i586-mingw32msvc
* This win32 port needs more work from interested parties
Stef Walter [Mon, 10 Oct 2011 15:32:34 +0000 (17:32 +0200)]
Only call C_Initialize and C_Finalize once per module
* Do not concurretnly call C_Initialize or C_Finalize in a module
* The PKCS#11 spec indicates that mone thread should call those functions.
* It's reasonable for a module to expect to only be initialized or
finalized in one thread.
* In particular NSS does not lock its C_Initialize or C_Finalize.
Kalev Lember [Wed, 14 Sep 2011 05:10:46 +0000 (08:10 +0300)]
When a module has a relative path, load it from $libdir/pkcs11
So far we have only supported full paths to the pkcs11 modules in config
files. This change adds relative path support, so that for modules
installed under the standard $libdir/pkcs11, the config file won't have
to spell out the full path.
Stef Walter [Sun, 14 Aug 2011 16:45:19 +0000 (18:45 +0200)]
Safer initialization of individually initialized module.
* More checks for out of memory.
* Take more of the same code paths when initializing a single
module as when initializing registered, or loading from file.
* Cleanup halfway initialized globals if fail during init.
Stef Walter [Wed, 3 Aug 2011 09:37:40 +0000 (11:37 +0200)]
Don't fail when duplicate modules are configured.
* Duplicate modules may be caused by editor backups, misconfigurations
or a multitude of other sources. Failing dead is a bit harsh.
* After discussing gnutls needs with Nikos
Stef Walter [Wed, 27 Jul 2011 10:02:25 +0000 (12:02 +0200)]
Create a link for the proxy module.
* Install proxy module at its own path which is not prefixed by 'lib'
* Since the proxy module is the same as the library, and actually
needs to be loaded as the same library in memory (due to resource
tracking per process), use a symlink for proxy.
* Add a variable to the pkg-config file which shows the path
to the proxy module. ie:
$ pkg-config --variable=proxy_module p11-kit-1
Stef Walter [Wed, 27 Jul 2011 09:24:55 +0000 (11:24 +0200)]
Reimplement and remove apache licensed bits of code.
* Reimplement the various bits of the hash table that were
still based on the apache apr code. Use different algorithms
for hashing, lookup and other stuff.
* Use this as an opportunity to cleanup that code and make
it more legible.
Colin Walters [Mon, 18 Jul 2011 14:59:54 +0000 (10:59 -0400)]
build: Make autogen.sh work
* We were missing a call to gettextize, which is what copies in config.rpath
* Delete ABOUT-NLS, it is copied in by gettextize
* While we're here, take a page from gtk+'s autogen.sh and just use autoreconf,
instead of specifying everything.
* We need to always have an m4/ directory, so that gettextize works,
so we make a dummy empty file
* Apparently gettextize is totally insane, requiring user input etc. Copy
in some hacks from Avahi's autogen.sh to work around this.
Stef Walter [Mon, 20 Jun 2011 19:17:03 +0000 (21:17 +0200)]
Implement support for registering and calling pinfile callbacks
* These are callbacks that hanlde the pinfile part of a PKCS#11 URI.
* One library can register a callback that another can then call
in a thread-safe and simple fashion.