summaryrefslogtreecommitdiff
path: root/p11-kit
Commit message (Collapse)AuthorAgeFilesLines
* pkg-config: Expose p11_trust_paths variableDaiki Ueno2016-11-151-0/+1
| | | | | The variable is mentioned in the manual but wasn't exposed from the pkg-config.
* build: Remove *.in files from EXTRA_DISTDaiki Ueno2016-11-151-2/+0
| | | | | The files created with AC_CONFIG_FILES are automatically added to the distribution.
* test: Remove /proxy/deinit-after-fork testDaiki Ueno2016-10-311-37/+0
| | | | | | | This test hasn't been working since the removal of the pthread_atfork() deinit code. To properly clean up, the child process needs to call C_Initialize() and C_Finalize(), and it is already tested by /proxy/initialize-child.
* modules: Reset the init count on fork()Daiki Ueno2016-10-311-0/+4
| | | | | | | | | | | | | | | Reset mod->init_count when forkid has changed. Otherwise C_Finalize does not get called. GCC's asan spotted this: Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f89bc7bfe20 in malloc (/lib64/libasan.so.3+0xc6e20) #1 0x7f89bc47a1f1 in p11_dict_new ../common/dict.c:278 #2 0x7f89bc42143d in managed_C_Initialize ../p11-kit/modules.c:1477 #3 0x7f89bc464c72 in binding_C_Initialize ../p11-kit/virtual.c:121 #4 0x7f89bc1b0a51 in ffi_closure_unix64_inner (/lib64/libffi.so.6+0x5a51) #5 0x7f89bc1b0dbf in ffi_closure_unix64 (/lib64/libffi.so.6+0x5dbf) #6 0x7f89bc44f9e8 in rpc_C_Initialize ../p11-kit/rpc-server.c:691
* modules: Fix memleak when loading remote moduleDaiki Ueno2016-10-311-0/+2
| | | | | | | | | | | | Make sure to call p11_virtual_uninit() on managed module. Otherwise the associated lower_module will not be released. GCC's asan spotted this: Direct leak of 56 byte(s) in 1 object(s) allocated from: #0 0x7f6c5368dfe0 in calloc (/lib64/libasan.so.3+0xc6fe0) #1 0x4436ba in p11_rpc_client_init ../p11-kit/rpc-client.c:2082 #2 0x42c147 in p11_rpc_transport_new ../p11-kit/rpc-transport.c:850 #3 0x415d95 in setup_module_for_remote_inlock ../p11-kit/modules.c:411
* rpc: Fix memleak in rpc_socket cleanupDaiki Ueno2016-10-311-0/+1
| | | | | | | | GCC's asan spotted this: Direct leak of 120 byte(s) in 1 object(s) allocated from: #0 0x7f8d4f221fe0 in calloc (/lib64/libasan.so.3+0xc6fe0) #1 0x427f55 in rpc_socket_new ../p11-kit/rpc-transport.c:100 #2 0x42bc1b in rpc_exec_connect ../p11-kit/rpc-transport.c:767
* uri: Port to PKCS#11 GNU calling conventionDaiki Ueno2016-10-311-0/+2
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=97245
* uri: Fix buffer overflow in memcmp()Daiki Ueno2016-10-311-25/+32
| | | | | | | The commit 63644dc introduced several memcmp() calls without checking the length of the first argument. https://bugs.freedesktop.org/show_bug.cgi?id=97245
* rpc: Send x-init-reserved to remote moduleDaiki Ueno2016-10-057-16/+144
| | | | | | | Signed-off-by: Stef Walter <stefw@redhat.com> * Fixed up indentation https://bugs.freedesktop.org/show_bug.cgi?id=80519
* test: Fix p11_virtual_init() usageDaiki Ueno2016-10-051-1/+1
| | | | | | | p11_virtual_init() should take a CK_FUNCTION_LIST as the 3rd argument, if the 2nd argument is &p11_virtual_base. https://bugs.freedesktop.org/show_bug.cgi?id=87192
* Fix link of p11-kit-proxy.dylib on Mac OS XLeonardo Brondani Schenkel2016-10-031-1/+1
| | | | | | | | | However, on Mac OS X the library is named libp11-kit.dylib so in the above command the source of the link resolves to nothing, the destination becomes the source and the link to a non-existent file is created in the working directory. https://bugs.freedesktop.org/show_bug.cgi?id=98022
* iter: Utilize 'slot-id' URI path attributeDaiki Ueno2016-09-022-1/+83
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=97245
* iter: Utilize slot info URI path attributesDaiki Ueno2016-09-023-0/+134
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=97245
* uri: Support 'slot-id' path attributeDaiki Ueno2016-09-023-3/+126
| | | | | | Accept 'slot-id' path attribute defined in RFC 7512. https://bugs.freedesktop.org/show_bug.cgi?id=97245
* uri: Support slot info path attributesDaiki Ueno2016-09-024-0/+180
| | | | | | | Accept 'slot-description' and 'slot-manifacturer' path attributes defined in RFC 7512. https://bugs.freedesktop.org/show_bug.cgi?id=97245
* uri: Remove whitespace early when parsingDaiki Ueno2016-09-021-66/+78
| | | | | | | | | | | For every path/query component, p11_kit_uri_parse() allocates a small buffer to strip whitespace out. This patch removes any whitespace in the URI at the entry of the function to simplify the code. Note that RFC 7512 actually suggests to ignore whitespace at the extracting phase rather than the parsing phase. https://bugs.freedesktop.org/show_bug.cgi?id=97245
* Fix leak when C_Initialize() is called from childDaiki Ueno2016-08-221-0/+2
| | | | | | | The test case added for bug 90289 (commit c73edd00) revealed that some of the C_Initialize() implementations do not consider the case where it is called from the parent process and then from the child process, without calling C_Finalize() in between.
* Fix typos flagged by codespellDaiki Ueno2016-08-225-9/+9
|
* Doc: p11_kit_module_load accepts a filename arg.Andreas Metzler2016-02-241-1/+4
| | | | | | | | p11_kit_module_load() hands on the module_path argument to load_module_from_file_inlock() which accepts relative paths, prepending P11_MODULE_PATH. Update API documentation accordingly. https://lists.freedesktop.org/archives/p11-glue/2016-February/000587.html
* Avoiding redundant checkPankaj2016-01-051-3/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=93587
* rpc-transport.c: include sys/select.h for fd_setGustavo Zacarias2015-12-071-0/+1
| | | | | | | | | | | | | | fd_set and friends, according to POSIX.1-2001, needs sys/select.h, so include it otherwise the build fails for uClibc: p11-kit/rpc-transport.c: In function ‘rpc_socket_read’: p11-kit/rpc-transport.c:350:2: error: unknown type name ‘fd_set’ p11-kit/rpc-transport.c:416:4: warning: implicit declaration of function ‘FD_ZERO’ [-Wimplicit-function-declaration] Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> https://bugs.freedesktop.org/show_bug.cgi?id=93211
* p11-kit: Remove unused pointerPankaj2015-10-211-2/+0
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=92532
* p11-kit: Fix warnings related to use dangling pointerPankaj2015-10-201-2/+6
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=92551
* p11-kit: 'int' comparison with 'unsigned int' in for() for array indexPankaj2015-10-191-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=92445
* p11-kit: Fix expression 'call_id < 0' is always falsePankaj2015-10-121-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=92434
* Fix build on Mingw due to missing EWOULDBLOCKLew Palm2015-07-141-0/+3
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=89081
* Added p11_kit_module_get_filename()Nikos Mavrogiannopoulos2015-07-143-1/+85
| | | | | | | | | | | That function allows to obtain the filename used by the PKCS #11 module. That is the filename used by dlopen(). Note that we don't provide p11_kit_module_for_filename() because it would have to deal with filename equivalences. Signed-off-by: Stef Walter <stefw@redhat.com> * Fixed up whitespace
* In proxy module don't call C_Finalize on a forked process.Nikos Mavrogiannopoulos2015-06-291-6/+13
| | | | | | | | | | | | This corrects a deadlock on the forked process. The deadlock happened because the proxy called C_Finalize prior to a C_Initialize which is wrong according to PKCS #11 (2.40). This patch eliminates the C_Finalize call in that case. This resolves #90289 https://bugs.freedesktop.org/show_bug.cgi?id=90289 Reviewed-by: Stef Walter <stefw@redhat.com>
* Add test case for bug 90289 (deadlock on C_Initialize() in child after fork)David Woodhouse2015-06-291-0/+57
| | | | Reviewed-by: Stef Walter <stefw@redhat.com>
* Do not deinitialize libffi's wrapper functionsNikos Mavrogiannopoulos2015-06-291-0/+11
| | | | | | | | Libffi uses shared memory to store them, and a deallocation in a child will cause issues for the parent or vice versa. Signed-off-by: Stef Walter <stefw@redhat.com> * Use #if to comment out code, avoid compiler warnings
* Added test case for crash after a fork in proxy moduleNikos Mavrogiannopoulos2015-06-291-1/+45
| | | | Reviewed-by: Stef Walter <stefw@redhat.com>
* p11-kit: Missing unlock in function rpc_socket_read()Pankaj2015-06-031-1/+3
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=90827
* Generate URIs compliant to the PKCS#11 URI draft in LCNikos Mavrogiannopoulos2015-02-202-14/+14
| | | | | | | | | | | | We continue to accept both the older style 'object-type' field in addition to the new 'type' field. However we start generating URIs in the new form. In other words we have backwards compatibility, but not forwards compatibility. Given the fact that PKCS#11 URIs are now standardizing this is an acceptable compromise. https://bugs.freedesktop.org/show_bug.cgi?id=86474
* Added test for pin-valueNikos Mavrogiannopoulos2015-02-201-0/+54
| | | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=87582 Signed-off-by: Stef Walter <stefw@redhat.com> * Added test for bad encoded pin-value in uri
* Added support for pin-value PKCS#11 URI elementNikos Mavrogiannopoulos2015-02-202-0/+57
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=87582
* p11-kit: Remove duplicate WHITESPACE defineStef Walter2015-02-201-5/+3
|
* uri: Accept 'type' in additon to 'object-type' in PKCS#11 URIsStef Walter2014-11-142-2/+30
| | | | This was a later change to the PKCS#11 specification drafts
* Unbreak build on OpenBSDAntoine Jacoutot2014-10-061-0/+5
| | | | | | | Add missing header for strdup(3). When EPROTO is not available, fallback to EIO. https://bugs.freedesktop.org/show_bug.cgi?id=84665
* p11-kit: Use pthread_atfork() in a safe mannerStef Walter2014-10-036-117/+49
| | | | | | | | | | | | | Instead of trying to perform actions in pthread_atfork() which are not async-signal-safe, just increment a counter so we can later tell if the process has forked. Note this does not make it safe to mix threads and forking without immediately execing. This is a far broader problem that p11-kit, however we now do the right thing when fork+exec is used from a thread. https://bugs.freedesktop.org/show_bug.cgi?id=84567
* remote: Run separate executable binary for 'p11-kit remote'Stef Walter2014-10-024-157/+163
| | | | | This allows security frameworks like SELinux or AppArmor to target it specifically.
* p11-kit: P11_KIT_PRIVATEDIR env var overrides private binary dirStef Walter2014-10-022-1/+7
| | | | | | External binaries are searched for in $(libdir)/p11-kit. The P11_KIT_PRIVATEDIR can be used to override that, for example during 'make check'
* p11-kit: Remove the 'isolated' option for nowStef Walter2014-10-011-13/+0
| | | | | | This option was not completed in time, and as implemented suffers from limitations that the module is not really completely isolated as it still runs under the same user id as the calling process.
* common: New public pkcs11x.h header containing extensionsStef Walter2014-09-101-1/+1
| | | | | | | Move our internal stuff to pkcs11i.h, and install the pkcs11x.h header containing extensions. https://bugs.freedesktop.org/show_bug.cgi?id=83495
* p11-kit: Fix tests when building with MinGWMichael Cronenworth2014-09-093-0/+30
| | | | Signed-off-by: Michael Cronenworth <mike@cchtml.com>
* p11-kit: Compilation fixes for previous commitStef Walter2014-09-091-4/+1
| | | | Pushed the wrong version
* p11-kit: Make proxy module respect critical = noStef Walter2014-09-091-37/+47
| | | | | | | The p11-kit-proxy.so module would not respect the critical = no setting in module configuration, and fail if any module failed to initialize. https://bugs.freedesktop.org/show_bug.cgi?id=83651
* Fix build without debugRoman Bogorodskiy2014-09-091-0/+2
| | | | | | | | | | | | | When building without debug build fails with: CCLD p11-kit/p11-kit ./.libs/libp11-kit.so: undefined reference to `P11_RPC_CHECK_CALLS' cc: error: linker command failed with exit code 1 (use -v to see invocation) gmake[2]: *** [p11-kit/p11-kit] Error 1 This happens because P11_RPC_CHECK_CALLS is not defined when debugging is enabled, so provide a noop macro for that case.
* Move to non-recursive Makefile for building bins and libsStef Walter2014-08-1545-196/+201
| | | | Still use recursive for documentation and translation.
* p11-kit: Fix various noise/issues highlighted by clangStef Walter2014-08-114-13/+13
|
* p11-kit: Remove use after free in debug output code pathStef Walter2014-08-081-1/+1
|