Remove HardwareAuthToken parameters from binder interface
These are no longer used.
Test: atest com.android.server.locksettings
Bug: 184723544
Change-Id: I6160d30deb138a5366532de84cbf6f02cbc69b8c
(cherry picked from commit 5bb9faab49e2bd7872e2d8b4ada6be89df7758fb)
Merged-In: I6160d30deb138a5366532de84cbf6f02cbc69b8c
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index 576717c..f5fb908 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -728,36 +728,19 @@
return translateBool(fscrypt_destroy_user_key(userId));
}
-static bool token_empty(const std::string& token) {
- return token.size() == 0 || token == "!";
-}
-
binder::Status VoldNativeService::addUserKeyAuth(int32_t userId, int32_t userSerial,
- const std::string& token,
const std::string& secret) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- if (!token_empty(token)) {
- LOG(ERROR) << "Vold doesn't use auth tokens, but non-empty token passed to addUserKeyAuth.";
- return binder::Status::fromServiceSpecificError(-EINVAL);
- }
-
return translateBool(fscrypt_add_user_key_auth(userId, userSerial, secret));
}
binder::Status VoldNativeService::clearUserKeyAuth(int32_t userId, int32_t userSerial,
- const std::string& token,
const std::string& secret) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- if (!token_empty(token)) {
- LOG(ERROR)
- << "Vold doesn't use auth tokens, but non-empty token passed to clearUserKeyAuth.";
- return binder::Status::fromServiceSpecificError(-EINVAL);
- }
-
return translateBool(fscrypt_clear_user_key_auth(userId, userSerial, secret));
}
@@ -777,16 +760,10 @@
}
binder::Status VoldNativeService::unlockUserKey(int32_t userId, int32_t userSerial,
- const std::string& token,
const std::string& secret) {
ENFORCE_SYSTEM_OR_ROOT;
ACQUIRE_CRYPT_LOCK;
- if (!token_empty(token)) {
- LOG(ERROR) << "Vold doesn't use auth tokens, but non-empty token passed to unlockUserKey.";
- return binder::Status::fromServiceSpecificError(-EINVAL);
- }
-
return translateBool(fscrypt_unlock_user_key(userId, userSerial, secret));
}
diff --git a/VoldNativeService.h b/VoldNativeService.h
index 58301f5..88fc9e7 100644
--- a/VoldNativeService.h
+++ b/VoldNativeService.h
@@ -127,15 +127,12 @@
binder::Status createUserKey(int32_t userId, int32_t userSerial, bool ephemeral);
binder::Status destroyUserKey(int32_t userId);
- binder::Status addUserKeyAuth(int32_t userId, int32_t userSerial, const std::string& token,
- const std::string& secret);
- binder::Status clearUserKeyAuth(int32_t userId, int32_t userSerial, const std::string& token,
- const std::string& secret);
+ binder::Status addUserKeyAuth(int32_t userId, int32_t userSerial, const std::string& secret);
+ binder::Status clearUserKeyAuth(int32_t userId, int32_t userSerial, const std::string& secret);
binder::Status fixateNewestUserKeyAuth(int32_t userId);
binder::Status getUnlockedUsers(std::vector<int>* _aidl_return);
- binder::Status unlockUserKey(int32_t userId, int32_t userSerial, const std::string& token,
- const std::string& secret);
+ binder::Status unlockUserKey(int32_t userId, int32_t userSerial, const std::string& secret);
binder::Status lockUserKey(int32_t userId);
binder::Status prepareUserStorage(const std::optional<std::string>& uuid, int32_t userId,
diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl
index cec0593..aee75f5 100644
--- a/binder/android/os/IVold.aidl
+++ b/binder/android/os/IVold.aidl
@@ -100,15 +100,12 @@
void createUserKey(int userId, int userSerial, boolean ephemeral);
void destroyUserKey(int userId);
- void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token,
- @utf8InCpp String secret);
- void clearUserKeyAuth(int userId, int userSerial, @utf8InCpp String token,
- @utf8InCpp String secret);
+ void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String secret);
+ void clearUserKeyAuth(int userId, int userSerial, @utf8InCpp String secret);
void fixateNewestUserKeyAuth(int userId);
int[] getUnlockedUsers();
- void unlockUserKey(int userId, int userSerial, @utf8InCpp String token,
- @utf8InCpp String secret);
+ void unlockUserKey(int userId, int userSerial, @utf8InCpp String secret);
void lockUserKey(int userId);
void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial,