From 3c44cb8710519b973ce30bd401ccef3e612fdb71 Mon Sep 17 00:00:00 2001 From: okir Date: Tue, 18 Jun 2002 18:18:05 +0000 Subject: [PATCH] - implemented erase_card git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@666 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/pkcs15init/pkcs15-cflex.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/pkcs15init/pkcs15-cflex.c b/src/pkcs15init/pkcs15-cflex.c index 7f698eb1..9c3fc01a 100644 --- a/src/pkcs15init/pkcs15-cflex.c +++ b/src/pkcs15init/pkcs15-cflex.c @@ -27,12 +27,26 @@ #include "pkcs15-init.h" #include "profile.h" +/* + * Erase the card via rm -rf + */ +static int cflex_erase_card(struct sc_profile *profile, struct sc_card *card) +{ + return sc_pkcs15init_erase_card_recursively(card, profile, -1); +} + /* * Initialize the Application DF */ static int cflex_init_app(struct sc_profile *profile, struct sc_card *card, const u8 *pin, size_t pin_len, const u8 *puk, size_t puk_len) { + if (pin && pin_len) { + profile->cbs->error("Cryptoflex card driver doesn't " + "support SO PIN\n"); + return SC_ERROR_NOT_SUPPORTED; + } + /* Create the application DF */ if (sc_pkcs15init_create_file(profile, card, profile->df_info->file)) return 1; @@ -400,7 +414,7 @@ err: } struct sc_pkcs15init_operations sc_pkcs15init_cflex_operations = { - NULL, + cflex_erase_card, cflex_init_app, cflex_new_pin, cflex_new_key,