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

Unified Diff: crypto/nss_util.h

Issue 10332191: Remove TPMTokenInfoDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix logic error Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/cros/cert_library.cc ('k') | crypto/nss_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/nss_util.h
diff --git a/crypto/nss_util.h b/crypto/nss_util.h
index 041333343f422a473004188c9636354a80d78a61..0c141b6db476913450328f95b2e19209148cd969 100644
--- a/crypto/nss_util.h
+++ b/crypto/nss_util.h
@@ -8,7 +8,6 @@
#include <string>
#include "base/basictypes.h"
-#include "base/callback.h"
#include "crypto/crypto_export.h"
#if defined(USE_NSS)
@@ -27,9 +26,6 @@ namespace crypto {
class SymmetricKey;
-// A callback to handle the result of InitializeTPMToken.
-typedef base::Callback<void(bool result)> InitializeTPMTokenCallback;
-
#if defined(USE_NSS)
// EarlySetupForNSSInit performs lightweight setup which must occur before the
// process goes multithreaded. This does not initialise NSS. For test, see
@@ -93,36 +89,10 @@ bool CheckNSSVersion(const char* version);
// GetPublicNSSKeySlot().
CRYPTO_EXPORT void OpenPersistentNSSDB();
-// A delegate class that we can use to access the cros API for
-// communication with cryptohomed and the TPM.
-class CRYPTO_EXPORT TPMTokenInfoDelegate {
- public:
- // A callback to handle the result of RequestIsTokenReady.
- typedef base::Callback<void(bool result)> RequestIsTokenReadyCallback;
-
- TPMTokenInfoDelegate();
- virtual ~TPMTokenInfoDelegate();
-
- // Runs |callback| with true if the TPM and PKCS#11 token slot is ready to be
- // used.
- // If IsTokenAvailable() is false this should run |callback| with false.
- // If IsTokenAvailable() is true, this should eventually run |callback| with
- // true.
- virtual void RequestIsTokenReady(RequestIsTokenReadyCallback callback) const
- = 0;
-
- // Fetches token properties. TODO(stevenjb): make this interface asynchronous
- // so that the implementation does not have to be blocking.
- virtual void GetTokenInfo(std::string* token_name,
- std::string* user_pin) const = 0;
-};
-
// Indicates that NSS should load the Chaps library so that we
// can access the TPM through NSS. Once this is called,
// GetPrivateNSSKeySlot() will return the TPM slot if one was found.
-// Takes ownership of the passed-in delegate object so it can access
-// the cros library to talk to cryptohomed.
-CRYPTO_EXPORT void EnableTPMTokenForNSS(TPMTokenInfoDelegate* delegate);
+CRYPTO_EXPORT void EnableTPMTokenForNSS();
// Get name and user PIN for the built-in TPM token on ChromeOS.
// Either one can safely be NULL. Should only be called after
@@ -137,7 +107,8 @@ CRYPTO_EXPORT void GetTPMTokenInfo(std::string* token_name,
CRYPTO_EXPORT bool IsTPMTokenReady();
// Initialize the TPM token. Does nothing if it is already initialized.
-CRYPTO_EXPORT void InitializeTPMToken(InitializeTPMTokenCallback callback);
+CRYPTO_EXPORT bool InitializeTPMToken(const std::string& token_name,
+ const std::string& user_pin);
// Gets supplemental user key. Creates one in NSS database if it does not exist.
// The supplemental user key is used for AES encryption of user data that is
« no previous file with comments | « chrome/browser/chromeos/cros/cert_library.cc ('k') | crypto/nss_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698