зеркало из https://github.com/mozilla/gecko-dev.git
enhance certificate categorization: bug 193960 r=ssaux/nelsonb sr=brendan
This commit is contained in:
Родитель
a7166e9ccd
Коммит
c1e600678f
|
@ -542,23 +542,14 @@ ProcessSingleExtension(CERTCertExtension *extension,
|
||||||
PRUint32
|
PRUint32
|
||||||
getCertType(CERTCertificate *cert)
|
getCertType(CERTCertificate *cert)
|
||||||
{
|
{
|
||||||
char *nick = cert->nickname;
|
|
||||||
char *email = cert->emailAddr;
|
|
||||||
nsNSSCertTrust trust(cert->trust);
|
nsNSSCertTrust trust(cert->trust);
|
||||||
/*
|
if (cert->nickname && trust.HasAnyUser())
|
||||||
fprintf(stderr, "====> nick: %s email: %s has-any-user: %d hash-any-ca: %d has-peer100: %d has-peer001: %d\n",
|
return nsIX509Cert::USER_CERT;
|
||||||
nick, email, (nick) ? trust.HasAnyUser() : 0, (nick) ? trust.HasAnyCA() : 0, (nick) ? trust.HasPeer(PR_TRUE, PR_FALSE, PR_FALSE) : 0,
|
if (trust.HasAnyCA() || CERT_IsCACert(cert,NULL))
|
||||||
(email) ? trust.HasPeer(PR_FALSE, PR_TRUE, PR_FALSE) : 0 );
|
return nsIX509Cert::CA_CERT;
|
||||||
*/
|
if (trust.HasPeer(PR_TRUE, PR_FALSE, PR_FALSE))
|
||||||
if (nick) {
|
return nsIX509Cert::SERVER_CERT;
|
||||||
if (trust.HasAnyUser())
|
if (cert->emailAddr)
|
||||||
return nsIX509Cert::USER_CERT;
|
|
||||||
if (trust.HasAnyCA() || CERT_IsCACert(cert,NULL))
|
|
||||||
return nsIX509Cert::CA_CERT;
|
|
||||||
if (trust.HasPeer(PR_TRUE, PR_FALSE, PR_FALSE))
|
|
||||||
return nsIX509Cert::SERVER_CERT;
|
|
||||||
}
|
|
||||||
if (email && trust.HasPeer(PR_FALSE, PR_TRUE, PR_FALSE))
|
|
||||||
return nsIX509Cert::EMAIL_CERT;
|
return nsIX509Cert::EMAIL_CERT;
|
||||||
return nsIX509Cert::UNKNOWN_CERT;
|
return nsIX509Cert::SERVER_CERT;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче