Skip to content

Commit

Permalink
feat(pkcs11-tool): remove useless calls to token in show_dobj()
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreGonzalo authored and frankmorgner committed Jun 12, 2024
1 parent 1fc50da commit 82e8216
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/tools/pkcs11-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -5531,6 +5531,8 @@ static void show_dobj(CK_SESSION_HANDLE sess, CK_OBJECT_HANDLE obj)
char *application;
CK_ULONG size = 0;
CK_TOKEN_INFO info;
CK_BBOOL modifiable = 0;
CK_BBOOL private = 0;

suppress_warn = 1;
printf("Data object %u\n", (unsigned int) obj);
Expand Down Expand Up @@ -5570,11 +5572,13 @@ static void show_dobj(CK_SESSION_HANDLE sess, CK_OBJECT_HANDLE obj)
}

printf(" flags: ");
if (getMODIFIABLE(sess, obj))
modifiable = getMODIFIABLE(sess, obj);
if (modifiable)
printf(" modifiable");
if (getPRIVATE(sess, obj))
private = getPRIVATE(sess, obj);
if (private)
printf(" private");
if (!getMODIFIABLE(sess, obj) && !getPRIVATE(sess, obj))
if (!modifiable && !private)
printf("<empty>");
printf("\n");

Expand Down

0 comments on commit 82e8216

Please sign in to comment.