OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "crypto/nss_util.h" | 5 #include "crypto/nss_util.h" |
6 #include "crypto/nss_util_internal.h" | 6 #include "crypto/nss_util_internal.h" |
7 | 7 |
8 #include <nss.h> | 8 #include <nss.h> |
9 #include <pk11pub.h> | 9 #include <pk11pub.h> |
10 #include <plarena.h> | 10 #include <plarena.h> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 #if defined(USE_NSS) | 80 #if defined(USE_NSS) |
81 base::FilePath GetDefaultConfigDirectory() { | 81 base::FilePath GetDefaultConfigDirectory() { |
82 base::FilePath dir = base::GetHomeDir(); | 82 base::FilePath dir = base::GetHomeDir(); |
83 if (dir.empty()) { | 83 if (dir.empty()) { |
84 LOG(ERROR) << "Failed to get home directory."; | 84 LOG(ERROR) << "Failed to get home directory."; |
85 return dir; | 85 return dir; |
86 } | 86 } |
87 dir = dir.AppendASCII(".pki").AppendASCII("nssdb"); | 87 dir = dir.AppendASCII(".pki").AppendASCII("nssdb"); |
88 if (!file_util::CreateDirectory(dir)) { | 88 if (!base::CreateDirectory(dir)) { |
89 LOG(ERROR) << "Failed to create " << dir.value() << " directory."; | 89 LOG(ERROR) << "Failed to create " << dir.value() << " directory."; |
90 dir.clear(); | 90 dir.clear(); |
91 } | 91 } |
92 return dir; | 92 return dir; |
93 } | 93 } |
94 | 94 |
95 // On non-Chrome OS platforms, return the default config directory. On Chrome OS | 95 // On non-Chrome OS platforms, return the default config directory. On Chrome OS |
96 // test images, return a read-only directory with fake root CA certs (which are | 96 // test images, return a read-only directory with fake root CA certs (which are |
97 // used by the local Google Accounts server mock we use when testing our login | 97 // used by the local Google Accounts server mock we use when testing our login |
98 // code). On Chrome OS non-test images (where the read-only directory doesn't | 98 // code). On Chrome OS non-test images (where the read-only directory doesn't |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 801 |
802 PK11SlotInfo* GetPublicNSSKeySlot() { | 802 PK11SlotInfo* GetPublicNSSKeySlot() { |
803 return g_nss_singleton.Get().GetPublicNSSKeySlot(); | 803 return g_nss_singleton.Get().GetPublicNSSKeySlot(); |
804 } | 804 } |
805 | 805 |
806 PK11SlotInfo* GetPrivateNSSKeySlot() { | 806 PK11SlotInfo* GetPrivateNSSKeySlot() { |
807 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); | 807 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); |
808 } | 808 } |
809 | 809 |
810 } // namespace crypto | 810 } // namespace crypto |
OLD | NEW |