remove unneeded hack, put in a couple of error checks

This commit is contained in:
ian.mcgreer%sun.com 2001-12-20 16:50:22 +00:00
Родитель b743921b82
Коммит 401e82cad4
2 изменённых файлов: 6 добавлений и 5 удалений

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

@ -205,11 +205,6 @@ __CERT_NewTempCertificate(CERTCertDBHandle *handle, SECItem *derCert,
}
context = STAN_GetDefaultCryptoContext();
NSSCryptoContext_ImportCertificate(context, c);
/* This is a hack to work around the fact that an instance of the cert
* doesn't really exist until the import
*/
cc->nssCertificate = NULL;
cc = STAN_GetCERTCertificate(c);
return cc;
loser:
nssArena_Destroy(arena);

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

@ -412,6 +412,10 @@ loser:
nssUsage.nss3usage = usage;
nssUsage.nss3lookingForCA = PR_TRUE;
memset(chain, 0, 3*sizeof(NSSCertificate *));
if (!me) {
PORT_SetError (SEC_ERROR_BAD_DATABASE);
return NULL;
}
(void)NSSCertificate_BuildChain(me, nssTime, &nssUsage, NULL,
chain, 2, NULL, &status);
nss_ZFreeIf(nssTime);
@ -433,6 +437,8 @@ loser:
return CERT_DupCertificate(rvc);
}
}
} else {
PORT_SetError (SEC_ERROR_UNKNOWN_ISSUER);
}
return NULL;
#endif