From 3bca63c39ca212f5cd2a2cca82b686783ff7187b Mon Sep 17 00:00:00 2001 From: Trevor Bentley Date: Tue, 19 Sep 2017 15:00:04 +0200 Subject: [PATCH] yubico-piv-tool: use ykpiv_util_delete_cert --- tool/yubico-piv-tool.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tool/yubico-piv-tool.c b/tool/yubico-piv-tool.c index adde591..e082fbc 100644 --- a/tool/yubico-piv-tool.c +++ b/tool/yubico-piv-tool.c @@ -985,15 +985,7 @@ static bool change_pin(ykpiv_state *state, enum enum_action action, const char * } static bool delete_certificate(ykpiv_state *state, enum enum_slot slot) { - int object = get_object_id(slot); - - if(ykpiv_save_object(state, object, NULL, 0) != YKPIV_OK) { - fprintf(stderr, "Failed deleting object.\n"); - return false; - } else { - fprintf(stderr, "Certificate deleted.\n"); - return true; - } + return ykpiv_util_delete_cert(state, get_slot_hex(slot)) == YKPIV_OK; } static bool read_certificate(ykpiv_state *state, enum enum_slot slot,