| 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 #ifndef CRYPTO_NSS_UTIL_INTERNAL_H_ | 5 #ifndef CRYPTO_NSS_UTIL_INTERNAL_H_ | 
| 6 #define CRYPTO_NSS_UTIL_INTERNAL_H_ | 6 #define CRYPTO_NSS_UTIL_INTERNAL_H_ | 
| 7 | 7 | 
| 8 #include <secmodt.h> | 8 #include <secmodt.h> | 
| 9 | 9 | 
| 10 #include "base/callback.h" | 10 #include "base/callback.h" | 
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 57 // through |GetSystemNSSKeySlot| and |IsTPMTokenReady| will return true. | 57 // through |GetSystemNSSKeySlot| and |IsTPMTokenReady| will return true. | 
| 58 // |InitializeTPMTokenAndSystemSlot|, which triggers the TPM initialization, | 58 // |InitializeTPMTokenAndSystemSlot|, which triggers the TPM initialization, | 
| 59 // does not have to be called if the test system slot is set. | 59 // does not have to be called if the test system slot is set. | 
| 60 // This must must not be called consecutively with a |slot| != NULL. If |slot| | 60 // This must must not be called consecutively with a |slot| != NULL. If |slot| | 
| 61 // is NULL, the test system slot is unset. | 61 // is NULL, the test system slot is unset. | 
| 62 CRYPTO_EXPORT_PRIVATE void SetSystemKeySlotForTesting(ScopedPK11Slot slot); | 62 CRYPTO_EXPORT_PRIVATE void SetSystemKeySlotForTesting(ScopedPK11Slot slot); | 
| 63 | 63 | 
| 64 // Prepare per-user NSS slot mapping. It is safe to call this function multiple | 64 // Prepare per-user NSS slot mapping. It is safe to call this function multiple | 
| 65 // times. Returns true if the user was added, or false if it already existed. | 65 // times. Returns true if the user was added, or false if it already existed. | 
| 66 CRYPTO_EXPORT bool InitializeNSSForChromeOSUser( | 66 CRYPTO_EXPORT bool InitializeNSSForChromeOSUser( | 
| 67     const std::string& email, |  | 
| 68     const std::string& username_hash, | 67     const std::string& username_hash, | 
| 69     const base::FilePath& path); | 68     const base::FilePath& path); | 
| 70 | 69 | 
| 71 // Returns whether TPM for ChromeOS user still needs initialization. If | 70 // Returns whether TPM for ChromeOS user still needs initialization. If | 
| 72 // true is returned, the caller can proceed to initialize TPM slot for the | 71 // true is returned, the caller can proceed to initialize TPM slot for the | 
| 73 // user, but should call |WillInitializeTPMForChromeOSUser| first. | 72 // user, but should call |WillInitializeTPMForChromeOSUser| first. | 
| 74 // |InitializeNSSForChromeOSUser| must have been called first. | 73 // |InitializeNSSForChromeOSUser| must have been called first. | 
| 75 CRYPTO_EXPORT bool ShouldInitializeTPMForChromeOSUser( | 74 CRYPTO_EXPORT bool ShouldInitializeTPMForChromeOSUser( | 
| 76     const std::string& username_hash) WARN_UNUSED_RESULT; | 75     const std::string& username_hash) WARN_UNUSED_RESULT; | 
| 77 | 76 | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 105 | 104 | 
| 106 // Closes the NSS DB for |username_hash| that was previously opened by the | 105 // Closes the NSS DB for |username_hash| that was previously opened by the | 
| 107 // *Initialize*ForChromeOSUser functions. | 106 // *Initialize*ForChromeOSUser functions. | 
| 108 CRYPTO_EXPORT_PRIVATE void CloseChromeOSUserForTesting( | 107 CRYPTO_EXPORT_PRIVATE void CloseChromeOSUserForTesting( | 
| 109     const std::string& username_hash); | 108     const std::string& username_hash); | 
| 110 #endif  // defined(OS_CHROMEOS) | 109 #endif  // defined(OS_CHROMEOS) | 
| 111 | 110 | 
| 112 }  // namespace crypto | 111 }  // namespace crypto | 
| 113 | 112 | 
| 114 #endif  // CRYPTO_NSS_UTIL_INTERNAL_H_ | 113 #endif  // CRYPTO_NSS_UTIL_INTERNAL_H_ | 
| OLD | NEW | 
|---|