OSDN Git Service

Do not throw KeystoreException for when a key does not exist
authorRobert Berry <robertberry@google.com>
Fri, 23 Mar 2018 08:08:02 +0000 (08:08 +0000)
committerRobert Berry <robertberry@google.com>
Fri, 23 Mar 2018 08:08:02 +0000 (08:08 +0000)
Bug: 75955240
Test: manual
Change-Id: Ibd2f4d7cd654752b69d2d22e803d4d1cc05c118f

core/java/android/security/keystore/recovery/RecoveryController.java

index 3e5ad97..f234cf9 100644 (file)
@@ -605,7 +605,7 @@ public class RecoveryController {
             throws InternalRecoveryServiceException, UnrecoverableKeyException {
         try {
             String grantAlias = mBinder.getKey(alias);
-            if (grantAlias == null) {
+            if (grantAlias == null || "".equals(grantAlias)) {
                 return null;
             }
             return getKeyFromGrant(grantAlias);