Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b475749a authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Keystore 2.0: Fix getKey returns null on key not found." am: 2ced3500...

Merge "Keystore 2.0: Fix getKey returns null on key not found." am: 2ced3500 am: d07d143e am: 63b142bf am: b2fc3282

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1578023

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib40784c277f09b91f44346f54acab2340629f08e
parents 78dbfe71 b2fc3282
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -352,11 +352,14 @@ public class AndroidKeyStoreProvider extends Provider {
        try {
            response = keyStore.getKeyEntry(descriptor);
        } catch (android.security.KeyStoreException e) {
            if (e.getErrorCode() == ResponseCode.KEY_PERMANENTLY_INVALIDATED) {
            switch (e.getErrorCode()) {
                case ResponseCode.KEY_NOT_FOUND:
                    return null;
                case ResponseCode.KEY_PERMANENTLY_INVALIDATED:
                    throw new KeyPermanentlyInvalidatedException(
                            "User changed or deleted their auth credentials",
                            e);
            } else {
                default:
                    throw (UnrecoverableKeyException)
                            new UnrecoverableKeyException("Failed to obtain information about key")
                                    .initCause(e);