yubico-piv-tool: use ykpiv_util_delete_cert

This commit is contained in:
Trevor Bentley
2017-09-19 15:00:04 +02:00
parent ded78751a0
commit 3bca63c39c
+1 -9
View File
@@ -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) { static bool delete_certificate(ykpiv_state *state, enum enum_slot slot) {
int object = get_object_id(slot); return ykpiv_util_delete_cert(state, get_slot_hex(slot)) == YKPIV_OK;
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;
}
} }
static bool read_certificate(ykpiv_state *state, enum enum_slot slot, static bool read_certificate(ykpiv_state *state, enum enum_slot slot,