Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
From 88b20a6993493f03c24575e0011f277767ecae51 Mon Sep 17 00:00:00 2001
Bug 1162897, Include PKCS#11 URI in modutil output, r=rrelyea
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 17, 2016
1 parent 7d1c773 commit 4ef71ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/modutil/pk11.c
Expand Up @@ -397,6 +397,7 @@ static void
printModule(SECMODModule *module, int *count)
{
int slotCount = module->loaded ? module->slotCount : 0;
char *modUri;
int i;

if ((*count)++) {
Expand All @@ -408,6 +409,11 @@ printModule(SECMODModule *module, int *count)
PR_fprintf(PR_STDOUT, "\tlibrary name: %s\n", module->dllName);
}

modUri = PK11_GetModuleURI(module);
if (modUri) {
PR_fprintf(PR_STDOUT, "\t uri: %s\n", modUri);
PORT_Free(modUri);
}
if (slotCount == 0) {
PR_fprintf(PR_STDOUT,
"\t slots: There are no slots attached to this module\n");
Expand All @@ -425,10 +431,12 @@ printModule(SECMODModule *module, int *count)
/* Print slot and token names */
for (i = 0; i < slotCount; i++) {
PK11SlotInfo *slot = module->slots[i];

char *tokenUri = PK11_GetTokenURI(slot);
PR_fprintf(PR_STDOUT, "\n");
PR_fprintf(PR_STDOUT, "\t slot: %s\n", PK11_GetSlotName(slot));
PR_fprintf(PR_STDOUT, "\ttoken: %s\n", PK11_GetTokenName(slot));
PR_fprintf(PR_STDOUT, "\t uri: %s\n", tokenUri);
PORT_Free(tokenUri);
}
return;
}
Expand Down

0 comments on commit 4ef71ec

Please sign in to comment.