Bug 938046 - Part 3. Iterate only through valid users on getchain r=dkeeler

This commit is contained in:
Camilo Viecco 2013-12-11 13:04:07 -08:00
Родитель e37fbe8375
Коммит c653f8bfb9
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -856,10 +856,18 @@ nsNSSCertificate::GetChain(nsIArray **_rvChain)
nullptr, /*XXX fixme*/
CertVerifier::FLAG_LOCAL_ONLY,
&pkixNssChain);
// This is the whitelist of all non-SSLServer usages that are supported by
// verifycert.
const int otherUsagesToTest = certificateUsageSSLClient |
certificateUsageSSLCA |
certificateUsageEmailSigner |
certificateUsageEmailRecipient |
certificateUsageObjectSigner |
certificateUsageStatusResponder;
for (int usage = certificateUsageSSLClient;
usage < certificateUsageAnyCA && !pkixNssChain;
usage = usage << 1) {
if (usage == certificateUsageSSLServer) {
if ((usage & otherUsagesToTest) == 0) {
continue;
}
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("pipnss: PKIX attempting chain(%d) for '%s'\n",usage, mCert->nickname));