From 35a569bd83c7e10322f4c121f53a109a937c5506 Mon Sep 17 00:00:00 2001 From: HenryJacques Date: Mon, 20 Jul 2015 10:14:38 +0200 Subject: [PATCH] Allow to use more than one token This is needed if the first is not usable --- lib/hx509/ks_p11.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hx509/ks_p11.c b/lib/hx509/ks_p11.c index 899fb6cb1..627f7b76d 100644 --- a/lib/hx509/ks_p11.c +++ b/lib/hx509/ks_p11.c @@ -931,10 +931,10 @@ p11_init(hx509_context context, for (i = 0; i < p->num_slots; i++) { ret = p11_init_slot(context, p, lock, slot_ids[i], i, &p->slot[i]); - if (ret) - break; - if (p->slot[i].flags & P11_TOKEN_PRESENT) - num_tokens++; + if (!ret) { + if (p->slot[i].flags & P11_TOKEN_PRESENT) + num_tokens++; + } } free(slot_ids); if (ret)