summaryrefslogtreecommitdiff
path: root/p11-kit/util.c
Commit message (Collapse)AuthorAgeFilesLines
* rpc: Add PKCS#11 module that connects to socketDaiki Ueno2017-02-171-57/+0
| | | | | | | | | | | | | | | This patch adds a PKCS#11 module that connects to the p11-kit server exposed on the filesystem. The filename of the socket is determined in the following order: - $P11_KIT_SERVER_ADDRESS, if the envvar is available - $XDG_RUNTIME_DIR/p11-kit/pkcs11, if the envvar is available - /run/$(id -u)/p11-kit/pkcs11, if /run/$(id -u) exists - /var/run/$(id -u)/p11-kit/pkcs11, if /var/run/$(id -u) exists - ~/.cache/p11-kit/pkcs11. Note that the program loading this module may have called setuid() and secure_getenv() which we use for fetching envvars could return NULL.
* virtual: Move mutex into p11_library_init()Daiki Ueno2017-02-141-5/+0
| | | | | | | | | We used to provide p11_virtual_fixed_{,un}init() to only initialize a mutex used in virtual.c. That required all the tests calling virtual functions to call p11_virtual_fixed_{,un}init() in main(). For simplicity, move the mutex variable initialization into p11_library_init().
* virtual: Make virtual-fixed internal API cleanerDaiki Ueno2017-01-251-5/+5
| | | | | Add proper inclusion guard to virtual-fixed.h and move the declarations of the (un)initialization functions there.
* build: Make libffi closure optionalDaiki Ueno2017-01-241-0/+5
| | | | | | | | libffi's closure support is not available on all platforms and may fail at run time if running under a stricter SELinux policy. Fallback to pre-compiled closures if it is not usable. https://bugs.freedesktop.org/show_bug.cgi?id=97611
* Fix typos flagged by codespellDaiki Ueno2016-08-221-1/+1
|
* Fix p11_kit_space_strlen() result when empty stringStef Walter2013-07-181-3/+3
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=985416
* Update the proxy module to use managed PKCS#11 modulesStef Walter2013-05-211-0/+3
| | | | | | | | | | 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.
* Separate library init from message codeStef Walter2013-04-031-0/+1
| | | | | | | | | | | 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
* Don't use library locks from p11-kit toolStef Walter2013-04-031-0/+4
| | | | | | | The global library p11_library_mutex is for libraries to use, so don't use it from any code in common/, which is also used by the p11-kit tool https://bugs.freedesktop.org/show_bug.cgi?id=63046
* Do not export (de)constructorAndreas Metzler2013-03-191-4/+4
| | | | | | Rename p11_kit_init and p11_kit_fini to _p11_kit_init and _p11_kit_fini respectively to stop them from being exported in the ABI. It does not seem to be necessary.
* Fix syntax errors in OS_WIN32 ifdefsStef Walter2013-03-031-2/+2
|
* Only do shared object and DLL initialization in librariesStef Walter2013-02-201-0/+54
| | | | | | Don't do library initialization on shared object load when not running in a library. We'll want to plug into this and do different things per library in the future.
* Add p11_kit_be_loud() function for use in tests and toolsStef Walter2013-02-051-0/+14
| | | | This does the opposite of p11_kit_be_quiet().
* Move debug and library code into the common/ subdirectoryStef Walter2013-01-091-299/+19
| | | | | | | | | | | 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.
* Win32 build fixesStef Walter2012-06-291-26/+0
| | | | | | * Remove unused functions * Use getprogname() instead of calc_progname() which no longer exists * Fix up exporting of functions in the mock module
* Preconditions to check for input probs and out of memoryStef Walter2012-05-131-9/+0
| | | | | | * We don't try to guarantee completely robust and problem free behavior in cases where the caller or process isn't behaving. We consider these to be outside of our control.
* Fix test modules linking errorsStef Walter2012-05-011-0/+1
| | | | * And display warning messages in the debug output
* Provide compat getprogname() implementations on other OS'sStef Walter2012-05-011-36/+2
| | | | * And use them in our replacement err() and p11_kit_set_progname()
* Move the compat.[ch] headers into common directory/Stef Walter2012-04-301-0/+66
| | | | | * And the compat stuff in the p11-kit directory merged into util.c and util.h
* Add more p11-kit cleanup to fix valgrind leak reportsStef Walter2012-04-021-0/+11
| | | | | * per-thread memory isn't actually a real memory leak, but was still reachable after exit, so clean this up.
* Add enable-in and disable-in options to module configStef Walter2012-04-011-2/+113
| | | | | | | | * These can be used to load certain modules in certain programs, or prevent loading in others. * Useful for a key manager like seahorse, so we can load extra modules (think NSS) that other modules shouldn't load.
* Fix problems crashing when freeing TLS on windowsStef Walter2011-10-291-0/+2
|
* Add debug output to windows init and uninit of libraryStef Walter2011-10-291-1/+8
|
* Fix broken build on windowsMichael Cronenworth2011-10-251-1/+1
| | | | | * The debug_init() call needed a rename to _p11_debug_init() to match the non-Win32 code.
* Rename non-static functions to have a _p11_xxx prefix.Stef Walter2011-10-241-6/+6
| | | | | | | * Work around issues with brain-dead linkers not respecting the libtool -export-symbol-regex argument https://bugs.freedesktop.org/show_bug.cgi?id=42020
* Initial port to win32Stef Walter2011-10-171-33/+155
| | | | | | | | * 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
* Complete documentation for message functionality.Stef Walter2011-06-091-0/+29
|
* Store last failure message per thread.Stef Walter2011-06-091-5/+82
| | | | * Add p11_kit_message() function to get last message.
* Refactor configurationStef Walter2011-06-081-0/+17
| | | | | * Move configuration loading into conf.c * Have user modules with same name merge/override modules in system.
* Fix up documentationStef Walter2011-06-071-0/+41
|
* Add p11_kit_space_strdup() function, and rename p11_kit_space_strlen()Stef Walter2011-06-071-0/+34
| | | | * Print out module info in p11-kit tool.
* Fix up copyright lines.Stef Walter2011-04-011-1/+0
|
* Documentation and API cleanup.Stef Walter2011-03-311-0/+51
* Rename source directory * More consistent with return values from URI functions. * Allow formatting URI to take a uri type.