Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: crypto/nss_util_internal.h

Issue 317613004: Remove usage of singleton software_slot_ in nss on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Prepare per-user NSS slot mapping. It is safe to call this function multiple 49 // 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. 50 // times. Returns true if the user was added, or false if it already existed.
51 CRYPTO_EXPORT bool InitializeNSSForChromeOSUser( 51 CRYPTO_EXPORT bool InitializeNSSForChromeOSUser(
52 const std::string& email, 52 const std::string& email,
53 const std::string& username_hash, 53 const std::string& username_hash,
54 bool is_primary_user,
55 const base::FilePath& path) WARN_UNUSED_RESULT; 54 const base::FilePath& path) WARN_UNUSED_RESULT;
56 55
57 // Use TPM slot |slot_id| for user. InitializeNSSForChromeOSUser must have been 56 // Use TPM slot |slot_id| for user. InitializeNSSForChromeOSUser must have been
58 // called first. 57 // called first.
59 CRYPTO_EXPORT void InitializeTPMForChromeOSUser( 58 CRYPTO_EXPORT void InitializeTPMForChromeOSUser(
60 const std::string& username_hash, 59 const std::string& username_hash,
61 CK_SLOT_ID slot_id); 60 CK_SLOT_ID slot_id);
62 61
63 // Use the software slot as the private slot for user. 62 // Use the software slot as the private slot for user.
64 // InitializeNSSForChromeOSUser must have been called first. 63 // InitializeNSSForChromeOSUser must have been called first.
65 CRYPTO_EXPORT void InitializePrivateSoftwareSlotForChromeOSUser( 64 CRYPTO_EXPORT void InitializePrivateSoftwareSlotForChromeOSUser(
66 const std::string& username_hash); 65 const std::string& username_hash);
67 66
68 // Returns a reference to the public slot for user. 67 // Returns a reference to the public slot for user.
69 CRYPTO_EXPORT ScopedPK11Slot GetPublicSlotForChromeOSUser( 68 CRYPTO_EXPORT ScopedPK11Slot GetPublicSlotForChromeOSUser(
70 const std::string& username_hash) WARN_UNUSED_RESULT; 69 const std::string& username_hash) WARN_UNUSED_RESULT;
71 70
72 // Returns the private slot for |username_hash| if it is loaded. If it is not 71 // Returns the private slot for |username_hash| if it is loaded. If it is not
73 // loaded and |callback| is non-null, the |callback| will be run once the slot 72 // loaded and |callback| is non-null, the |callback| will be run once the slot
74 // is loaded. 73 // is loaded.
75 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser( 74 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser(
76 const std::string& username_hash, 75 const std::string& username_hash,
77 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; 76 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT;
78 #endif // defined(OS_CHROMEOS) 77 #endif // defined(OS_CHROMEOS)
79 78
80 } // namespace crypto 79 } // namespace crypto
81 80
82 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ 81 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698