summaryrefslogtreecommitdiff
path: root/p11-kit/tests
Commit message (Collapse)AuthorAgeFilesLines
* Move to non-recursive Makefile for building bins and libsStef Walter2014-08-1544-9265/+0
| | | | Still use recursive for documentation and translation.
* Fix mostly erroneous scanner warnings in testsStef Walter2014-08-082-1/+8
|
* p11-kit: Cleanup and add documentation for 'remote' optionStef Walter2014-07-081-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=54105
* p11-kit: Add 'p11-kit remote' command for isolating modulesStef Walter2014-07-083-177/+1
| | | | | This adds a new tool to the p11-kit command called 'remote'. This is the server side of remoting a PKCS#11 module.
* rpc: Implement execution of another tool to transport PKCS#11 RPCStef Walter2014-07-085-23/+662
|
* mock: Minor testing tweaks to mock testingStef Walter2014-07-081-2/+2
|
* rpc: Implement PKCS#11 messages/client/server codeStef Walter2014-07-083-2/+948
| | | | | | | | | | | | * This enables passing around bytes which represent PKCS#11 RPC calls. * Caller is responsible for connecting/disconnecting and so on. * Client side caller gets a mixin from p11_rpc_client_init() to call into, which generates callbacks with byte arrays to be transported. * Server side calls p11_rpc_server_handle() with a CK_FUNCTION_LIST_PTR on which relevant methods get called. * Doesn't yet implement the actual daemon or clients etc... https://bugs.freedesktop.org/show_bug.cgi?id=54105
* Added test for non-null values in empty ID and label URI partsNikos Mavrogiannopoulos2014-07-041-0/+66
|
* p11-kit: Handle managed modules correctly when forkingStef Walter2014-07-041-0/+47
| | | | | | | | Correctly allow reinitialization when a process forks. We don't yet implement checks on all entry points of a managed module, but this allows callers to call C_Initialize again after forking, as outlined by the PKCS#11 v2 spec.
* test-iter: Fix use of uninitialized variableStef Walter2014-01-141-0/+1
|
* iter: Add p11_kit_iter_get_attributes() functionStef Walter2014-01-131-0/+67
| | | | A simple wrapper for C_GetAttributeValue()
* Disable tests with setgid binaries when running in fakerootAndreas Metzler2013-10-011-1/+4
| | | | | We use the FAKED_MODE environment variable as a way to detect fakeroot.
* Remove unused make variablesStef Walter2013-09-091-1/+0
|
* iter: Add a p11_kit_iter_destroy_object() functionStef Walter2013-08-281-0/+40
| | | | Handy function since this is a common need.
* iter: Add p11_kit_iter_set_uri() functionStef Walter2013-08-281-0/+28
| | | | This is so we can set a filtering uri on the iterator after construction
* iter: Add p11_kit_iter_get_token() callStef Walter2013-08-281-0/+32
| | | | | To get the already loaded CK_TOKEN_INFO during iteration for the token that the current object is on.
* iter: Add new P11_KIT_ITER_WANT_WRITABLE iterator behaviorStef Walter2013-08-281-3/+1
| | | | | This allows us to try to get a RW session, but if not fallback to a read-only session.
* Avoid multiple stat() calls for same fileStef Walter2013-08-281-3/+3
| | | | | | As a side effect we can also not use the dirent.d_type field https://bugs.freedesktop.org/show_bug.cgi?id=68525
* Use simple serial automake test harnessStef Walter2013-07-232-0/+2
| | | | | * Add a testing sanity check to see if we're catching errors * Fix a few other testing issues
* Fix p11_kit_space_strlen() result when empty stringStef Walter2013-07-182-0/+60
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=985416
* Don't load configs from user directory when setuidStef Walter2013-07-185-2/+139
| | | | | | | When running as setuid() or setgid() don't access the user's home directory, or use $HOME environment variables. https://bugzilla.redhat.com/show_bug.cgi?id=985014
* Fix various issues highlighted by coverity scannerStef Walter2013-07-181-0/+3
| | | | Among others fix possible usage of large stack allocation.
* p11-kit: Add P11_KIT_MODULE_TRUSTED flagStef Walter2013-07-043-2/+54
| | | | | A new flag to pass to p11_kit_modules_load() and related functions which limits loaded modules to ones with "trust-policy: yes".
* iter: Add iteration mode where session is not busyStef Walter2013-07-031-25/+86
| | | | | | | | | | | 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.
* Fix up Makefile.am files for automake 1.13 warningsStef Walter2013-05-211-1/+1
|
* Our own unit testing frameworkStef Walter2013-05-2114-1729/+1572
| | | | | | | | * Support the TAP protocol * Much cleaner without having to carry around state * First class support for setup/teardown * Port the common tests * Wait on porting other tests until we've merged outstanding code
* Add the log-calls module config optionStef Walter2013-05-213-2/+128
| | | | | If 'log-calls = yes' is set then all the PKCS#11 modules are logged to stderr.
* Manage C_CloseAllSessions function for multiple callersStef Walter2013-05-212-3/+70
| | | | | | Make C_CloseAllSessions work for different callers. Track the sessions that each caller opens and close just those when C_CloseAllSessiosn is called.
* Update the proxy module to use managed PKCS#11 modulesStef Walter2013-05-212-18/+124
| | | | | | | | | | Each time C_GetFunctionList is called on the proxy module, a new managed PKCS#11 set of functions is returned. These are all cleaned up when the module is unloaded. We want the proxy module to continue to work even without the highly recommended libffi. For that reason we still keep the old behavior of sharing state in the proxy module.
* p11-kit: Managed PKCS#11 module loadingStef Walter2013-05-2110-91/+2769
| | | | | | | | | Support a new managed style module loading for PKCS#11 modules. This allows us to better coordinate between multiple callers of the same PKCS#11 modules and provide hooks into their behavior. This meant redoing the public facing API. The old methods are now deprecated, marked and documented as such.
* Use libffi to implement mixins for managed codeStef Walter2013-05-162-0/+190
| | | | | | * This allows us to call into subclassed PKCS#11 modules as if they were plain old PKCS#11 modules * libffi is an optional dependency
* Separate library init from message codeStef Walter2013-04-035-22/+22
| | | | | | | | | | | 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
* Fix build with automake 1.13Stef Walter2013-04-031-1/+1
| | | | Also remove some generated files from the po/ directory.
* Fix memory leaks reported by 'make leakcheck'Stef Walter2013-03-203-1/+3
|
* p11-kit: New priority option and change trust-policy optionStef Walter2013-03-1510-3/+54
| | | | | | | | | | | | | | * Sort loaded modules appropriately using the 'priority' option. This allows us to have a predictable order for callers, when callers iterate through modules. * Modules default to having an 'priority' option of '0'. * If modules have the same order value, then sort by name. * The above assumes the role of ordering trust-policy sources. * Change the trust-policy option to a boolean * Some of this code will be rearranged when the managed branch is merged. https://bugs.freedesktop.org/show_bug.cgi?id=61978
* iter: Don't skip tokens that don't have CKF_TOKEN_INITIALIZEDStef Walter2013-03-081-33/+0
| | | | | This flag is not required to be set unless C_InitToken has been called. Many modules, like libnssckbi.so, do not set this flag.
* Use putenv() instead of setenv()Stef Walter2013-03-037-7/+7
| | | | Since older operating systems don't support setenv()
* Add public iterator API to p11-kitStef Walter2013-02-053-2/+1144
|
* Add a /usr/share/p11-kit/modules directory for package module configsStef Walter2013-02-053-0/+4
| | | | | | * Try to make /etc/pkcs11/modules for administrator use * Override the old pkg-config variables to help packages start using the new location
* Add more mock-module implementationStef Walter2013-02-045-1243/+14
| | | | | * Move mock code into the common/ directory to be used by multiple components of p11-kit
* Use the stdbool.h C99 bool typeStef Walter2013-01-233-17/+57
| | | | | | It was getting really wild knowing whether a function returning an int would return -1 on failure or 0 or whether the int return value was actually a number etc..
* Set strict debug preconditions during testingStef Walter2013-01-096-0/+6
|
* Add common functions for manipulating CK_ATTRIBUTE arraysStef Walter2013-01-091-2/+4
|
* Build common code into noinst librariesStef Walter2013-01-091-2/+6
| | | | | | * This is cleaner than building the same source files all over the place over and over. * Works better with code coverage.
* Move debug and library code into the common/ subdirectoryStef Walter2013-01-0934-0/+4254
Start using p11_ as our internal prefix rather than _p11_. We explicitly export p11_kit_ so this is fine as far as visibility. Move the threading, mutex, and module compat, dict, and array code into the common directory too. Take this opportunity to clean up a bit of internal API as well, since so many lines are being touched internally.