delete local keys on account removal

This commit is contained in:
tobiaskaminsky 2017-12-20 15:24:50 +01:00 committed by tobiasKaminsky
parent 128f3c97c8
commit 21a04b1bfe
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -40,6 +40,7 @@ import com.owncloud.android.datamodel.SyncedFolderProvider;
import com.owncloud.android.datamodel.UploadsStorageManager;
import com.owncloud.android.ui.activity.ContactsPreferenceActivity;
import com.owncloud.android.ui.events.AccountRemovedEvent;
import com.owncloud.android.utils.EncryptionUtils;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.utils.FilesSyncHelper;
@ -115,6 +116,10 @@ public class AccountRemovalJob extends Job implements AccountManagerCallback<Boo
filesystemDataProvider.deleteAllEntriesForSyncedFolder(Long.toString(syncedFolderId));
}
// delete stored E2E keys
arbitraryDataProvider.deleteKeyForAccount(account.name, EncryptionUtils.PRIVATE_KEY);
arbitraryDataProvider.deleteKeyForAccount(account.name, EncryptionUtils.PUBLIC_KEY);
return Result.SUCCESS;
} else {
return Result.FAILURE;