pkcs11: ignore login error when traversing tokens
authorDaiki Ueno <dueno@redhat.com>
Wed, 19 Jun 2019 15:21:16 +0000 (17:21 +0200)
committerDaiki Ueno <dueno@redhat.com>
Thu, 11 Jul 2019 04:39:33 +0000 (06:39 +0200)
commitfa5147c86941512921282b84819b896a0d4f29bb
tree5c3f22cd9b7483f27d5642fd1dde284d8a9ba5e1
parentd9984ccf8dde873f7b2632979989675eb900871a
pkcs11: ignore login error when traversing tokens

If a token is a general access device, it is expected that login
attempt to that token returns error:
https://github.com/p11-glue/p11-kit/blob/master/trust/module.c#L852

On the other hand, _pkcs11_traverse_tokens treats the error as fatal
and stops iteration.  This behavior prevents object search without
token specifier if such tokens are registered in the system.

Reported by Stanislav Zidek in
https://bugzilla.redhat.com/show_bug.cgi?id=1705478

Signed-off-by: Daiki Ueno <dueno@redhat.com>
.gitignore
lib/pkcs11.c
tests/Makefile.am
tests/p11-kit-load.sh
tests/pkcs11/list-objects.c [new file with mode: 0644]