Revert "Port cryptfs to HILD keymaster HAL"
bullhead-userdebug with disk encryption enabled and with PIN prompt at
boot can no longer unlock/mount encrypted userdata partition at boot
after updating from bullhead-userdebug prior to the two commits being
reverted here.
This reverts commit 6b7fa1bf178cd941aabe815d17da38d2e55d9867.
This reverts commit bbe31ba776fe73da2959c5ab442e191d8371a8f3.
Test: Flash bullhead-userdebug build created prior to the above two
commits, enable disk (set PIN to 1234) with PIN required at
boot, reboot, confirm that PIN prompt accepts the PIN, confirm
that device fully boots up and appears operational. Flash build
with this commit without wiping userdata, confirm that PIN
prompt at boot accepts the PIN and device fully boots up and
appears operational.
Bug: 35028230
Change-Id: I1e9303e9d007c0c9a3021c874340156748dff5f5
diff --git a/Keymaster.h b/Keymaster.h
index 12b44b0..893a6d1 100644
--- a/Keymaster.h
+++ b/Keymaster.h
@@ -17,8 +17,6 @@
#ifndef ANDROID_VOLD_KEYMASTER_H
#define ANDROID_VOLD_KEYMASTER_H
-#ifdef __cplusplus
-
#include <memory>
#include <string>
#include <utility>
@@ -61,17 +59,8 @@
}
// Construct an object in an error state for error returns
KeymasterOperation()
- : mDevice{nullptr}, mOpHandle{0},
+ : mDevice{nullptr}, mOpHandle{static_cast<uint64_t>(0)},
mError {ErrorCode::UNKNOWN_ERROR} {}
- // Move Assignment
- KeymasterOperation& operator= (KeymasterOperation&& rhs) {
- mDevice = std::move(rhs.mDevice);
- mOpHandle = std::move(rhs.mOpHandle);
- mError = std::move(rhs.mError);
- rhs.mError = ErrorCode::UNKNOWN_ERROR;
- rhs.mOpHandle = 0;
- return *this;
- }
private:
KeymasterOperation(const sp<IKeymasterDevice>& d, uint64_t h)
@@ -103,7 +92,6 @@
// Begin a new cryptographic operation, collecting output parameters if pointer is non-null
KeymasterOperation begin(KeyPurpose purpose, const std::string& key,
const AuthorizationSet& inParams, AuthorizationSet* outParams);
- bool isSecure();
private:
sp<hardware::keymaster::V3_0::IKeymasterDevice> mDevice;
@@ -113,26 +101,4 @@
} // namespace vold
} // namespace android
-#endif // __cplusplus
-
-__BEGIN_DECLS
-
-int keymaster_compatibility_cryptfs_scrypt();
-int keymaster_create_key_for_cryptfs_scrypt(uint32_t rsa_key_size,
- uint64_t rsa_exponent,
- uint32_t ratelimit,
- uint8_t* key_buffer,
- uint32_t key_buffer_size,
- uint32_t* key_out_size);
-
-int keymaster_sign_object_for_cryptfs_scrypt(const uint8_t* key_blob,
- size_t key_blob_size,
- uint32_t ratelimit,
- const uint8_t* object,
- const size_t object_size,
- uint8_t** signature_buffer,
- size_t* signature_buffer_size);
-
-__END_DECLS
-
#endif