| 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 28 matching lines...) Expand all Loading... |
| 39 public: | 39 public: |
| 40 AutoSECMODListReadLock(); | 40 AutoSECMODListReadLock(); |
| 41 ~AutoSECMODListReadLock(); | 41 ~AutoSECMODListReadLock(); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 SECMODListLock* lock_; | 44 SECMODListLock* lock_; |
| 45 DISALLOW_COPY_AND_ASSIGN(AutoSECMODListReadLock); | 45 DISALLOW_COPY_AND_ASSIGN(AutoSECMODListReadLock); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
| 49 // Returns a reference to the system-wide TPM slot. Caller must release |
| 50 // returned reference with PK11_FreeSlot. |
| 51 CRYPTO_EXPORT PK11SlotInfo* GetSystemNSSKeySlot() WARN_UNUSED_RESULT; |
| 52 |
| 49 // Prepare per-user NSS slot mapping. It is safe to call this function multiple | 53 // Prepare per-user NSS slot mapping. It is safe to call this function multiple |
| 50 // times. Returns true if the user was added, or false if it already existed. | 54 // times. Returns true if the user was added, or false if it already existed. |
| 51 CRYPTO_EXPORT bool InitializeNSSForChromeOSUser( | 55 CRYPTO_EXPORT bool InitializeNSSForChromeOSUser( |
| 52 const std::string& email, | 56 const std::string& email, |
| 53 const std::string& username_hash, | 57 const std::string& username_hash, |
| 54 bool is_primary_user, | 58 bool is_primary_user, |
| 55 const base::FilePath& path) WARN_UNUSED_RESULT; | 59 const base::FilePath& path) WARN_UNUSED_RESULT; |
| 56 | 60 |
| 57 // Use TPM slot |slot_id| for user. InitializeNSSForChromeOSUser must have been | 61 // Use TPM slot |slot_id| for user. InitializeNSSForChromeOSUser must have been |
| 58 // called first. | 62 // called first. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 73 // loaded and |callback| is non-null, the |callback| will be run once the slot | 77 // loaded and |callback| is non-null, the |callback| will be run once the slot |
| 74 // is loaded. | 78 // is loaded. |
| 75 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser( | 79 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser( |
| 76 const std::string& username_hash, | 80 const std::string& username_hash, |
| 77 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; | 81 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; |
| 78 #endif // defined(OS_CHROMEOS) | 82 #endif // defined(OS_CHROMEOS) |
| 79 | 83 |
| 80 } // namespace crypto | 84 } // namespace crypto |
| 81 | 85 |
| 82 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ | 86 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ |
| OLD | NEW |