OLD | NEW |
---|---|
1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
3 * | 3 * |
4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
8 * | 8 * |
9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1051 } | 1051 } |
1052 return rv; | 1052 return rv; |
1053 } | 1053 } |
1054 | 1054 |
1055 net::CertType GetCertType(CERTCertificate *cert) { | 1055 net::CertType GetCertType(CERTCertificate *cert) { |
1056 nsNSSCertTrust trust(cert->trust); | 1056 nsNSSCertTrust trust(cert->trust); |
1057 if (cert->nickname && trust.HasAnyUser()) | 1057 if (cert->nickname && trust.HasAnyUser()) |
1058 return net::USER_CERT; | 1058 return net::USER_CERT; |
1059 if (trust.HasAnyCA()) | 1059 if (trust.HasAnyCA()) |
1060 return net::CA_CERT; | 1060 return net::CA_CERT; |
1061 if (CERT_IsCACert(cert, NULL)) | |
1062 return net::CA_CERT; | |
wtc
2012/03/28 19:36:05
I suggest combining these two:
if (trust.HasAnyC
mattm
2012/03/29 00:24:45
Done.
| |
1061 if (trust.HasPeer(PR_TRUE, PR_FALSE, PR_FALSE)) | 1063 if (trust.HasPeer(PR_TRUE, PR_FALSE, PR_FALSE)) |
1062 return net::SERVER_CERT; | 1064 return net::SERVER_CERT; |
1063 if (CERT_IsCACert(cert, NULL)) | |
1064 return net::CA_CERT; | |
1065 return net::UNKNOWN_CERT; | 1065 return net::UNKNOWN_CERT; |
1066 } | 1066 } |
1067 | 1067 |
1068 } // namespace mozilla_security_manager | 1068 } // namespace mozilla_security_manager |
OLD | NEW |