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

Side by Side Diff: chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more refactoring Created 7 years 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
OLDNEW
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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 spki->subjectPublicKey.data, spki->subjectPublicKey.len); 1040 spki->subjectPublicKey.data, spki->subjectPublicKey.len);
1041 break; 1041 break;
1042 } 1042 }
1043 SECKEY_DestroyPublicKey(key); 1043 SECKEY_DestroyPublicKey(key);
1044 } 1044 }
1045 return rv; 1045 return rv;
1046 } 1046 }
1047 1047
1048 net::CertType GetCertType(CERTCertificate *cert) { 1048 net::CertType GetCertType(CERTCertificate *cert) {
1049 CERTCertTrust trust = {0}; 1049 CERTCertTrust trust = {0};
1050 // XXX should use NSSCertDatabase to get trust for proper profile slot?
1050 CERT_GetCertTrust(cert, &trust); 1051 CERT_GetCertTrust(cert, &trust);
1051 1052
1052 unsigned all_flags = trust.sslFlags | trust.emailFlags | 1053 unsigned all_flags = trust.sslFlags | trust.emailFlags |
1053 trust.objectSigningFlags; 1054 trust.objectSigningFlags;
1054 1055
1055 if (cert->nickname && (all_flags & CERTDB_USER)) 1056 if (cert->nickname && (all_flags & CERTDB_USER))
1056 return net::USER_CERT; 1057 return net::USER_CERT;
1057 if ((all_flags & CERTDB_VALID_CA) || CERT_IsCACert(cert, NULL)) 1058 if ((all_flags & CERTDB_VALID_CA) || CERT_IsCACert(cert, NULL))
1058 return net::CA_CERT; 1059 return net::CA_CERT;
1059 // TODO(mattm): http://crbug.com/128633. 1060 // TODO(mattm): http://crbug.com/128633.
1060 if (trust.sslFlags & CERTDB_TERMINAL_RECORD) 1061 if (trust.sslFlags & CERTDB_TERMINAL_RECORD)
1061 return net::SERVER_CERT; 1062 return net::SERVER_CERT;
1062 return net::OTHER_CERT; 1063 return net::OTHER_CERT;
1063 } 1064 }
1064 1065
1065 } // namespace mozilla_security_manager 1066 } // namespace mozilla_security_manager
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/certificate_manager_handler.cc ('k') | net/cert/cert_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698