From de42deaae10dd0a198b61902169c7f4e2cb8e6da Mon Sep 17 00:00:00 2001 From: Pawel Boguslawski Date: Tue, 15 Dec 2015 20:09:03 +0100 Subject: [PATCH] Fix smartcard certificate removal and update This patch fixes bug found in opensc 0.14.0-2 (Debian 8) that blocks certificate update and removal on Athena ASEPCOS smartcard with error Failed to update certificate: Security status not satisfied OpenSC tries to get the parent's 'DELETE' access before cert removal and leaves path variable pointing to dir not file to be removed. Author-Change-Id: IB#1047758 --- src/pkcs15init/pkcs15-lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkcs15init/pkcs15-lib.c b/src/pkcs15init/pkcs15-lib.c index 5375ee2a..a4f338a5 100644 --- a/src/pkcs15init/pkcs15-lib.c +++ b/src/pkcs15init/pkcs15-lib.c @@ -599,6 +599,7 @@ sc_pkcs15init_delete_by_path(struct sc_profile *profile, struct sc_pkcs15_card * LOG_TEST_RET(ctx, rv, "'DELETE' authentication failed"); /* Reselect file to delete: current path could be changed by 'verify PIN' procedure */ + path = *file_path; rv = sc_select_file(p15card->card, &path, &file); LOG_TEST_RET(ctx, rv, "cannot select file to delete");