From eab62566ef5caff37098f034db46b39f0e06317a Mon Sep 17 00:00:00 2001 From: Eran Messeri Date: Tue, 16 Jan 2018 16:33:22 +0000 Subject: [PATCH] KeyStore: Remove duplicate method Remove the duplicate() method from KeyStore. It is backed by dead code in the Keystore service, which (as far as I can tell) is not doing the right thing. Previous conversations with Keystore team members suggested this API should not be used and it is marked for removal in the Keystore service. Bug: 72037261 Test: That it compiles. Change-Id: I7f8af95473c876340cbd5c73dd88c5d0282897b3 --- core/java/android/security/IKeystoreService.aidl | 1 - keystore/java/android/security/KeyStore.java | 9 --------- 2 files changed, 10 deletions(-) diff --git a/core/java/android/security/IKeystoreService.aidl b/core/java/android/security/IKeystoreService.aidl index 57477f580a425..b5496e4a54dcd 100644 --- a/core/java/android/security/IKeystoreService.aidl +++ b/core/java/android/security/IKeystoreService.aidl @@ -51,7 +51,6 @@ interface IKeystoreService { String grant(String name, int granteeUid); int ungrant(String name, int granteeUid); long getmtime(String name, int uid); - int duplicate(String srcKey, int srcUid, String destKey, int destUid); int is_hardware_backed(String string); int clear_uid(long uid); diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java index fabcdf008c470..1690e8ce93097 100644 --- a/keystore/java/android/security/KeyStore.java +++ b/keystore/java/android/security/KeyStore.java @@ -424,15 +424,6 @@ public class KeyStore { return getmtime(key, UID_SELF); } - public boolean duplicate(String srcKey, int srcUid, String destKey, int destUid) { - try { - return mBinder.duplicate(srcKey, srcUid, destKey, destUid) == NO_ERROR; - } catch (RemoteException e) { - Log.w(TAG, "Cannot connect to keystore", e); - return false; - } - } - // TODO: remove this when it's removed from Settings public boolean isHardwareBacked() { return isHardwareBacked("RSA");