- support for SO pin during app initialization

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@423 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2002-04-02 14:46:32 +00:00
parent f4ff4f4617
commit 776fa9030c
1 changed files with 12 additions and 3 deletions

View File

@ -323,13 +323,22 @@ connect(int reader)
static int
do_init_app(struct sc_profile *profile)
{
struct sc_pkcs15init_initargs args;
int r = 0;
if (opt_erase)
r = profile->ops->erase_card(profile, card);
if (r >= 0)
r = sc_pkcs15init_add_app(card, profile);
return r;
if (r < 0)
return r;
memset(&args, 0, sizeof(args));
args.so_pin = opt_pins[OPT_PIN2 & 3];
if (args.so_pin)
args.so_pin_len = strlen(args.so_pin);
args.so_puk = opt_pins[OPT_PUK2 & 3];
if (args.so_puk)
args.so_puk_len = strlen(args.so_puk);
return sc_pkcs15init_add_app(card, profile, &args);
}
/*