]> granicus.if.org Git - p11-kit/log
p11-kit
5 years agomodules: check gl.modules before iterates on it when freeing
Stefano Garzarella [Wed, 27 Feb 2019 11:25:20 +0000 (12:25 +0100)]
modules: check gl.modules before iterates on it when freeing

In some circumstances, as described in the BZ, can happen that
free_modules_when_no_refs_unlocked() is called multiple times
when the module destructor is invoked.
We should check gl.modules before iterates on it in the
free_modules_when_no_refs_unlocked() functions, to avoid
a SIGSEGV.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1680963

5 years agotrust: Ignore unreadable content in anchors
Daiki Ueno [Mon, 18 Feb 2019 13:53:49 +0000 (14:53 +0100)]
trust: Ignore unreadable content in anchors

This amends eb503f3a1467f21a5ecc9ae84ae23b216afc102f.  Instead of
failing C_FindObjectsInit, treat any errors internally and accumulates
the successfully loaded certificates.

Reported by Andrej Kvasnica in:
https://bugzilla.redhat.com/show_bug.cgi?id=1675441

5 years agoextract-jks: Prefer _p11_extract_jks_timestamp to SOURCE_DATE_EPOCH
Daiki Ueno [Mon, 28 Jan 2019 12:03:15 +0000 (13:03 +0100)]
extract-jks: Prefer _p11_extract_jks_timestamp to SOURCE_DATE_EPOCH

Give _p11_extract_jks_timestamp precedence over SOURCE_DATE_EPOCH so
that the test results are not affected by the envvar settings.

6 years agoRelease 0.23.15 0.23.15
Daiki Ueno [Mon, 14 Jan 2019 16:31:58 +0000 (17:31 +0100)]
Release 0.23.15

6 years agopem: Fix assert condition
Daiki Ueno [Fri, 11 Jan 2019 09:35:16 +0000 (10:35 +0100)]
pem: Fix assert condition

If the PEM header is "-----BEGIN -----", *type should be an empty
string and the parser shouldn't fail.  Reported by Han Han in:
https://bugzilla.redhat.com/show_bug.cgi?id=1665172

6 years agotest: Add test that exercises duplicated certs in JKS
Daiki Ueno [Wed, 9 Jan 2019 14:44:48 +0000 (15:44 +0100)]
test: Add test that exercises duplicated certs in JKS

6 years agotrust: Fix alias generation in JKS extractor
Daiki Ueno [Wed, 9 Jan 2019 12:58:30 +0000 (13:58 +0100)]
trust: Fix alias generation in JKS extractor

When there is a duplicate, the JKS extractor previously assigned
somewhat obscure name "-<digit>" (not "<name>-<digit>").

6 years agotrust: Continue parsing if the file cannot be read as persist format
Daiki Ueno [Tue, 25 Dec 2018 07:32:19 +0000 (08:32 +0100)]
trust: Continue parsing if the file cannot be read as persist format

A corrupted file that contains "[p11-kit-object-v1]" can be a valid
PEM certs file.  Continue with the next format if it cannot be read as
a persistent format.

6 years agotrust: p11_token_load: Treat parse error as failure
Daiki Ueno [Tue, 25 Dec 2018 06:38:26 +0000 (07:38 +0100)]
trust: p11_token_load: Treat parse error as failure

Those conditions can happen when the trust file is corrupted, so it
makes more sense to treat them as a failure instead of programmer
error.

6 years agotrust: Fail if trust anchors are not loaded from a file
Daiki Ueno [Tue, 25 Dec 2018 06:32:01 +0000 (07:32 +0100)]
trust: Fail if trust anchors are not loaded from a file

If the trust path is a file, treat parse error as fatal and abort the
C_FindObjectsInit call.

6 years agotrust: Propagate library verbosity to module through init_args
Daiki Ueno [Sun, 23 Dec 2018 13:11:00 +0000 (14:11 +0100)]
trust: Propagate library verbosity to module through init_args

Previously, even when the -v option is used with the 'trust' command,
the messages from p11-kit-trust.so module were suppressed because the
verbosity setting is not propagated to the module.

6 years agobuild: Fix typo spotted by codespell
Daiki Ueno [Sat, 29 Dec 2018 07:09:50 +0000 (08:09 +0100)]
build: Fix typo spotted by codespell

6 years agodoc: Make log-calls match the rest of the document style
Jakub Jelen [Thu, 6 Dec 2018 14:55:04 +0000 (15:55 +0100)]
doc: Make log-calls match the rest of the document style

6 years agobuild: Simplify assertions
Daiki Ueno [Fri, 23 Nov 2018 06:47:30 +0000 (07:47 +0100)]
build: Simplify assertions

Let it leak memory when we assert, so not to confuse static analyzers
as if this is the normal case.

6 years agotravis: Add cppcheck profile
Daiki Ueno [Thu, 22 Nov 2018 16:19:21 +0000 (17:19 +0100)]
travis: Add cppcheck profile

6 years agotravis: Allow profile override
Daiki Ueno [Thu, 22 Nov 2018 16:14:35 +0000 (17:14 +0100)]
travis: Allow profile override

6 years agobuild: Suppress cppcheck errors
Daiki Ueno [Thu, 22 Nov 2018 15:19:52 +0000 (16:19 +0100)]
build: Suppress cppcheck errors

6 years agotests: Ensure p11_proxy_module_cleanup is called
Daiki Ueno [Mon, 22 Oct 2018 04:05:00 +0000 (06:05 +0200)]
tests: Ensure p11_proxy_module_cleanup is called

Reported and suggested in #197.

6 years agourl: Prefer upper-case letters in hex characters when encoding
Daiki Ueno [Mon, 15 Oct 2018 12:57:16 +0000 (14:57 +0200)]
url: Prefer upper-case letters in hex characters when encoding

This makes it more compliant with RFC 3986, where the use of
upper-case letters is recommended (as "SHOULD").

Suggested by Sumit Bose.

6 years agotrust/extract-jks.c: also honor SOURCE_DATE_EPOCH time
Harald Hoyer [Fri, 2 Nov 2018 09:38:43 +0000 (10:38 +0100)]
trust/extract-jks.c: also honor SOURCE_DATE_EPOCH time

For reproducible builds, accept a define timestamp for the java
keystore.

See https://reproducible-builds.org/docs/source-date-epoch/

6 years agobuild: Require pkg.m4 >= 0.29 at bootstrap
Daiki Ueno [Tue, 30 Oct 2018 15:00:12 +0000 (16:00 +0100)]
build: Require pkg.m4 >= 0.29 at bootstrap

6 years agovirtual: Prefer fixed closures to libffi closures
Daiki Ueno [Fri, 19 Oct 2018 08:21:36 +0000 (10:21 +0200)]
virtual: Prefer fixed closures to libffi closures

On some circumstances (such as when loading p11-kit-proxy from httpd),
it is known that creation of libffi closure always fails, due to
SELinux policy.  Although this is harmless, it pollutes the journal
and gives wrong hints when troubleshooting.  This patch changes the
order of preference of libffi vs pre-compiled closures to avoid that.

6 years agotrust: Check index->buckets is allocated on cleanup
Daiki Ueno [Wed, 17 Oct 2018 07:53:46 +0000 (09:53 +0200)]
trust: Check index->buckets is allocated on cleanup

6 years agorpc-server: Check calloc failure
Daiki Ueno [Wed, 17 Oct 2018 07:53:27 +0000 (09:53 +0200)]
rpc-server: Check calloc failure

6 years agotrust: Set umask before calling mkstemp
Daiki Ueno [Tue, 16 Oct 2018 16:20:12 +0000 (18:20 +0200)]
trust: Set umask before calling mkstemp

6 years agoproxy: Fix null dereference when reusing slots
Daiki Ueno [Tue, 16 Oct 2018 16:18:05 +0000 (18:18 +0200)]
proxy: Fix null dereference when reusing slots

6 years agorpc-server: p11_kit_remote_serve_tokens: Fix memleak
Daiki Ueno [Tue, 16 Oct 2018 16:16:51 +0000 (18:16 +0200)]
rpc-server: p11_kit_remote_serve_tokens: Fix memleak

6 years agobuild: Check return value of p11_rpc_buffer_get_uint64
Daiki Ueno [Tue, 16 Oct 2018 16:16:12 +0000 (18:16 +0200)]
build: Check return value of p11_rpc_buffer_get_uint64

6 years agobuild: Check return value of p11_dict_set
Daiki Ueno [Tue, 16 Oct 2018 16:14:46 +0000 (18:14 +0200)]
build: Check return value of p11_dict_set

6 years agobuild: Free memory before return{,_val}_if_* macros
Daiki Ueno [Tue, 16 Oct 2018 16:10:05 +0000 (18:10 +0200)]
build: Free memory before return{,_val}_if_* macros

6 years agobuild: Call va_end() always when leaving the function
Daiki Ueno [Tue, 16 Oct 2018 16:06:56 +0000 (18:06 +0200)]
build: Call va_end() always when leaving the function

6 years agodebug: Work around cppcheck false-positives
Daiki Ueno [Tue, 16 Oct 2018 16:05:10 +0000 (18:05 +0200)]
debug: Work around cppcheck false-positives

https://trac.cppcheck.net/ticket/8794

6 years agocommon: use /proc only on Linux
Leonardo Brondani Schenkel [Mon, 28 May 2018 14:18:05 +0000 (16:18 +0200)]
common: use /proc only on Linux

Non-Linux systems do not have /proc, so do not attempt to open it and
eliminate an unnecessary access() syscall on those systems.

6 years agopkcs11: Don't redefine CKM_CAMELLIA_KEY_GEN
Daiki Ueno [Fri, 31 Aug 2018 08:25:26 +0000 (10:25 +0200)]
pkcs11: Don't redefine CKM_CAMELLIA_KEY_GEN

Also reorder the CKM_CAMELLIA_* definitions.

6 years agoRelease 0.23.14 0.23.14
Daiki Ueno [Tue, 28 Aug 2018 13:33:32 +0000 (15:33 +0200)]
Release 0.23.14

6 years agovirtual: Tighten error handling when fixed closures are exhausted
Daiki Ueno [Wed, 22 Aug 2018 11:47:03 +0000 (13:47 +0200)]
virtual: Tighten error handling when fixed closures are exhausted

6 years agovirtual: Don't be too loud about recoverable failure
Daiki Ueno [Wed, 22 Aug 2018 11:41:38 +0000 (13:41 +0200)]
virtual: Don't be too loud about recoverable failure

6 years agotrust: Factor out module initialization into separate file
Daiki Ueno [Fri, 24 Aug 2018 15:42:16 +0000 (17:42 +0200)]
trust: Factor out module initialization into separate file

This prevents double call to p11_library_init() in test-module.c, once
from the ELF constructor, and secondly from the test itself.

6 years agocommon: Factor out common initializer code into a header
Daiki Ueno [Mon, 27 Aug 2018 10:57:51 +0000 (12:57 +0200)]
common: Factor out common initializer code into a header

6 years agotravis: Manually install cpp-coveralls
Daiki Ueno [Fri, 24 Aug 2018 15:10:20 +0000 (17:10 +0200)]
travis: Manually install cpp-coveralls

To accommodate the gcov format change in gcc 8.1:
https://github.com/eddyxu/cpp-coveralls/pull/127
which is not yet available in the pip version.

6 years agotravis: Check valgrind exit code more strictly
Daiki Ueno [Thu, 23 Aug 2018 16:39:14 +0000 (18:39 +0200)]
travis: Check valgrind exit code more strictly

6 years agoREADME.md: Add CII Best Practices badge
Daiki Ueno [Tue, 21 Aug 2018 10:48:26 +0000 (12:48 +0200)]
README.md: Add CII Best Practices badge

6 years agoREADME.md: Mention contact method for security issues
Daiki Ueno [Tue, 21 Aug 2018 09:32:47 +0000 (11:32 +0200)]
README.md: Mention contact method for security issues

6 years agoRevert "build: Explicitly link threaded test programs to libpthread"
Daiki Ueno [Fri, 17 Aug 2018 10:34:08 +0000 (12:34 +0200)]
Revert "build: Explicitly link threaded test programs to libpthread"

This reverts commit dc4a6eaddbb36a344cc6a9c7eb12cab9df4899b0.

6 years agoRevert "build: Stop linking the library with libpthread when possible"
Daiki Ueno [Fri, 17 Aug 2018 10:29:28 +0000 (12:29 +0200)]
Revert "build: Stop linking the library with libpthread when possible"

This reverts commit 50f8906e63c9413a7687bab6608496d83c29a222.

6 years agoRevert "common: Prefer __register_atfork() to pthread_atfork() if possible"
Daiki Ueno [Fri, 17 Aug 2018 10:29:15 +0000 (12:29 +0200)]
Revert "common: Prefer __register_atfork() to pthread_atfork() if possible"

This reverts commit ce3cec7f8742254b8627b9db48973b81e91cbfc8.

6 years agoRevert "build: Link to libpthread, if pthread_atfork() needs to be used"
Daiki Ueno [Fri, 17 Aug 2018 10:29:03 +0000 (12:29 +0200)]
Revert "build: Link to libpthread, if pthread_atfork() needs to be used"

This reverts commit 541d79cb651cfd3238b9aa41fce70208df8e9496.

6 years agoUpdate pkcs11 header to allow SoftHSMv2 to compile
Alexander Bokovoy [Tue, 14 Aug 2018 08:49:08 +0000 (11:49 +0300)]
Update pkcs11 header to allow SoftHSMv2 to compile

Replace vendor-specific values with the IDs from PKCS11 v3.0 for those
constants that were already standardized.

6 years agotravis: Check that proxy module can be loaded and unloaded
Daiki Ueno [Mon, 13 Aug 2018 13:25:10 +0000 (15:25 +0200)]
travis: Check that proxy module can be loaded and unloaded

6 years agoproxy: Avoid invalid memory access when unloading proxy module
Daiki Ueno [Mon, 13 Aug 2018 13:23:03 +0000 (15:23 +0200)]
proxy: Avoid invalid memory access when unloading proxy module

When loading and unloading p11-kit-proxy.so with pkcs11-tool, it
accesses already free'd memory area:

$ valgrind pkcs11-tool --module p11-kit-proxy.so -L
==25173== Invalid read of size 8
==25173==    at 0x64BF493: p11_proxy_module_cleanup (proxy.c:1724)
==25173==    by 0x64BD028: _p11_kit_fini (proxy-init.c:65)
==25173==    by 0x401477C: _dl_close_worker (in /usr/lib64/ld-2.27.so)
==25173==    by 0x4014E1D: _dl_close (in /usr/lib64/ld-2.27.so)
==25173==    by 0x5E08C4E: _dl_catch_exception (in /usr/lib64/libc-2.27.so)
==25173==    by 0x5E08CDE: _dl_catch_error (in /usr/lib64/libc-2.27.so)
==25173==    by 0x58B1724: _dlerror_run (in /usr/lib64/libdl-2.27.so)
==25173==    by 0x58B1113: dlclose (in /usr/lib64/libdl-2.27.so)
==25173==    by 0x11E5A7: ??? (in /usr/bin/pkcs11-tool)
==25173==    by 0x110023: ??? (in /usr/bin/pkcs11-tool)
==25173==    by 0x5CF624A: (below main) (in /usr/lib64/libc-2.27.so)
==25173==  Address 0x61231c8 is 552 bytes inside a block of size 584 free'd
==25173==    at 0x4C2FDAC: free (vg_replace_malloc.c:530)
==25173==    by 0x6548492: p11_virtual_unwrap (virtual.c:2902)
==25173==    by 0x64BF492: p11_proxy_module_cleanup (proxy.c:1723)

6 years agobuild: Link to libpthread, if pthread_atfork() needs to be used 0.23.13
Daiki Ueno [Fri, 10 Aug 2018 14:45:07 +0000 (16:45 +0200)]
build: Link to libpthread, if pthread_atfork() needs to be used

On non-glibc systems (e.g., FreeBSD), pthread_atfork() stub is
provided as a nop and our fork detection mechanism doesn't work.  Pull
in the actual implementation from libpthread in that case.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
6 years agobuild: Don't install systemd unit files when "make distcheck"
Daiki Ueno [Fri, 10 Aug 2018 12:26:26 +0000 (14:26 +0200)]
build: Don't install systemd unit files when "make distcheck"

6 years agoRelease 0.23.13
Daiki Ueno [Fri, 10 Aug 2018 10:59:50 +0000 (12:59 +0200)]
Release 0.23.13

6 years agocommon: Prefer __register_atfork() to pthread_atfork() if possible
Daiki Ueno [Thu, 9 Aug 2018 15:45:37 +0000 (17:45 +0200)]
common: Prefer __register_atfork() to pthread_atfork() if possible

6 years agobuild: Stop linking the library with libpthread when possible
Daiki Ueno [Fri, 13 Jul 2018 06:37:34 +0000 (08:37 +0200)]
build: Stop linking the library with libpthread when possible

6 years agocommon: Use thread-local storage class when possible
Daiki Ueno [Fri, 20 Jul 2018 09:43:15 +0000 (11:43 +0200)]
common: Use thread-local storage class when possible

This eliminates the unconditional use of pthread_{get,set}specific()
and pthread_key_{create,delete}(), which glibc doesn't provide the stubs.

6 years agobuild: Explicitly link threaded test programs to libpthread
Daiki Ueno [Fri, 20 Jul 2018 11:22:14 +0000 (13:22 +0200)]
build: Explicitly link threaded test programs to libpthread

Some test programs use pthread_create(), which glibc doesn't provide
the stub.  Link those programs with -lpthread.

6 years agocommon, p11-kit, trust: Use pthread_once only when necessary
Daiki Ueno [Fri, 20 Jul 2018 11:11:36 +0000 (13:11 +0200)]
common, p11-kit, trust: Use pthread_once only when necessary

If the ELF constructor is usable, we don't really need the once-init
function because it is guaranteed that the code runs only once in the
constructor.

6 years agocommon: Use static mutex initializer when possible
Daiki Ueno [Fri, 20 Jul 2018 09:24:48 +0000 (11:24 +0200)]
common: Use static mutex initializer when possible

This eliminates the use of pthread_mutexattr_* functions, which glibc
doesn't provide the stubs.

6 years agoserver: Avoid FD leak in error cases
Daiki Ueno [Wed, 1 Aug 2018 13:24:20 +0000 (15:24 +0200)]
server: Avoid FD leak in error cases

Spotted by coverity.

6 years agotrust: Clarify C_Login behavior that returns an error
Daiki Ueno [Thu, 19 Jul 2018 09:01:31 +0000 (11:01 +0200)]
trust: Clarify C_Login behavior that returns an error

6 years agoproxy: Fail early if there is no slot mappings
Daiki Ueno [Tue, 10 Jul 2018 14:57:07 +0000 (16:57 +0200)]
proxy: Fail early if there is no slot mappings

6 years agotravis: Install pip for coveralls
Daiki Ueno [Mon, 9 Jul 2018 16:18:02 +0000 (18:18 +0200)]
travis: Install pip for coveralls

6 years agorpc-server: p11_kit_remote_serve_tokens: Allow exporting all modules
Daiki Ueno [Wed, 27 Jun 2018 14:31:54 +0000 (16:31 +0200)]
rpc-server: p11_kit_remote_serve_tokens: Allow exporting all modules

This patch removes the restriction of p11_kit_remote_serve_tokens()
that were not capable of serving tokens across multiple modules.

6 years agobuild: Use separate p11-kit-{remote,server} executable for testing
Daiki Ueno [Wed, 27 Jun 2018 09:22:44 +0000 (11:22 +0200)]
build: Use separate p11-kit-{remote,server} executable for testing

Otherwise, the p11-kit-remote program called from p11-kit-server would
load the system modules instead of the local fixtures.

6 years agoproxy: Allow proxy to be created from the library
Daiki Ueno [Mon, 25 Jun 2018 15:17:41 +0000 (17:17 +0200)]
proxy: Allow proxy to be created from the library

Previously, to aggregate multiple modules into one, there was no other
way than loading the proxy module.  From the p11-kit applications,
however, it is not possible to load that module because of the
recursive loading check (p11_proxy_module_check).

This patch adds another means to aggregate modules, through a library
function p11_proxy_module_create.

6 years agoproxy: Turn global variables module local
Daiki Ueno [Mon, 25 Jun 2018 15:09:26 +0000 (17:09 +0200)]
proxy: Turn global variables module local

6 years agobuild: Make reallocarray detection robuster
Daiki Ueno [Fri, 13 Jul 2018 15:39:35 +0000 (17:39 +0200)]
build: Make reallocarray detection robuster

On NetBSD, reallocarray is not declared until _OPENBSD_SOURCE is
defined.  Reported by Patrick Welche in:
https://lists.freedesktop.org/archives/p11-glue/2018-July/000691.html

6 years agoserver: Enable socket activation through systemd
Daiki Ueno [Wed, 20 Jun 2018 08:43:24 +0000 (10:43 +0200)]
server: Enable socket activation through systemd

This enables socket activation of "p11-kit server" through systemd.
The feature provided is essentially the same as commit
a4fb2bb5 (reverted), but implemented with "p11-kit server" and
libsystemd API instead of wrapping "p11-kit remote" in the unit file.

Note that, while it exposes all tokens through the socket, it doesn't
increase attack surface beyond the PKCS#11 binary interface provided
by p11-kit-proxy.so, because the service is per-user.

6 years agobuild: Ease issetugid() check when cross-compiling
Daiki Ueno [Thu, 31 May 2018 09:02:51 +0000 (11:02 +0200)]
build: Ease issetugid() check when cross-compiling

When cross-compiling, the configure check for issetugid() aborts,
because of the pessimistic default of AC_RUN_IFELSE.  This patch
provides the non-pessimistic default to AC_RUN_IFELSE and wrap the
macro invocation with AC_CACHE_CHECK so that the user can override the
check by setting ac_cv_issetugid_openbsd=yes, as suggested in:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Runtime.html#Runtime

6 years agoRelease 0.23.12 0.23.12
Daiki Ueno [Mon, 28 May 2018 14:07:37 +0000 (16:07 +0200)]
Release 0.23.12

6 years agotravis: Add build scripts for macOS
Daiki Ueno [Tue, 29 May 2018 11:29:51 +0000 (13:29 +0200)]
travis: Add build scripts for macOS

6 years agotravis: Use matrix
Daiki Ueno [Tue, 29 May 2018 10:37:57 +0000 (12:37 +0200)]
travis: Use matrix

6 years agotest: Avoid unnecessary memory allocation
Daiki Ueno [Tue, 29 May 2018 14:35:05 +0000 (16:35 +0200)]
test: Avoid unnecessary memory allocation

6 years agocommon: Fix runtime directory detection when given prefix is long
Daiki Ueno [Tue, 29 May 2018 14:37:07 +0000 (16:37 +0200)]
common: Fix runtime directory detection when given prefix is long

6 years agocommon: Don't rely on issetugid() when it is broken
Daiki Ueno [Tue, 29 May 2018 14:30:35 +0000 (16:30 +0200)]
common: Don't rely on issetugid() when it is broken

On macOS and FreeBSD, issetugid() has different semantics from the
original OpenBSD implementation and cannot reliably detect if the
process made setuid/setgid:
https://gist.github.com/nicowilliams/4daf74a3a0c86848d3cbd9d0cdb5e26e

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=67451
https://bugs.freedesktop.org/show_bug.cgi?id=100287

6 years agobuild: Don't use locale funcs if locale_t is not defined in locale.h
Daiki Ueno [Mon, 28 May 2018 11:33:32 +0000 (13:33 +0200)]
build: Don't use locale funcs if locale_t is not defined in locale.h

On macOS, locale_t is not defined in <locale.h>.  Although it is
defined in <xlocale.h>, we rather not use locales at all for POSIX
compliance.

6 years agopkcs11: Exercise GNU calling convention at compile time
Daiki Ueno [Mon, 28 May 2018 10:54:39 +0000 (12:54 +0200)]
pkcs11: Exercise GNU calling convention at compile time

6 years agobuild: Simplify README inclusion 0.23.11
Daiki Ueno [Fri, 25 May 2018 14:16:23 +0000 (16:16 +0200)]
build: Simplify README inclusion

Use symlink in the repository, instead of copying.

6 years agoNEWS: Mention latest changes
Daiki Ueno [Thu, 24 May 2018 08:06:38 +0000 (10:06 +0200)]
NEWS: Mention latest changes

6 years agobuild: Delay building mock-six.la until "make check"
Daiki Ueno [Fri, 25 May 2018 01:20:51 +0000 (03:20 +0200)]
build: Delay building mock-six.la until "make check"

6 years agobuild: Include README in the distribution
Daiki Ueno [Thu, 24 May 2018 14:30:43 +0000 (16:30 +0200)]
build: Include README in the distribution

As we removed README from the repository, it is no longer
automatically picked up for the distribution by Automake.

6 years agobuild: Fix ChangeLog generation
Daiki Ueno [Thu, 24 May 2018 14:29:37 +0000 (16:29 +0200)]
build: Fix ChangeLog generation

6 years agobuild: Remove obsolete upload rules
Daiki Ueno [Thu, 24 May 2018 08:03:51 +0000 (10:03 +0200)]
build: Remove obsolete upload rules

6 years agobuild: Include p11-kit/test-messages.sh in distribution
Daiki Ueno [Thu, 24 May 2018 08:02:31 +0000 (10:02 +0200)]
build: Include p11-kit/test-messages.sh in distribution

6 years agouri: Make scheme comparison case-insensitive
Daiki Ueno [Thu, 24 May 2018 09:12:21 +0000 (11:12 +0200)]
uri: Make scheme comparison case-insensitive

RFC 3986 suggests that implementations should accept uppercase letters
as equivalent to lowercase in scheme names.

6 years agocommon: Make case conversion locale independent
Daiki Ueno [Thu, 24 May 2018 09:01:33 +0000 (11:01 +0200)]
common: Make case conversion locale independent

The tolower()/toupper() functions take into account of the current
locale settings, which p11-kit doesn't want.  Add replacement
functions that work as if they are called under the C locale.

6 years agoImprove const correctness for P11KitUri
Nathaniel McCallum [Mon, 14 May 2018 18:58:56 +0000 (14:58 -0400)]
Improve const correctness for P11KitUri

This does not improve const for the getters. The reason for this is that
they are usually passed into the PKCS#11 APIs directly and these APIs
are not const correct. Trying to force const correctnesss here would
result in pain for library consumers.

This is an API and ABI compatible change.

6 years agoREADME: replace by README.md
Nikos Mavrogiannopoulos [Fri, 18 May 2018 12:24:23 +0000 (14:24 +0200)]
README: replace by README.md

That is, use README.md as primary source to generate README as
README is required by the GNU guidelines. We don't try to convert
to "real" plain text as markdown is readable, and to avoid introducing
another dependency (e.g., pandoc).

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agoNEWS: mark the 0.23 series as stable
Nikos Mavrogiannopoulos [Fri, 18 May 2018 12:20:29 +0000 (14:20 +0200)]
NEWS: mark the 0.23 series as stable

Resolves #80

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agoREADME.md: added reference to Daiki's key
Nikos Mavrogiannopoulos [Fri, 18 May 2018 12:19:29 +0000 (14:19 +0200)]
README.md: added reference to Daiki's key

Resolves #153

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
6 years agoRelease 0.23.11
Daiki Ueno [Mon, 7 May 2018 08:44:10 +0000 (10:44 +0200)]
Release 0.23.11

6 years agocommon: Pacify clang-analyzer
Daiki Ueno [Mon, 7 May 2018 12:25:57 +0000 (14:25 +0200)]
common: Pacify clang-analyzer

6 years agotrust: Avoid array overflow
Daiki Ueno [Mon, 7 May 2018 09:19:35 +0000 (11:19 +0200)]
trust: Avoid array overflow

6 years agotrust: Don't null terminate PKCS #11 string fields
Daiki Ueno [Mon, 7 May 2018 09:46:43 +0000 (11:46 +0200)]
trust: Don't null terminate PKCS #11 string fields

6 years agoproxy: Don't null terminate PKCS #11 string fields
Daiki Ueno [Mon, 7 May 2018 09:19:10 +0000 (11:19 +0200)]
proxy: Don't null terminate PKCS #11 string fields

6 years agotest: Avoid exceeding maximum pathname length of Unix socket
Daiki Ueno [Thu, 3 May 2018 15:29:40 +0000 (17:29 +0200)]
test: Avoid exceeding maximum pathname length of Unix socket

6 years agolibrary: Use dedicated locale object for printing error
Daiki Ueno [Fri, 27 Apr 2018 08:00:52 +0000 (10:00 +0200)]
library: Use dedicated locale object for printing error

6 years agoRevert "build: Check strerror_l() and uselocale() seperately"
Daiki Ueno [Fri, 27 Apr 2018 07:51:59 +0000 (09:51 +0200)]
Revert "build: Check strerror_l() and uselocale() seperately"

This reverts commit 173ad93cc54057886b2055f3d73ea64a047127d1.

We should rather use newlocale() when per-thread locale is not set.
Otherwise uselocale() could return LC_GLOBAL_LOCALE on some
platforms (e.g. musl-libc) and calling strerror_l() with it leads to
an undefined behavior.

6 years agobuild: Check strerror_l() and uselocale() seperately
Daiki Ueno [Thu, 19 Apr 2018 14:19:28 +0000 (16:19 +0200)]
build: Check strerror_l() and uselocale() seperately

NetBSD deliberately doesn't support per-thread locale and our
thread-safe replacement of strerror() using strerror_l() cannot be
used.  Fallback to strerror_r() in that case.