From 36ac55fef9d53fc011f01132c364bf1a55ac594a Mon Sep 17 00:00:00 2001 From: Janis Danisevskis Date: Wed, 10 Mar 2021 11:19:37 -0800 Subject: [PATCH] Keystore 2.0: Remove references to Keystore 1.0 Bug: 171305684 Test: N/A Change-Id: I295728dba0a1dab2f8fd0e3c46cb0e239d1c72d7 --- gatekeeperd/Android.bp | 2 -- gatekeeperd/gatekeeperd.cpp | 19 +------------------ 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/gatekeeperd/Android.bp b/gatekeeperd/Android.bp index 49e8085ab..95e814b6a 100644 --- a/gatekeeperd/Android.bp +++ b/gatekeeperd/Android.bp @@ -40,8 +40,6 @@ cc_binary { "libbase", "libutils", "libcrypto", - "libkeystore_aidl", - "libkeystore_binder", "libhidlbase", "android.hardware.gatekeeper@1.0", "libgatekeeper_aidl", diff --git a/gatekeeperd/gatekeeperd.cpp b/gatekeeperd/gatekeeperd.cpp index f9c0cddb4..8792c8352 100644 --- a/gatekeeperd/gatekeeperd.cpp +++ b/gatekeeperd/gatekeeperd.cpp @@ -29,13 +29,11 @@ #include #include #include -#include #include #include #include #include // for password_handle_t #include -#include #include #include #include @@ -303,7 +301,7 @@ class GateKeeperProxy : public BnGateKeeperService { if (gkResponse->payload().size() != 0) { // try to connect to IKeystoreAuthorization AIDL service first. AIBinder* authzAIBinder = - AServiceManager_checkService("android.security.authorization"); + AServiceManager_getService("android.security.authorization"); ::ndk::SpAIBinder authzBinder(authzAIBinder); auto authzService = IKeystoreAuthorization::fromBinder(authzBinder); if (authzService) { @@ -328,21 +326,6 @@ class GateKeeperProxy : public BnGateKeeperService { LOG(ERROR) << "Failure in sending AuthToken to AuthorizationService."; return GK_ERROR; } - } - sp sm = defaultServiceManager(); - - sp binder = sm->getService(String16("android.security.keystore")); - sp service = - interface_cast(binder); - - if (service) { - int result = 0; - auto binder_result = service->addAuthToken(gkResponse->payload(), &result); - if (!binder_result.isOk() || - !keystore::KeyStoreServiceReturnCode(result).isOk()) { - LOG(ERROR) << "Failure sending auth token to KeyStore: " << result; - return GK_ERROR; - } } else { LOG(ERROR) << "Cannot deliver auth token. Unable to communicate with " "Keystore.";