bug 90518, selfserv dumps cache state before shutdown with -y option

This commit is contained in:
ian.mcgreer%sun.com 2002-02-02 19:39:48 +00:00
Родитель 7eee4af254
Коммит cee0e72c0a
3 изменённых файлов: 29 добавлений и 2 удалений

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

@ -1411,6 +1411,7 @@ main(int argc, char **argv)
PLOptState *optstate;
PLOptStatus status;
PRThread *loggerThread;
PRBool debugCache = PR_FALSE; /* bug 90518 */
#ifdef LINUX /* bug 119340 */
struct sigaction act;
@ -1435,7 +1436,7 @@ main(int argc, char **argv)
** numbers, then capital letters, then lower case, alphabetical.
*/
optstate = PL_CreateOptState(argc, argv,
"2:3DL:M:RTc:d:f:hi:lmn:op:rt:vw:x");
"2:3DL:M:RTc:d:f:hi:lmn:op:rt:vw:xy");
while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
++optionsFound;
switch(optstate->option) {
@ -1495,6 +1496,8 @@ main(int argc, char **argv)
case 'x': useExportPolicy = PR_TRUE; break;
case 'y': debugCache = PR_TRUE; break;
default:
case '?':
fprintf(stderr, "Unrecognized or bad option specified.\n");
@ -1674,6 +1677,22 @@ main(int argc, char **argv)
VLOG(("selfserv: server_thread: exiting"));
{
int i;
for (i=0; i<kt_kea_size; i++) {
if (cert[i]) {
CERT_DestroyCertificate(cert[i]);
}
if (privKey[i]) {
SECKEY_DestroyPrivateKey(privKey[i]);
}
}
}
if (debugCache) {
nss_DumpCertificateCacheInfo();
}
NSS_Shutdown();
PR_Cleanup();
printf("selfserv: normal termination\n");

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

@ -632,6 +632,8 @@ NSS_Get_SEC_UTF8StringTemplate;
PK11_ImportDERPrivateKeyInfoAndReturnKey;
PK11_ImportPrivateKeyInfoAndReturnKey;
SECKEY_DecodeDERSubjectPublicKeyInfo;
;+# for debugging
nss_DumpCertificateCacheInfo;
;+ local:
;+ *;
;+};

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

@ -32,7 +32,7 @@
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: nss.h,v 1.16 2002/01/23 04:42:20 relyea%netscape.com Exp $
* $Id: nss.h,v 1.17 2002/02/02 19:39:45 ian.mcgreer%sun.com Exp $
*/
#ifndef __nss_h_
@ -142,6 +142,12 @@ void PK11_ConfigurePKCS11(const char *man, const char *libdes,
const char *pslotdes, const char *fslotdes, const char *fpslotdes,
int minPwd, int pwRequired);
/*
* Dump the contents of the certificate cache and the temporary cert store.
* Use to detect leaked references of certs at shutdown time.
*/
void nss_DumpCertificateCacheInfo();
SEC_END_PROTOS
#endif /* __nss_h_ */