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 29 matching lines...) Expand all Loading... |
40 public: | 40 public: |
41 AutoSECMODListReadLock(); | 41 AutoSECMODListReadLock(); |
42 ~AutoSECMODListReadLock(); | 42 ~AutoSECMODListReadLock(); |
43 | 43 |
44 private: | 44 private: |
45 SECMODListLock* lock_; | 45 SECMODListLock* lock_; |
46 DISALLOW_COPY_AND_ASSIGN(AutoSECMODListReadLock); | 46 DISALLOW_COPY_AND_ASSIGN(AutoSECMODListReadLock); |
47 }; | 47 }; |
48 | 48 |
49 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
50 // Returns a reference to the system-wide TPM slot. Caller must release returned | 50 // Returns a reference to the system-wide TPM slot if it is loaded. If it is not |
51 // reference with PK11_FreeSlot. | 51 // loaded and |callback| is non-null, the |callback| will be run once the slot |
52 CRYPTO_EXPORT PK11SlotInfo* GetSystemNSSKeySlot() WARN_UNUSED_RESULT; | 52 // is loaded. |
| 53 CRYPTO_EXPORT ScopedPK11Slot GetSystemNSSKeySlot( |
| 54 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; |
53 | 55 |
54 // Sets the test system slot. If this was called before | 56 // Sets the test system slot. If this was called before |
55 // InitializeTPMTokenAndSystemSlot and no system token is provided by the Chaps | 57 // InitializeTPMTokenAndSystemSlot and no system token is provided by the Chaps |
56 // module, then this test slot will be used and the initialization continues as | 58 // module, then this test slot will be used and the initialization continues as |
57 // if Chaps had provided this test slot. In particular, |slot| will be exposed | 59 // if Chaps had provided this test slot. In particular, |slot| will be exposed |
58 // by |GetSystemNSSKeySlot| and |IsTPMTokenReady| will return true. | 60 // by |GetSystemNSSKeySlot| and |IsTPMTokenReady| will return true. |
59 // This must must not be called consecutively with a |slot| != NULL. If |slot| | 61 // This must must not be called consecutively with a |slot| != NULL. If |slot| |
60 // is NULL, the test system slot is unset. | 62 // is NULL, the test system slot is unset. |
61 CRYPTO_EXPORT_PRIVATE void SetSystemKeySlotForTesting(ScopedPK11Slot slot); | 63 CRYPTO_EXPORT_PRIVATE void SetSystemKeySlotForTesting(ScopedPK11Slot slot); |
62 | 64 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 106 |
105 // Closes the NSS DB for |username_hash| that was previously opened by the | 107 // Closes the NSS DB for |username_hash| that was previously opened by the |
106 // *Initialize*ForChromeOSUser functions. | 108 // *Initialize*ForChromeOSUser functions. |
107 CRYPTO_EXPORT_PRIVATE void CloseChromeOSUserForTesting( | 109 CRYPTO_EXPORT_PRIVATE void CloseChromeOSUserForTesting( |
108 const std::string& username_hash); | 110 const std::string& username_hash); |
109 #endif // defined(OS_CHROMEOS) | 111 #endif // defined(OS_CHROMEOS) |
110 | 112 |
111 } // namespace crypto | 113 } // namespace crypto |
112 | 114 |
113 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ | 115 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ |
OLD | NEW |