Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: net/base/cert_database_nss.cc

Issue 4310004: DOMUI Cert Manager: merge email certs into other certs tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp ('k') | net/base/cert_type.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/cert_database.h" 5 #include "net/base/cert_database.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <certdb.h> 8 #include <certdb.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <pk11pub.h> 10 #include <pk11pub.h>
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 LOG(ERROR) << "CERT_GetCertTrust failed with error " << PORT_GetError(); 161 LOG(ERROR) << "CERT_GetCertTrust failed with error " << PORT_GetError();
162 return UNTRUSTED; 162 return UNTRUSTED;
163 } 163 }
164 psm::nsNSSCertTrust trust(&nsstrust); 164 psm::nsNSSCertTrust trust(&nsstrust);
165 switch (type) { 165 switch (type) {
166 case CA_CERT: 166 case CA_CERT:
167 return trust.HasTrustedCA(PR_TRUE, PR_FALSE, PR_FALSE) * TRUSTED_SSL + 167 return trust.HasTrustedCA(PR_TRUE, PR_FALSE, PR_FALSE) * TRUSTED_SSL +
168 trust.HasTrustedCA(PR_FALSE, PR_TRUE, PR_FALSE) * TRUSTED_EMAIL + 168 trust.HasTrustedCA(PR_FALSE, PR_TRUE, PR_FALSE) * TRUSTED_EMAIL +
169 trust.HasTrustedCA(PR_FALSE, PR_FALSE, PR_TRUE) * TRUSTED_OBJ_SIGN; 169 trust.HasTrustedCA(PR_FALSE, PR_FALSE, PR_TRUE) * TRUSTED_OBJ_SIGN;
170 case SERVER_CERT: 170 case SERVER_CERT:
171 case EMAIL_CERT:
172 return trust.HasTrustedPeer(PR_TRUE, PR_FALSE, PR_FALSE) * TRUSTED_SSL + 171 return trust.HasTrustedPeer(PR_TRUE, PR_FALSE, PR_FALSE) * TRUSTED_SSL +
173 trust.HasTrustedPeer(PR_FALSE, PR_TRUE, PR_FALSE) * TRUSTED_EMAIL + 172 trust.HasTrustedPeer(PR_FALSE, PR_TRUE, PR_FALSE) * TRUSTED_EMAIL +
174 trust.HasTrustedPeer(PR_FALSE, PR_FALSE, PR_TRUE) * TRUSTED_OBJ_SIGN; 173 trust.HasTrustedPeer(PR_FALSE, PR_FALSE, PR_TRUE) * TRUSTED_OBJ_SIGN;
175 default: 174 default:
176 return UNTRUSTED; 175 return UNTRUSTED;
177 } 176 }
178 } 177 }
179 178
180 bool CertDatabase::SetCertTrust(const X509Certificate* cert, 179 bool CertDatabase::SetCertTrust(const X509Certificate* cert,
181 CertType type, 180 CertType type,
(...skipping 22 matching lines...) Expand all
204 } 203 }
205 return true; 204 return true;
206 } 205 }
207 206
208 bool CertDatabase::IsReadOnly(const X509Certificate* cert) const { 207 bool CertDatabase::IsReadOnly(const X509Certificate* cert) const {
209 PK11SlotInfo* slot = cert->os_cert_handle()->slot; 208 PK11SlotInfo* slot = cert->os_cert_handle()->slot;
210 return slot && PK11_IsReadOnly(slot); 209 return slot && PK11_IsReadOnly(slot);
211 } 210 }
212 211
213 } // namespace net 212 } // namespace net
OLDNEW
« no previous file with comments | « chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp ('k') | net/base/cert_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698