fix for 90510, listing individual certs from token

This commit is contained in:
mcgreer%netscape.com 2001-07-24 19:26:53 +00:00
Родитель 9af5075ffd
Коммит 867a310a99
1 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -511,6 +511,7 @@ printCertCB(CERTCertificate *cert, void *arg)
{
SECStatus rv;
SECItem data;
CERTCertTrust *trust = (CERTCertTrust *)arg;
data.data = cert->derCert.data;
data.len = cert->derCert.len;
@ -521,8 +522,13 @@ printCertCB(CERTCertificate *cert, void *arg)
SECU_PrintError(progName, "problem printing certificate");
return(SECFailure);
}
SECU_PrintTrustFlags(stdout, &cert->dbEntry->trust,
"Certificate Trust Flags", 1);
if (trust) {
SECU_PrintTrustFlags(stdout, trust,
"Certificate Trust Flags", 1);
} else {
SECU_PrintTrustFlags(stdout, &cert->dbEntry->trust,
"Certificate Trust Flags", 1);
}
printf("\n");
@ -581,7 +587,17 @@ listCerts(CERTCertDBHandle *handle, char *name, PK11SlotInfo *slot,
/* List certs on a non-internal slot. */
if (PK11_NeedLogin(slot))
PK11_Authenticate(slot, PR_TRUE, pwarg);
rv = PK11_TraverseCertsInSlot(slot, SECU_PrintCertNickname, stdout);
if (name) {
CERTCertificate *the_cert;
the_cert = PK11_FindCertFromNickname(name, NULL);
if (!the_cert) {
SECU_PrintError(progName, "Could not find: %s\n", name);
return SECFailure;
}
rv = printCertCB(the_cert, the_cert->trust);
} else {
rv = PK11_TraverseCertsInSlot(slot, SECU_PrintCertNickname, stdout);
}
if (rv) {
SECU_PrintError(progName, "problem printing certificate nicknames");
return SECFailure;