- implemented erase_card

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@666 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2002-06-18 18:18:05 +00:00
parent eeac475aa3
commit 3c44cb8710
1 changed files with 15 additions and 1 deletions

View File

@ -27,12 +27,26 @@
#include "pkcs15-init.h" #include "pkcs15-init.h"
#include "profile.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 * Initialize the Application DF
*/ */
static int cflex_init_app(struct sc_profile *profile, struct sc_card *card, 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) 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 */ /* Create the application DF */
if (sc_pkcs15init_create_file(profile, card, profile->df_info->file)) if (sc_pkcs15init_create_file(profile, card, profile->df_info->file))
return 1; return 1;
@ -400,7 +414,7 @@ err:
} }
struct sc_pkcs15init_operations sc_pkcs15init_cflex_operations = { struct sc_pkcs15init_operations sc_pkcs15init_cflex_operations = {
NULL, cflex_erase_card,
cflex_init_app, cflex_init_app,
cflex_new_pin, cflex_new_pin,
cflex_new_key, cflex_new_key,