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

Commit 19da3400 authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Remove finalizer which clears user secret at unpredictable time.

Bug: 72443379
Test: adb shell am instrument -w -e package
com.android.server.locksettings.recoverablekeystore
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Id5410494664952d171beff615e0497a8af061e69
parent 752d7ca1
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -235,17 +235,7 @@ public final class KeyChainProtectionParams implements Parcelable {
    }

    /**
     * Removes secret from memory than object is no longer used.
     * Since finalizer call is not reliable, please use @link {#clearSecret} directly.
     */
    @Override
    protected void finalize() throws Throwable {
        clearSecret();
        super.finalize();
    }

    /**
     * Fills mSecret with zeroes.
     * Fills secret with zeroes.
     */
    public void clearSecret() {
        Arrays.fill(mSecret, (byte) 0);