| 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 19 matching lines...) Expand all Loading... |
| 30 * use your version of this file under the terms of the MPL, indicate your | 30 * use your version of this file under the terms of the MPL, indicate your |
| 31 * decision by deleting the provisions above and replace them with the notice | 31 * decision by deleting the provisions above and replace them with the notice |
| 32 * and other provisions required by the GPL or the LGPL. If you do not delete | 32 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 33 * the provisions above, a recipient may use your version of this file under | 33 * the provisions above, a recipient may use your version of this file under |
| 34 * the terms of any one of the MPL, the GPL or the LGPL. | 34 * the terms of any one of the MPL, the GPL or the LGPL. |
| 35 * | 35 * |
| 36 * ***** END LICENSE BLOCK ***** */ | 36 * ***** END LICENSE BLOCK ***** */ |
| 37 | 37 |
| 38 #include "chrome/third_party/mozilla_security_manager/nsUsageArrayHelper.h" | 38 #include "chrome/third_party/mozilla_security_manager/nsUsageArrayHelper.h" |
| 39 | 39 |
| 40 #include "base/macros.h" |
| 40 #include "chrome/grit/generated_resources.h" | 41 #include "chrome/grit/generated_resources.h" |
| 41 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
| 42 | 43 |
| 43 namespace mozilla_security_manager { | 44 namespace mozilla_security_manager { |
| 44 | 45 |
| 45 void GetCertUsageStrings(CERTCertificate* cert, std::vector<std::string>* out) { | 46 void GetCertUsageStrings(CERTCertificate* cert, std::vector<std::string>* out) { |
| 46 SECCertificateUsage usages = 0; | 47 SECCertificateUsage usages = 0; |
| 47 // TODO(wtc): See if we should use X509Certificate::Verify instead. | 48 // TODO(wtc): See if we should use X509Certificate::Verify instead. |
| 48 if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), cert, PR_TRUE, | 49 if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), cert, PR_TRUE, |
| 49 certificateUsageCheckAllUsages, | 50 certificateUsageCheckAllUsages, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 64 }; | 65 }; |
| 65 for (size_t i = 0; i < arraysize(usage_string_map); ++i) { | 66 for (size_t i = 0; i < arraysize(usage_string_map); ++i) { |
| 66 if (usages & usage_string_map[i].usage) | 67 if (usages & usage_string_map[i].usage) |
| 67 out->push_back(l10n_util::GetStringUTF8( | 68 out->push_back(l10n_util::GetStringUTF8( |
| 68 usage_string_map[i].string_id)); | 69 usage_string_map[i].string_id)); |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 } | 72 } |
| 72 | 73 |
| 73 } // namespace mozilla_security_manager | 74 } // namespace mozilla_security_manager |
| OLD | NEW |