| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <plarena.h> | 9 #include <plarena.h> |
| 10 #include <prerror.h> | 10 #include <prerror.h> |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 std::vector<std::string> libs; | 604 std::vector<std::string> libs; |
| 605 libs.push_back("libsoftokn3.so"); | 605 libs.push_back("libsoftokn3.so"); |
| 606 libs.push_back("libfreebl3.so"); | 606 libs.push_back("libfreebl3.so"); |
| 607 | 607 |
| 608 // For each combination of library file and path, check for existence and | 608 // For each combination of library file and path, check for existence and |
| 609 // then load. | 609 // then load. |
| 610 size_t loaded = 0; | 610 size_t loaded = 0; |
| 611 for (size_t i = 0; i < libs.size(); ++i) { | 611 for (size_t i = 0; i < libs.size(); ++i) { |
| 612 for (size_t j = 0; j < paths.size(); ++j) { | 612 for (size_t j = 0; j < paths.size(); ++j) { |
| 613 FilePath path = paths[j].Append(libs[i]); | 613 FilePath path = paths[j].Append(libs[i]); |
| 614 base::NativeLibrary lib = base::LoadNativeLibrary(path); | 614 base::NativeLibrary lib = base::LoadNativeLibrary(path, NULL); |
| 615 if (lib) { | 615 if (lib) { |
| 616 ++loaded; | 616 ++loaded; |
| 617 break; | 617 break; |
| 618 } | 618 } |
| 619 } | 619 } |
| 620 } | 620 } |
| 621 | 621 |
| 622 if (loaded == libs.size()) { | 622 if (loaded == libs.size()) { |
| 623 VLOG(3) << "NSS libraries loaded."; | 623 VLOG(3) << "NSS libraries loaded."; |
| 624 } else { | 624 } else { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 | 697 |
| 698 PK11SlotInfo* GetPublicNSSKeySlot() { | 698 PK11SlotInfo* GetPublicNSSKeySlot() { |
| 699 return g_nss_singleton.Get().GetPublicNSSKeySlot(); | 699 return g_nss_singleton.Get().GetPublicNSSKeySlot(); |
| 700 } | 700 } |
| 701 | 701 |
| 702 PK11SlotInfo* GetPrivateNSSKeySlot() { | 702 PK11SlotInfo* GetPrivateNSSKeySlot() { |
| 703 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); | 703 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); |
| 704 } | 704 } |
| 705 | 705 |
| 706 } // namespace crypto | 706 } // namespace crypto |
| OLD | NEW |