From 96d7245c00be386355ec583ac980b024b223218b Mon Sep 17 00:00:00 2001 From: Alex Klyubin Date: Fri, 29 May 2015 12:39:32 -0700 Subject: Cleanup Binder token resetting. This is a follow-up to 7cbcfd4fc1e538bd391a20cdd00dd1494ace2d0e where during the review it was pointed out that the code could be streamlined. Bug: 18088752 Change-Id: Iecb9fdbc31a0f3cdcb94ddb1b3e7e12a0543a231 --- .../java/android/security/keystore/AndroidKeyStoreCipherSpiBase.java | 3 +-- keystore/java/android/security/keystore/AndroidKeyStoreHmacSpi.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'keystore/java') diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreCipherSpiBase.java b/keystore/java/android/security/keystore/AndroidKeyStoreCipherSpiBase.java index 4104dcc..be935a9 100644 --- a/keystore/java/android/security/keystore/AndroidKeyStoreCipherSpiBase.java +++ b/keystore/java/android/security/keystore/AndroidKeyStoreCipherSpiBase.java @@ -162,7 +162,6 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor protected void resetAll() { IBinder operationToken = mOperationToken; if (operationToken != null) { - mOperationToken = null; mKeyStore.abort(operationToken); } mEncrypting = false; @@ -186,9 +185,9 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor protected void resetWhilePreservingInitState() { IBinder operationToken = mOperationToken; if (operationToken != null) { - mOperationToken = null; mKeyStore.abort(operationToken); } + mOperationToken = null; mOperationHandle = 0; mMainDataStreamer = null; mCachedException = null; diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreHmacSpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreHmacSpi.java index b82a7f5..6422374 100644 --- a/keystore/java/android/security/keystore/AndroidKeyStoreHmacSpi.java +++ b/keystore/java/android/security/keystore/AndroidKeyStoreHmacSpi.java @@ -128,9 +128,9 @@ public abstract class AndroidKeyStoreHmacSpi extends MacSpi implements KeyStoreC mKey = null; IBinder operationToken = mOperationToken; if (operationToken != null) { - mOperationToken = null; mKeyStore.abort(operationToken); } + mOperationToken = null; mOperationHandle = 0; mChunkedStreamer = null; } @@ -138,9 +138,9 @@ public abstract class AndroidKeyStoreHmacSpi extends MacSpi implements KeyStoreC private void resetWhilePreservingInitState() { IBinder operationToken = mOperationToken; if (operationToken != null) { - mOperationToken = null; mKeyStore.abort(operationToken); } + mOperationToken = null; mOperationHandle = 0; mChunkedStreamer = null; } -- cgit v1.1