| 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 | 6 |
| 7 #include <nss.h> | 7 #include <nss.h> |
| 8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
| 9 #include <plarena.h> | 9 #include <plarena.h> |
| 10 #include <prerror.h> | 10 #include <prerror.h> |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 } | 796 } |
| 797 | 797 |
| 798 SECStatus status = NSS_Shutdown(); | 798 SECStatus status = NSS_Shutdown(); |
| 799 if (status != SECSuccess) { | 799 if (status != SECSuccess) { |
| 800 // We VLOG(1) because this failure is relatively harmless (leaking, but | 800 // We VLOG(1) because this failure is relatively harmless (leaking, but |
| 801 // we're shutting down anyway). | 801 // we're shutting down anyway). |
| 802 VLOG(1) << "NSS_Shutdown failed; see http://crbug.com/4609"; | 802 VLOG(1) << "NSS_Shutdown failed; see http://crbug.com/4609"; |
| 803 } | 803 } |
| 804 } | 804 } |
| 805 | 805 |
| 806 #if defined(USE_NSS_CERTS) || defined(OS_IOS) | |
| 807 // Load nss's built-in root certs. | 806 // Load nss's built-in root certs. |
| 808 SECMODModule* InitDefaultRootCerts() { | 807 SECMODModule* InitDefaultRootCerts() { |
| 809 SECMODModule* root = LoadModule("Root Certs", "libnssckbi.so", NULL); | 808 SECMODModule* root = LoadModule("Root Certs", "libnssckbi.so", NULL); |
| 810 if (root) | 809 if (root) |
| 811 return root; | 810 return root; |
| 812 | 811 |
| 813 // Aw, snap. Can't find/load root cert shared library. | 812 // Aw, snap. Can't find/load root cert shared library. |
| 814 // This will make it hard to talk to anybody via https. | 813 // This will make it hard to talk to anybody via https. |
| 815 // TODO(mattm): Re-add the NOTREACHED here when crbug.com/310972 is fixed. | 814 // TODO(mattm): Re-add the NOTREACHED here when crbug.com/310972 is fixed. |
| 816 return NULL; | 815 return NULL; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 836 return NULL; | 835 return NULL; |
| 837 } | 836 } |
| 838 if (!module->loaded) { | 837 if (!module->loaded) { |
| 839 LOG(ERROR) << "After loading " << name << ", loaded==false: " | 838 LOG(ERROR) << "After loading " << name << ", loaded==false: " |
| 840 << GetNSSErrorMessage(); | 839 << GetNSSErrorMessage(); |
| 841 SECMOD_DestroyModule(module); | 840 SECMOD_DestroyModule(module); |
| 842 return NULL; | 841 return NULL; |
| 843 } | 842 } |
| 844 return module; | 843 return module; |
| 845 } | 844 } |
| 846 #endif | |
| 847 | 845 |
| 848 bool tpm_token_enabled_for_nss_; | 846 bool tpm_token_enabled_for_nss_; |
| 849 bool initializing_tpm_token_; | 847 bool initializing_tpm_token_; |
| 850 typedef std::vector<base::Closure> TPMReadyCallbackList; | 848 typedef std::vector<base::Closure> TPMReadyCallbackList; |
| 851 TPMReadyCallbackList tpm_ready_callback_list_; | 849 TPMReadyCallbackList tpm_ready_callback_list_; |
| 852 SECMODModule* chaps_module_; | 850 SECMODModule* chaps_module_; |
| 853 crypto::ScopedPK11Slot tpm_slot_; | 851 crypto::ScopedPK11Slot tpm_slot_; |
| 854 SECMODModule* root_; | 852 SECMODModule* root_; |
| 855 #if defined(OS_CHROMEOS) | 853 #if defined(OS_CHROMEOS) |
| 856 typedef std::map<std::string, ChromeOSUserData*> ChromeOSUserMap; | 854 typedef std::map<std::string, ChromeOSUserData*> ChromeOSUserMap; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue(); | 1018 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue(); |
| 1021 } | 1019 } |
| 1022 | 1020 |
| 1023 #if !defined(OS_CHROMEOS) | 1021 #if !defined(OS_CHROMEOS) |
| 1024 PK11SlotInfo* GetPersistentNSSKeySlot() { | 1022 PK11SlotInfo* GetPersistentNSSKeySlot() { |
| 1025 return g_nss_singleton.Get().GetPersistentNSSKeySlot(); | 1023 return g_nss_singleton.Get().GetPersistentNSSKeySlot(); |
| 1026 } | 1024 } |
| 1027 #endif | 1025 #endif |
| 1028 | 1026 |
| 1029 } // namespace crypto | 1027 } // namespace crypto |
| OLD | NEW |