pkcs11-tool: Do not use unitialized data when C_GetTokenInfo() failed

This commit is contained in:
Jakub Jelen 2017-04-12 17:43:32 +02:00 committed by Frank Morgner
parent 7214516547
commit 1ca09b8f10
1 changed files with 3 additions and 0 deletions

View File

@ -1105,6 +1105,9 @@ static void show_token(CK_SLOT_ID slot)
if (rv == CKR_TOKEN_NOT_RECOGNIZED) {
printf(" (token not recognized)\n");
return;
} else if (rv != CKR_OK) {
printf("C_GetTokenInfo() failed: rv = %s\n", CKR2Str(rv));
return;
}
if (!(info.flags & CKF_TOKEN_INITIALIZED) && (!verbose)) {
printf(" token state: uninitialized\n");