diff options
author | Daiki Ueno <dueno@redhat.com> | 2017-01-11 09:32:19 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2017-02-17 10:25:55 +0100 |
commit | 0684cd7b7f815b411ea5041c021f92ca5ef42606 (patch) | |
tree | ffb7006ea208c5574441d51ac82edec115474460 /p11-kit/util.c | |
parent | c28ff652e5d6c6ddff513716e22064e0e17a58d3 (diff) |
rpc: Add PKCS#11 module that connects to socket
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.
Diffstat (limited to 'p11-kit/util.c')
-rw-r--r-- | p11-kit/util.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/p11-kit/util.c b/p11-kit/util.c index 325d669..1e21f80 100644 --- a/p11-kit/util.c +++ b/p11-kit/util.c @@ -44,7 +44,6 @@ #include "message.h" #include "p11-kit.h" #include "private.h" -#include "proxy.h" #include <assert.h> #include <stdarg.h> @@ -237,59 +236,3 @@ _p11_get_progname_unlocked (void) return NULL; return p11_my_progname; } - -#ifdef OS_UNIX - -void _p11_kit_init (void); - -void _p11_kit_fini (void); - -#ifdef __GNUC__ -__attribute__((constructor)) -#endif -void -_p11_kit_init (void) -{ - p11_library_init_once (); -} - -#ifdef __GNUC__ -__attribute__((destructor)) -#endif -void -_p11_kit_fini (void) -{ - p11_proxy_module_cleanup (); - p11_library_uninit (); -} - -#endif /* OS_UNIX */ - -#ifdef OS_WIN32 - -BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID); - -BOOL WINAPI -DllMain (HINSTANCE instance, - DWORD reason, - LPVOID reserved) -{ - switch (reason) { - case DLL_PROCESS_ATTACH: - p11_library_init (); - break; - case DLL_THREAD_DETACH: - p11_library_thread_cleanup (); - break; - case DLL_PROCESS_DETACH: - p11_proxy_module_cleanup (); - p11_library_uninit (); - break; - default: - break; - } - - return TRUE; -} - -#endif /* OS_WIN32 */ |