Deprecate Cryptohome functions

BUG=chromium-os:16552
TEST=gmerge libcros

Change-Id: I70d01010ad6528e8820f8795c8e6ede560470d47
Reviewed-on: https://gerrit.chromium.org/gerrit/15817
Reviewed-by: Satoru Takabayashi <[email protected]>
Commit-Ready: Ryo Hashimoto <[email protected]>
Tested-by: Ryo Hashimoto <[email protected]>
diff --git a/chromeos_cros_api.h b/chromeos_cros_api.h
index 8a5edc6..97b5978 100644
--- a/chromeos_cros_api.h
+++ b/chromeos_cros_api.h
@@ -352,12 +352,24 @@
 //      CryptohomeInstallAttributesCount, CryptohomeInstallAttributesIsSecure.
 // 195: Deprecated CryptohomePkcs11IsTmpTokenReadyForUser,
 //      CryptohomePkcs11GetTmpTokenReadyForUser, CryptohomeGetStatusString.
+// 196: Deprecated CryptohomeAsyncCheckKey, CryptohomeAsyncMigrateKey
+//      CryptohomeAsyncRemove, CryptohomeGetSystemSaltSafe, CryptohomeIsMounted
+//      CryptohomeAsyncMountSafe, CryptohomeAsyncMountGuest,
+//      CryptohomeTpmIsReady, CryptohomeTpmIsEnabled, CryptohomeTpmIsOwned,
+//      CryptohomeTpmIsBeingOwned, CryptohomeTpmGetPasswordSafe,
+//      CryptohomeTpmCanAttemptOwnership, CryptohomeTpmClearStoredPassword
+//      CryptohomePkcs11IsTpmTokenReady, CryptohomePkcs11GetTpmTokenInfo
+//      CryptohomeInstallAttributesGet, CryptohomeInstallAttributesSet
+//      CryptohomeInstallAttributesFinalize, CryptohomeInstallAttributesIsReady
+//      CryptohomeInstallAttributesIsInvalid,
+//      CryptohomeInstallAttributesIsFirstInstall, CryptohomeFreeString
+//      CryptohomeMonitorSession.
 
 namespace chromeos {  // NOLINT
 
 enum CrosAPIVersion {
   kCrosAPIMinVersion = 191,
-  kCrosAPIVersion = 195
+  kCrosAPIVersion = 196
 };
 
 // Default path to pass to LoadCros: "/opt/google/chrome/chromeos/libcros.so"
diff --git a/chromeos_cryptohome.cc b/chromeos_cryptohome.cc
index 195a5e5..52e10e4 100644
--- a/chromeos_cryptohome.cc
+++ b/chromeos_cryptohome.cc
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chromeos_cryptohome.h"  // NOLINT
+#include <string>
+#include <vector>
 
 #include <base/basictypes.h>
 #include <base/string_util.h>
@@ -13,6 +14,15 @@
 
 namespace chromeos {  // NOLINT
 
+struct CryptohomeAsyncCallStatus {
+  int async_id;
+  bool return_status;
+  int return_code;
+};
+
+typedef void(*CryptohomeSignalCallback)(
+    const CryptohomeAsyncCallStatus& call_status, void* callback_context);
+
 extern "C"
 int ChromeOSCryptohomeAsyncCheckKey(const char* user_email, const char* key) {
   dbus::BusConnection bus = dbus::GetSystemBusConnection();
diff --git a/chromeos_cryptohome.h b/chromeos_cryptohome.h
deleted file mode 100644
index ba8fefb..0000000
--- a/chromeos_cryptohome.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROMEOS_CRYPTOHOME_H_
-#define CHROMEOS_CRYPTOHOME_H_
-
-#include <string>
-#include <vector>
-
-namespace chromeos { // NOLINT
-
-// Typedef CryptohomeBlob here so that we don't have to include additional
-// headers.
-typedef std::vector<unsigned char> CryptohomeBlob;
-
-struct CryptohomeAsyncCallStatus {
-  int async_id;
-  bool return_status;
-  int return_code;
-};
-
-extern int (*CryptohomeAsyncCheckKey)(const char* user_email,
-                                      const char* key);
-extern int (*CryptohomeAsyncMigrateKey)(const char* user_email,
-                                        const char* from_key,
-                                        const char* to_key);
-extern int (*CryptohomeAsyncRemove)(const char* user_email);
-extern bool (*CryptohomeGetSystemSaltSafe)(char** salt, int* length);
-extern bool (*CryptohomeIsMounted)();
-extern int (*CryptohomeAsyncMountSafe)(
-    const char* user_email,
-    const char* key,
-    bool create_if_missing,
-    bool replace_tracked_subdirectories,
-    const char** tracked_subdirectories);
-extern int (*CryptohomeAsyncMountGuest)();
-extern bool (*CryptohomeTpmIsReady)();
-extern bool (*CryptohomeTpmIsEnabled)();
-extern bool (*CryptohomeTpmIsOwned)();
-extern bool (*CryptohomeTpmIsBeingOwned)();
-extern bool (*CryptohomeTpmGetPasswordSafe)(char** password);
-extern void (*CryptohomeTpmCanAttemptOwnership)();
-extern void (*CryptohomeTpmClearStoredPassword)();
-extern void (*CryptohomePkcs11GetTpmTokenInfo)(std::string* label,
-                                               std::string* user_pin);
-extern bool (*CryptohomePkcs11IsTpmTokenReady)();
-extern bool (*CryptohomeInstallAttributesGet)(const char* name, char** value);
-extern bool (*CryptohomeInstallAttributesSet)(const char* name,
-                                              const char* value);
-extern bool (*CryptohomeInstallAttributesFinalize)();
-extern bool (*CryptohomeInstallAttributesIsReady)();
-extern bool (*CryptohomeInstallAttributesIsInvalid)();
-extern bool (*CryptohomeInstallAttributesIsFirstInstall)();
-
-extern void (*CryptohomeFreeString)(char* value);
-
-typedef void(*CryptohomeSignalCallback)(
-    const CryptohomeAsyncCallStatus& call_status, void* callback_context);
-
-extern void* (*CryptohomeMonitorSession)(
-    CryptohomeSignalCallback monitor,
-    void* monitor_context);
-
-}  // namespace chromeos
-
-#endif  // CHROMEOS_CRYPTOHOME_H_
diff --git a/load.cc b/load.cc
index 328e519..daf8427 100644
--- a/load.cc
+++ b/load.cc
@@ -9,7 +9,6 @@
 
 #include "base/basictypes.h"
 #include "chromeos_cros_api.h" // NOLINT
-#include "chromeos_cryptohome.h" // NOLINT
 #include "chromeos_network.h"  // NOLINT
 
 namespace chromeos {  // NOLINT //
@@ -169,37 +168,6 @@
 DECL_FUNC_4(ConfigureService, void, const char*, const GHashTable*,
             NetworkActionCallback, void*);
 
-// Cryptohome
-DECL_FUNC_2(CryptohomeAsyncCheckKey, int, const char*, const char*);
-DECL_FUNC_3(CryptohomeAsyncMigrateKey,
-            int,
-            const char*,
-            const char*,
-            const char*);
-DECL_FUNC_1(CryptohomeAsyncRemove, int, const char*);
-DECL_FUNC_2(CryptohomeGetSystemSaltSafe, bool, char**, int*);
-DECL_FUNC_0(CryptohomeIsMounted, bool);
-DECL_FUNC_5(CryptohomeAsyncMountSafe, int, const char*, const char*, bool, bool,
-            const char**);
-DECL_FUNC_0(CryptohomeAsyncMountGuest, int);
-DECL_FUNC_0(CryptohomeTpmIsReady, bool);
-DECL_FUNC_0(CryptohomeTpmIsEnabled, bool);
-DECL_FUNC_0(CryptohomeTpmIsOwned, bool);
-DECL_FUNC_0(CryptohomeTpmIsBeingOwned, bool);
-DECL_FUNC_1(CryptohomeTpmGetPasswordSafe, bool, char**);
-DECL_FUNC_0(CryptohomeTpmCanAttemptOwnership, void);
-DECL_FUNC_0(CryptohomeTpmClearStoredPassword, void);
-DECL_FUNC_0(CryptohomePkcs11IsTpmTokenReady, bool);
-DECL_FUNC_2(CryptohomePkcs11GetTpmTokenInfo, void, std::string*, std::string*);
-DECL_FUNC_2(CryptohomeInstallAttributesGet, bool, const char*, char**);
-DECL_FUNC_2(CryptohomeInstallAttributesSet, bool, const char*, const char*);
-DECL_FUNC_0(CryptohomeInstallAttributesFinalize, bool);
-DECL_FUNC_0(CryptohomeInstallAttributesIsReady, bool);
-DECL_FUNC_0(CryptohomeInstallAttributesIsInvalid, bool);
-DECL_FUNC_0(CryptohomeInstallAttributesIsFirstInstall, bool);
-DECL_FUNC_1(CryptohomeFreeString, void, char*);
-DECL_FUNC_2(CryptohomeMonitorSession, void*, CryptohomeSignalCallback, void*);
-
 char const * const kCrosDefaultPath = "/opt/google/chrome/chromeos/libcros.so";
 
 // Initializes the variable by looking up the function by |name|.
@@ -302,33 +270,6 @@
   INIT_FUNC(FreeDeviceNetworkList);
   INIT_FUNC(ConfigureService);
 
-  // Cryptohome
-  INIT_FUNC(CryptohomeAsyncCheckKey);
-  INIT_FUNC(CryptohomeAsyncMigrateKey);
-  INIT_FUNC(CryptohomeAsyncRemove);
-  INIT_FUNC(CryptohomeGetSystemSaltSafe);
-  INIT_FUNC(CryptohomeIsMounted);
-  INIT_FUNC(CryptohomeAsyncMountSafe);
-  INIT_FUNC(CryptohomeAsyncMountGuest);
-  INIT_FUNC(CryptohomeTpmIsReady);
-  INIT_FUNC(CryptohomeTpmIsEnabled);
-  INIT_FUNC(CryptohomeTpmIsOwned);
-  INIT_FUNC(CryptohomeTpmIsBeingOwned);
-  INIT_FUNC(CryptohomeTpmGetPasswordSafe);
-  INIT_FUNC(CryptohomeTpmCanAttemptOwnership);
-  INIT_FUNC(CryptohomeTpmClearStoredPassword);
-  INIT_FUNC(CryptohomePkcs11IsTpmTokenReady);
-  INIT_FUNC(CryptohomePkcs11GetTpmTokenInfo);
-  INIT_FUNC(CryptohomeInstallAttributesGet);
-  INIT_FUNC(CryptohomeInstallAttributesSet);
-  INIT_FUNC(CryptohomeInstallAttributesFinalize);
-  INIT_FUNC(CryptohomeInstallAttributesIsReady);
-  INIT_FUNC(CryptohomeInstallAttributesIsInvalid);
-  INIT_FUNC(CryptohomeInstallAttributesIsFirstInstall);
-
-  INIT_FUNC(CryptohomeFreeString);
-  INIT_FUNC(CryptohomeMonitorSession);
-
   return error_string.empty();
 }