call sc_select_file only if pin->path is actually set
Thanks to Andrej Komelj <akomelj@email.si> git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1784 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
c35e006c34
commit
8147c22a93
|
@ -186,11 +186,14 @@ int sc_pkcs15_verify_pin(struct sc_pkcs15_card *p15card,
|
|||
card = p15card->card;
|
||||
r = sc_lock(card);
|
||||
SC_TEST_RET(card->ctx, r, "sc_lock() failed");
|
||||
/* the path in the pin object is optional */
|
||||
if (pin->path.len > 0) {
|
||||
r = sc_select_file(card, &pin->path, NULL);
|
||||
if (r) {
|
||||
sc_unlock(card);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize arguments */
|
||||
memset(&args, 0, sizeof(args));
|
||||
|
@ -254,11 +257,14 @@ int sc_pkcs15_change_pin(struct sc_pkcs15_card *p15card,
|
|||
card = p15card->card;
|
||||
r = sc_lock(card);
|
||||
SC_TEST_RET(card->ctx, r, "sc_lock() failed");
|
||||
/* the path in the pin object is optional */
|
||||
if (pin->path.len > 0) {
|
||||
r = sc_select_file(card, &pin->path, NULL);
|
||||
if (r) {
|
||||
sc_unlock(card);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
/* set pin_cmd data */
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
@ -317,11 +323,14 @@ int sc_pkcs15_unblock_pin(struct sc_pkcs15_card *p15card,
|
|||
card = p15card->card;
|
||||
r = sc_lock(card);
|
||||
SC_TEST_RET(card->ctx, r, "sc_lock() failed");
|
||||
/* the path in the pin object is optional */
|
||||
if (pin->path.len > 0) {
|
||||
r = sc_select_file(card, &pin->path, NULL);
|
||||
if (r) {
|
||||
sc_unlock(card);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
/* set pin_cmd data */
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
|
Loading…
Reference in New Issue