missed as part of last checkin, hack needed when certs come out of crypto context or cache

This commit is contained in:
ian.mcgreer%sun.com 2001-12-14 18:50:49 +00:00
Родитель 9a08a0a740
Коммит 6f2d3b5cd6
1 изменённых файлов: 11 добавлений и 2 удалений

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

@ -421,8 +421,17 @@ loser:
/* need to dupe since caller expects new cert */
return CERT_DupCertificate(cert);
} else {
/* this is the only instance */
return STAN_GetCERTCertificate(chain[1]);
CERTCertificate *rvc;
/* XXX hack - if this is the only instance, return it, otherwise
* the cert came out of the cache or a crypto context, in
* which case it needs to be duped
*/
if (!chain[1]->decoding) {
return STAN_GetCERTCertificate(chain[1]);
} else {
rvc = STAN_GetCERTCertificate(chain[1]);
return CERT_DupCertificate(rvc);
}
}
}
return NULL;