From 3cf56d8fb7f8a54a16eb89ca3230b07bf3f7e4be Mon Sep 17 00:00:00 2001 From: Viktor Tarasov Date: Sun, 10 May 2015 11:44:04 +0200 Subject: [PATCH] pkcs15init: fix non-unique-ID control --- src/pkcs15init/pkcs15-lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pkcs15init/pkcs15-lib.c b/src/pkcs15init/pkcs15-lib.c index 51a71b7a..6562dbc6 100644 --- a/src/pkcs15init/pkcs15-lib.c +++ b/src/pkcs15init/pkcs15-lib.c @@ -2332,8 +2332,12 @@ select_id(struct sc_pkcs15_card *p15card, int type, struct sc_pkcs15_id *id) /* If the user provided an ID, make sure we can use it */ if (id->len != 0) { r = sc_pkcs15_find_object_by_id(p15card, type, id, &obj); + if (r == SC_ERROR_OBJECT_NOT_FOUND) r = 0; + else if (!r) + r = SC_ERROR_NON_UNIQUE_ID; + LOG_FUNC_RETURN(ctx, r); }