pkcs11-tool: handle non-recognized tokens gracefully.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4803 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
fad0116fef
commit
364ba4882d
|
@ -802,9 +802,13 @@ static void list_slots(int tokens, int refresh, int print)
|
||||||
static void show_token(CK_SLOT_ID slot)
|
static void show_token(CK_SLOT_ID slot)
|
||||||
{
|
{
|
||||||
CK_TOKEN_INFO info;
|
CK_TOKEN_INFO info;
|
||||||
|
CK_RV rv;
|
||||||
get_token_info(slot, &info);
|
|
||||||
|
rv = p11->C_GetTokenInfo(slot, &info);
|
||||||
|
if (rv == CKR_TOKEN_NOT_RECOGNIZED) {
|
||||||
|
printf(" (token not recognized)\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!(info.flags & CKF_TOKEN_INITIALIZED) && (!verbose)) {
|
if (!(info.flags & CKF_TOKEN_INITIALIZED) && (!verbose)) {
|
||||||
printf(" token state: uninitialized\n");
|
printf(" token state: uninitialized\n");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue