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

Commit 492ab3dd authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Keystore 2.0: Silence common error on operation abort."

parents 23cca128 051d7668
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.security.keystore2;

import android.app.ActivityThread;
import android.hardware.biometrics.BiometricManager;
import android.hardware.security.keymint.ErrorCode;
import android.security.GateKeeper;
import android.security.KeyStore;
import android.security.KeyStoreException;
@@ -183,9 +184,12 @@ abstract class KeyStoreCryptoOperationUtils {
            try {
                operation.abort();
            } catch (KeyStoreException e) {
                // We log this error, but we can afford to ignore it. Dropping the reference
                // Invalid operation handle is very common at this point. It occurs every time
                // an already finalized operation gets aborted.
                if (e.getErrorCode() != ErrorCode.INVALID_OPERATION_HANDLE) {
                    // This error gets logged but ignored. Dropping the reference
                    // to the KeyStoreOperation is enough to clean up all related resources even
                // in the Keystore daemon. We log it anyway, because it may indicate some
                    // in the Keystore daemon. It gets logged anyway, because it may indicate some
                    // underlying problem that is worth debugging.
                    Log.w(
                            "KeyStoreCryptoOperationUtils",
@@ -195,6 +199,7 @@ abstract class KeyStoreCryptoOperationUtils {
                }
            }
        }
    }

    static long getOrMakeOperationChallenge(KeyStoreOperation operation, AndroidKeyStoreKey key)
            throws KeyPermanentlyInvalidatedException {