Stef Walter [Thu, 29 Aug 2013 10:12:46 +0000 (12:12 +0200)]
Route 'p11-kit extract-trust' over to trust tool
The actual command is 'trust extract-compat'. Make installed placeholder
script reflect this. We still support the old placeholder script
if it is present.
Stef Walter [Tue, 27 Aug 2013 18:52:35 +0000 (20:52 +0200)]
debug: Allow debug lines longer than 512 characters
Since fprintf (stderr, ...) already doesn't print atomically, we don't
lose any atomicity here. If we want to print atomically this will need
some further reworking anyway.
Stef Walter [Tue, 23 Jul 2013 21:04:32 +0000 (23:04 +0200)]
Make tests work on file systems with block size directories
On certain file systems the size of the directory does not
change when adding a file. This caused the tests to fail. Make
the tests wait more than a second in certain tests to get the
mtime to change.
Stef Walter [Thu, 18 Jul 2013 10:50:34 +0000 (12:50 +0200)]
Use $XDG_CONFIG_HOME/pkcs11 as default user config directory
By default this evaluates to ~/.config/pkcs11. This is a somewhat
backwards incompatible change. However so far only advanced users
have been exposed to the user p11-kit configuration.
Distributors are able to revert this if necessary with a
--with-user-config='~/.pkcs11' ./configure option.
Stef Walter [Wed, 17 Jul 2013 07:51:32 +0000 (09:51 +0200)]
tools: Use $TMPDIR instead of $TEMP
TMPDIR is a more standard environment variable for locating the
temp directory on Unix. In addition since this is only used in
tests, remove the code from the generic p11_path_expand() func.
In general remove the possibility for forks to put $HOME or $TEMP
environment variables in configured paths. This was possible
due to code in p11_path_expand() but not something we supported.
Stef Walter [Tue, 16 Jul 2013 19:20:44 +0000 (21:20 +0200)]
buffer: Check for unlikely integer overflow
If we see an integer overflow here something has gone horribly wrong
(or malicious code is present). So treat this as unrecoverable, and
fail if we're going to overflow.
Stef Walter [Tue, 16 Jul 2013 15:18:02 +0000 (17:18 +0200)]
iter: Document guarantees for filter matches argumet
The matches argument is always initialized to CK_TRUE when a filter
is called, and it's up to filters to set it to CK_FALSE. Filters
don't need to set to CK_TRUE.
Stef Walter [Thu, 4 Jul 2013 13:48:38 +0000 (15:48 +0200)]
trust: Port to use CKA_PUBLIC_KEY_INFO and updated trust store spec
* Use the concepts and PKCS#11 objects described in the
recently updated (still work in progress) storing trust spec.
* Define our own CKA_X_PUBLIC_KEY_INFO define for now, since the
the CKA_PUBLIC_KEY_INFO isn't defined yet.
* Most notably, the association between certificates and stapled
extensions is by public key.
* Rework some of the tests to take into account the above.
Stef Walter [Fri, 28 Jun 2013 15:19:22 +0000 (17:19 +0200)]
trust: Rename p11_index_batch() to p11_index_load()
The name makes it clearer what's going on. This is only used
during loading, so we can track whether a change has resulted
from the trust module or from the file storage.
Stef Walter [Fri, 28 Jun 2013 11:27:42 +0000 (13:27 +0200)]
trust: Implement reloading of token data
* Reload token data whenever a new session is opened.
* Only reload files/directories that have changed.
* Move duplicate anchor/blacklist detection logic into
the extract code. This is in line with the approach
being discussed on the mailing lists and spec document.
* New internal attribute CKA_X_ORIGIN set on all objects
so we can track where an object came from, and replace
it when reloaded.
In general this is a prerequisite for modification of objects
reload before modify is necessary to prevent multiple callers
clobbering each other's changes.
Stef Walter [Fri, 28 Jun 2013 11:00:02 +0000 (13:00 +0200)]
iter: Add iteration mode where session is not busy
In order to use the session we are iterating on for other tasks
such as other C_FindObject() calls, we need to make sure that
it's not in the middle of a find operation. Finish up the
complete find operation in advance of returning objects from
a session.
Make this the default mode. The previous behavior remains
as an option. Add tests.
Stef Walter [Mon, 24 Jun 2013 11:34:30 +0000 (13:34 +0200)]
Reorganize various components
* p11-kit library and tool in the p11-kit/ subdirectory
* trust module and new trust tool in trust/ subdirectory
* No more tools/ subdirectory
* Lots less in the common/ subdirectory
Stef Walter [Fri, 14 Jun 2013 20:00:42 +0000 (22:00 +0200)]
trust: Writable module PKCS#11 token functions
Although we don't actually write anything out yet, make the
various PKCS#11 functions behave properly when faced with
requests to write to token objects
Stef Walter [Mon, 17 Jun 2013 12:36:37 +0000 (14:36 +0200)]
tools: Only use our private path when looking for external commands
Instead of looking for external commands in the path, just look
for them in our private directory.
We want to be conservative early on, and limit what sorta things
we have to maintain later. We can later remove this restriction
if a real use case presents itself.