]> granicus.if.org Git - p11-kit/log
p11-kit
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.

6 years agotravis: Optimize dnf install invocation
Daiki Ueno [Tue, 10 Apr 2018 15:40:24 +0000 (17:40 +0200)]
travis: Optimize dnf install invocation

6 years agotest: Add installcheck script to test trust module
Daiki Ueno [Tue, 10 Apr 2018 07:47:24 +0000 (09:47 +0200)]
test: Add installcheck script to test trust module

Currently it only checks that "disable-in: p11-kit-proxy" properly
prevents the trust module being loaded by the proxy module.

6 years agotrust: Prevent trust module being loaded by proxy module
Daiki Ueno [Tue, 10 Apr 2018 07:47:19 +0000 (09:47 +0200)]
trust: Prevent trust module being loaded by proxy module

Otherwise, when the proxy module were registerd in NSS database, the
trust module would be loaded twice and degrade search performance.

6 years agotravis: Run "make installcheck"
Daiki Ueno [Tue, 10 Apr 2018 07:47:12 +0000 (09:47 +0200)]
travis: Run "make installcheck"

6 years agotrust: Fix memleak in p11_enumerate_opt_filter
Daiki Ueno [Tue, 10 Apr 2018 07:47:06 +0000 (09:47 +0200)]
trust: Fix memleak in p11_enumerate_opt_filter

p11_kit_iter_add_filter() takes the ownership of given attributes.
Spotted by address sanitizer.

6 years agotest: Factor out common harness from test-extract.in
Daiki Ueno [Tue, 10 Apr 2018 07:46:56 +0000 (09:46 +0200)]
test: Factor out common harness from test-extract.in

6 years agotest: Add test for JKS extractor
Daiki Ueno [Sat, 31 Mar 2018 12:26:52 +0000 (14:26 +0200)]
test: Add test for JKS extractor

Piggybacking commit de963b96, this adds a multi-cert test case for the
Java keystore extractor.

6 years agotest: Add test for p11_attrs_purge()
Daiki Ueno [Thu, 5 Apr 2018 14:03:07 +0000 (16:03 +0200)]
test: Add test for p11_attrs_purge()

6 years agomock-module-ep: Properly override C_GetFunctionList
Daiki Ueno [Thu, 5 Apr 2018 13:11:09 +0000 (15:11 +0200)]
mock-module-ep: Properly override C_GetFunctionList

6 years agomodules: Add option to control module visibility from proxy
Daiki Ueno [Thu, 5 Apr 2018 09:14:39 +0000 (11:14 +0200)]
modules: Add option to control module visibility from proxy

This enables to control whether a module will be loaded from the proxy
module.  The configuration reuses the "enable-in" and "disable-in"
options, with a special literal "p11-kit-proxy" as the value.

6 years agotrust: add unit test for the "edk2-cacerts" extractor
Laszlo Ersek [Thu, 29 Mar 2018 19:32:24 +0000 (21:32 +0200)]
trust: add unit test for the "edk2-cacerts" extractor

Add a multi-cert test case for the edk2 extractor, heavily based on the
"/openssl/test_file_multiple" test case.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1559580
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
6 years agotrust: implement the "edk2-cacerts" extractor
Laszlo Ersek [Tue, 27 Mar 2018 15:28:11 +0000 (17:28 +0200)]
trust: implement the "edk2-cacerts" extractor

Extract the DER-encoded X.509 certificates in the EFI_SIGNATURE_LIST
format that is

- defined by the UEFI 2.7 spec (using one inner EFI_SIGNATURE_DATA object
  per EFI_SIGNATURE_LIST, as specified for EFI_CERT_X509_GUID),

- and expected by edk2's HttpDxe when it configures the certificate list
  for HTTPS boot from EFI_TLS_CA_CERTIFICATE_VARIABLE (see the
  TlsConfigCertificate() function in "NetworkPkg/HttpDxe/HttpsSupport.c").

The intended command line is

  p11-kit extract \
    --format=edk2-cacerts \
    --filter=ca-anchors \
    --overwrite \
    --purpose=server-auth \
    $DEST/edk2/cacerts.bin

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1559580
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
6 years agotrust: introduce the "edk2-cacerts" extractor skeleton
Laszlo Ersek [Tue, 27 Mar 2018 13:19:06 +0000 (15:19 +0200)]
trust: introduce the "edk2-cacerts" extractor skeleton

Introduce the p11_extract_edk2_cacerts() skeleton. At the moment it always
fails, silently.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1559580
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
6 years agomodules: Fix memleak in re-initialization case
Daiki Ueno [Thu, 29 Mar 2018 13:54:35 +0000 (15:54 +0200)]
modules: Fix memleak in re-initialization case

6 years agoTreat CKR_CRYPTOKI_ALREADY_INITIALIZED correctly
Justin King-Lacroix [Sat, 17 Mar 2018 02:37:24 +0000 (19:37 -0700)]
Treat CKR_CRYPTOKI_ALREADY_INITIALIZED correctly

In p11_kit_modules_initialize(), treat a return code
of CKR_CRYPTOKI_ALREADY_INITIALIZED as identical to
CKR_OK.

6 years agotravis: Disallow failure on mingw
Daiki Ueno [Thu, 29 Mar 2018 11:02:39 +0000 (13:02 +0200)]
travis: Disallow failure on mingw

6 years agotest: Add missing seven.module in Windows fixtures
Daiki Ueno [Thu, 29 Mar 2018 10:40:47 +0000 (12:40 +0200)]
test: Add missing seven.module in Windows fixtures

6 years agotravis: Use LOG_COMPILER to run tests under wine
Daiki Ueno [Thu, 29 Mar 2018 09:56:30 +0000 (11:56 +0200)]
travis: Use LOG_COMPILER to run tests under wine

6 years agobuild: Enable make check with wine
Daiki Ueno [Thu, 29 Mar 2018 09:56:18 +0000 (11:56 +0200)]
build: Enable make check with wine

6 years agocommon: Fix compilation of runtime.c under mingw
Daiki Ueno [Thu, 29 Mar 2018 08:28:59 +0000 (10:28 +0200)]
common: Fix compilation of runtime.c under mingw

6 years agotest: Add failing test for CKR_CRYPTOKI_ALREADY_INITIALIZED
Daiki Ueno [Tue, 27 Mar 2018 13:41:51 +0000 (15:41 +0200)]
test: Add failing test for CKR_CRYPTOKI_ALREADY_INITIALIZED

6 years agotest: Add test for error messages
Daiki Ueno [Wed, 7 Mar 2018 14:40:20 +0000 (15:40 +0100)]
test: Add test for error messages

6 years agotest: Use _exit() in child process to immediately close open FDs
Daiki Ueno [Wed, 28 Mar 2018 05:49:29 +0000 (07:49 +0200)]
test: Use _exit() in child process to immediately close open FDs

6 years agotest: Rewrite test-server.sh in TAP style
Daiki Ueno [Wed, 28 Mar 2018 05:50:30 +0000 (07:50 +0200)]
test: Rewrite test-server.sh in TAP style

6 years agotest: Take advantage of TAP test driver
Daiki Ueno [Tue, 27 Mar 2018 14:23:12 +0000 (16:23 +0200)]
test: Take advantage of TAP test driver

6 years agocommon: Add assert_skip() and assert_todo()
Daiki Ueno [Tue, 27 Mar 2018 13:19:07 +0000 (15:19 +0200)]
common: Add assert_skip() and assert_todo()

6 years agotest-server.sh: Fix bashism
Andreas Metzler [Tue, 27 Feb 2018 18:02:03 +0000 (19:02 +0100)]
test-server.sh: Fix bashism

6 years agoRelease 0.23.10 0.23.10
Daiki Ueno [Tue, 27 Feb 2018 11:32:35 +0000 (12:32 +0100)]
Release 0.23.10

6 years agomaint: Point to the new URLs
Daiki Ueno [Tue, 27 Feb 2018 11:31:42 +0000 (12:31 +0100)]
maint: Point to the new URLs

6 years agotest-server: Add test for detecting address
Daiki Ueno [Tue, 27 Feb 2018 13:57:45 +0000 (14:57 +0100)]
test-server: Add test for detecting address

6 years agotest-server: Fix compilation error on FreeBSD
Daiki Ueno [Tue, 27 Feb 2018 14:45:57 +0000 (15:45 +0100)]
test-server: Fix compilation error on FreeBSD

6 years agocommon, client: Move runtime directory detection to libp11-common
Daiki Ueno [Tue, 27 Feb 2018 13:56:33 +0000 (14:56 +0100)]
common, client: Move runtime directory detection to libp11-common

6 years agocommon: Make p11_test_directory_delete() work recursively
Daiki Ueno [Tue, 27 Feb 2018 13:57:20 +0000 (14:57 +0100)]
common: Make p11_test_directory_delete() work recursively

6 years agotest: Improve temporary directory handling
Daiki Ueno [Tue, 27 Feb 2018 15:05:41 +0000 (16:05 +0100)]
test: Improve temporary directory handling

6 years agop11_kit_remote_serve_tokens: Read "write-protected" setting from URI
Daiki Ueno [Mon, 5 Feb 2018 10:10:01 +0000 (11:10 +0100)]
p11_kit_remote_serve_tokens: Read "write-protected" setting from URI

6 years agofilter: Respect CKF_WRITE_PROTECTED setting when allowing a token
Daiki Ueno [Mon, 5 Feb 2018 10:57:17 +0000 (11:57 +0100)]
filter: Respect CKF_WRITE_PROTECTED setting when allowing a token

6 years agotest: Add test for client-server interaction
Daiki Ueno [Mon, 26 Feb 2018 10:44:01 +0000 (11:44 +0100)]
test: Add test for client-server interaction

The test spawns a process running the server command and connects to
it through p11-kit-client.so.  It's is a bit tricky that the child
process requires to preload libasan.so when ASan is in in effect, to
properly load a mock module.

6 years agoserver: Print envvars even when running in foreground
Daiki Ueno [Mon, 26 Feb 2018 16:27:44 +0000 (17:27 +0100)]
server: Print envvars even when running in foreground

6 years agotest-transport: Make sure to initialize addrlen given to accept
Daiki Ueno [Mon, 26 Feb 2018 13:53:12 +0000 (14:53 +0100)]
test-transport: Make sure to initialize addrlen given to accept

6 years agoclient: Fix memleaks in the module
Daiki Ueno [Mon, 26 Feb 2018 13:51:43 +0000 (14:51 +0100)]
client: Fix memleaks in the module

6 years agotest: Fix unconditional jump in test-proxy.c
Daiki Ueno [Mon, 26 Feb 2018 11:46:13 +0000 (12:46 +0100)]
test: Fix unconditional jump in test-proxy.c

6 years agodoc: Replace links to freedesktop.org to github pages
Daiki Ueno [Fri, 16 Feb 2018 17:22:44 +0000 (18:22 +0100)]
doc: Replace links to freedesktop.org to github pages

6 years agotrust: Forcibly mark "Default Trust" read-only
Daiki Ueno [Fri, 19 Jan 2018 14:22:16 +0000 (15:22 +0100)]
trust: Forcibly mark "Default Trust" read-only

The "Default Trust" token is typically mounted as $datadir, which is
considered as read-only on modern OSes.

Suggestd by Kai Engert in:
https://bugzilla.redhat.com/show_bug.cgi?id=1523630

6 years agopo: Update translations from transifex
Daiki Ueno [Wed, 31 Jan 2018 15:51:23 +0000 (16:51 +0100)]
po: Update translations from transifex

6 years agobuild: Add more files to .gitignore
Daiki Ueno [Wed, 31 Jan 2018 14:15:07 +0000 (15:15 +0100)]
build: Add more files to .gitignore

6 years agotravis: Exclude generated files from coverage
Daiki Ueno [Wed, 31 Jan 2018 09:33:54 +0000 (10:33 +0100)]
travis: Exclude generated files from coverage

6 years agobuild: Split out generated code from p11-kit/virtual.c
Daiki Ueno [Wed, 31 Jan 2018 09:27:43 +0000 (10:27 +0100)]
build: Split out generated code from p11-kit/virtual.c

6 years agotrust: Filter out duplicate extensions
Daiki Ueno [Wed, 31 Jan 2018 13:07:51 +0000 (14:07 +0100)]
trust: Filter out duplicate extensions

The trust policy module keeps all the objects in the database, while
PKIX doesn't allow multiple extensions identified by the same OID can
be attached to a certificate.  Add a check to C_FindObjects to exclude
any duplicates and only return the first matching object.

It would be better if the module rejects such duplicates when loading,
but it would make startup slower.

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

6 years agobuild: Delay compilation of test-related stuff
Daiki Ueno [Thu, 25 Jan 2018 12:00:06 +0000 (13:00 +0100)]
build: Delay compilation of test-related stuff

6 years agoproxy: Remove dead code
Daiki Ueno [Thu, 25 Jan 2018 10:43:52 +0000 (11:43 +0100)]
proxy: Remove dead code

Since the libffi became optional (commit 9f632bed), the fallback code
path in proxy.c has never taken.

6 years agoproxy: Reuse the existing slot ID mapping after fork
Daiki Ueno [Tue, 16 Jan 2018 15:17:22 +0000 (16:17 +0100)]
proxy: Reuse the existing slot ID mapping after fork

While the proxy module reassigns slot IDs in C_Initialize(), some
applications assume that valid slot IDs should never change across
multiple calls to C_Initialize().  This patch mitigates this by
preserving the slot IDs, if they are known to the proxy module.

6 years agoserver: Avoid null-dereference of timespec value on timeout
Daiki Ueno [Wed, 17 Jan 2018 12:23:28 +0000 (13:23 +0100)]
server: Avoid null-dereference of timespec value on timeout

Spotted by clang-analyzer.

7 years agoAdded p11-kit remoting page in manual
Nikos Mavrogiannopoulos [Fri, 22 Dec 2017 14:18:42 +0000 (15:18 +0100)]
Added p11-kit remoting page in manual

7 years agobuild: Add README.md to display build status
Daiki Ueno [Wed, 29 Nov 2017 09:30:38 +0000 (10:30 +0100)]
build: Add README.md to display build status

7 years agotravis: Exclude test programs from coveralls
Daiki Ueno [Tue, 28 Nov 2017 13:18:18 +0000 (14:18 +0100)]
travis: Exclude test programs from coveralls

7 years agotravis: Supply necessary envvars to container for coveralls
Daiki Ueno [Mon, 27 Nov 2017 16:05:14 +0000 (17:05 +0100)]
travis: Supply necessary envvars to container for coveralls

7 years agotravis: Use in-tree build for coverage
Daiki Ueno [Wed, 15 Nov 2017 11:51:40 +0000 (12:51 +0100)]
travis: Use in-tree build for coverage

The coverage tools (gcov, cpp-coveralls, etc) cannot detect source
files if the project is built out-of-tree.  Use the same directory for
$srcdir and $builddir for the build with --enable-coverage.

7 years agotest: Improve code coverage of filter.c
Daiki Ueno [Mon, 2 Oct 2017 09:36:20 +0000 (11:36 +0200)]
test: Improve code coverage of filter.c

7 years agotravis: Use coveralls for measuring coverage
Daiki Ueno [Mon, 2 Oct 2017 08:53:32 +0000 (10:53 +0200)]
travis: Use coveralls for measuring coverage

7 years agop11_kit_override_system_files: introduced new function
Nikos Mavrogiannopoulos [Mon, 30 Oct 2017 17:02:42 +0000 (18:02 +0100)]
p11_kit_override_system_files: introduced new function

That allows overriding the default module and configuration
locations, for use in test suites, etc.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agop11_kit_modules_load*: enhanced documentation on flags
Nikos Mavrogiannopoulos [Mon, 30 Oct 2017 17:07:12 +0000 (18:07 +0100)]
p11_kit_modules_load*: enhanced documentation on flags

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
7 years agobuild: Take advantage of parallel-tests
Daiki Ueno [Fri, 6 Oct 2017 12:21:32 +0000 (14:21 +0200)]
build: Take advantage of parallel-tests

7 years agoserver: Better shell integration
Daiki Ueno [Fri, 6 Oct 2017 08:58:50 +0000 (10:58 +0200)]
server: Better shell integration

This adds -k, -c, and -s options to the "p11-kit server" command,
which allows you to terminate the server process, select which C-shell
or Bourne shell command line is printed on startup, respectively.

7 years agoserver: Make it possible to eval envvar settings
Daiki Ueno [Thu, 5 Oct 2017 08:59:02 +0000 (10:59 +0200)]
server: Make it possible to eval envvar settings

Previously, calling "eval $(p11-kit server)" from shell hung because
the program didn't properly close stdout before forking.

7 years agoRelease 0.23.9
Daiki Ueno [Mon, 2 Oct 2017 13:03:01 +0000 (15:03 +0200)]
Release 0.23.9

7 years agotrust: Respect anyExtendedKeyUsage in CA certificates
Daiki Ueno [Fri, 18 Aug 2017 15:26:30 +0000 (17:26 +0200)]
trust: Respect anyExtendedKeyUsage in CA certificates

7 years agorpc: Fix crash when retrieving attribute length
Daiki Ueno [Wed, 27 Sep 2017 15:29:58 +0000 (17:29 +0200)]
rpc: Fix crash when retrieving attribute length

It is possible that NULL is given to the serializers, when
C_GetAttributeValue() just wants to know the size of an attribute.
Previously, this resulted in giving NULL to memcpy().

7 years agoserver: Make it work only when token URI is provided
Daiki Ueno [Tue, 26 Sep 2017 14:37:34 +0000 (16:37 +0200)]
server: Make it work only when token URI is provided

Previously, when "p11-kit server" started only with a token URI, it
couldn't properly find and initialize the module which provides the
token.  This was because of the wrong order of cleanup of the modules.

7 years agocommon: Re-add placeholder definition of p11_debug
Daiki Ueno [Fri, 18 Aug 2017 09:54:05 +0000 (11:54 +0200)]
common: Re-add placeholder definition of p11_debug

This was mistakenly removed in commit efe6dc56c.
Pointed by Lars Wendler in issue #97.

7 years agobuild: Include <stdint.h> for SIZE_MAX
Daiki Ueno [Wed, 16 Aug 2017 12:59:59 +0000 (14:59 +0200)]
build: Include <stdint.h> for SIZE_MAX

Fixes issue #95.

7 years agoRelease 0.23.8
Daiki Ueno [Mon, 14 Aug 2017 11:20:18 +0000 (13:20 +0200)]
Release 0.23.8

7 years agobuild: Include <stdint.h> for SIZE_MAX
Daiki Ueno [Tue, 15 Aug 2017 11:55:02 +0000 (13:55 +0200)]
build: Include <stdint.h> for SIZE_MAX

7 years agoclient: Fix order of cleanup
Daiki Ueno [Fri, 11 Aug 2017 13:39:20 +0000 (15:39 +0200)]
client: Fix order of cleanup

In C_GetFunctionList, state->virt is wrapped with a destroyer function
free().  Thus p11_rpc_transport_free must be called before
p11_virtual_unwrap.

7 years agotest: Add checks for duplicate vendor attributes
Daiki Ueno [Tue, 8 Aug 2017 12:52:44 +0000 (14:52 +0200)]
test: Add checks for duplicate vendor attributes

7 years agouri: Make vendor query attribute handling reliable
Daiki Ueno [Tue, 8 Aug 2017 12:52:41 +0000 (14:52 +0200)]
uri: Make vendor query attribute handling reliable

Previously we used p11_dict to keep track of vendor query attributes.
This had a couple of limitations: duplicate attributes are not allowed
while they are actually allowed in RFC 7512, and the order of
attributes is unpredictable.

This patch switches to using an array instead of p11_dict and ensures
that the attributes are sorted in alphabetical order.

Fixes #88.

7 years agocommon: New p11_array_insert function
Daiki Ueno [Tue, 8 Aug 2017 12:52:37 +0000 (14:52 +0200)]
common: New p11_array_insert function

7 years agocommon: Use reallocarray instead of realloc as appropriate
Daiki Ueno [Tue, 8 Aug 2017 12:52:24 +0000 (14:52 +0200)]
common: Use reallocarray instead of realloc as appropriate

reallocarray is a new POSIX function added in glibc 2.26, with
built-in overflow checks.  Take advantage of that function for
internal array allocation.

7 years agopkcs11.h: updated information
Nikos Mavrogiannopoulos [Tue, 1 Aug 2017 06:48:18 +0000 (08:48 +0200)]
pkcs11.h: updated information

The scute project no longer exists, and the PKCS#11 standard is
from OASIS group.

7 years agopkcs11.h: added OTP-related mechanisms
Nikos Mavrogiannopoulos [Tue, 1 Aug 2017 06:43:45 +0000 (08:43 +0200)]
pkcs11.h: added OTP-related mechanisms

7 years agopkcs11.h: added definitions of GOST CKA attributes
Nikos Mavrogiannopoulos [Tue, 1 Aug 2017 06:16:06 +0000 (08:16 +0200)]
pkcs11.h: added definitions of GOST CKA attributes

7 years agopkcs11.h: added definitions of GOST mechanisms
Nikos Mavrogiannopoulos [Mon, 31 Jul 2017 12:15:52 +0000 (14:15 +0200)]
pkcs11.h: added definitions of GOST mechanisms

This follows the definitions in PKCS#11 v2.40:
  http://docs.oasis-open.org/pkcs11/pkcs11-curr/v2.40/os/pkcs11-curr-v2.40-os.html

7 years agotest: Fix failure on 32-bit big endian platform
Daiki Ueno [Mon, 3 Jul 2017 13:40:16 +0000 (15:40 +0200)]
test: Fix failure on 32-bit big endian platform

The value given to p11_rpc_buffer_add_ulong_value() must be a pointer
of CK_ULONG.  Similarly, the value returned from
p11_rpc_buffer_get_ulong_value() must be converted to CK_ULONG before
comparison.

Reported by Andreas Metzler in:
https://lists.freedesktop.org/archives/p11-glue/2017-July/000665.html