| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 PRInt32 copied = PR_GetErrorText(error_text.get()); | 72 PRInt32 copied = PR_GetErrorText(error_text.get()); |
| 73 result = std::string(error_text.get(), copied); | 73 result = std::string(error_text.get(), copied); |
| 74 } else { | 74 } else { |
| 75 result = base::StringPrintf("NSS error code: %d", PR_GetError()); | 75 result = base::StringPrintf("NSS error code: %d", PR_GetError()); |
| 76 } | 76 } |
| 77 return result; | 77 return result; |
| 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 = file_util::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 (!file_util::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; |
| (...skipping 708 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 |