This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 496
Perform data reset for users already affected by the encryption issues (EXPOSUREAPP-1851/EXPOSUREAPP-2958) #1256
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e) already affected by the pre 1.4.0 encryption error. If encountered the preference and database file will be deleted, then we will retry to generate an EncryptedSharedPreferences instance, and show the user a popup about what happened. TODO: This still has placeholders for the popup dialog.
d4rken
added
bug
Something isn't working
maintainers
Tag pull requests created by maintainers
do not merge
1.4.0
labels
Sep 29, 2020
Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainFragment.kt
Show resolved
Hide resolved
Early returns help code readability if used as guard closes.
…nto fix/encryption-error-recovery
ralfgehrer
previously approved these changes
Sep 29, 2020
Corona-Warn-App/src/device/java/de.rki.coronawarnapp/ui/main/MainFragment.kt
Show resolved
Hide resolved
Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainFragment.kt
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/security/EncryptionErrorResetTool.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/security/EncryptionErrorResetTool.kt
Show resolved
Hide resolved
chris-cwa
previously approved these changes
Sep 29, 2020
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/security/EncryptionErrorResetTool.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/security/SecurityHelper.kt
Show resolved
Hide resolved
d4rken
changed the title
Perform data reset for users already affected by the encryption issues
Perform data reset for users already affected by the encryption issues (EXPOSUREAPP-1851/EXPOSUREAPP-2958)
Sep 29, 2020
chris-cwa
reviewed
Sep 29, 2020
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/security/EncryptionErrorResetTool.kt
Outdated
Show resolved
Hide resolved
kolyaopahle
reviewed
Sep 29, 2020
AlexanderAlferov
approved these changes
Sep 29, 2020
ralfgehrer
approved these changes
Sep 29, 2020
chris-cwa
approved these changes
Sep 29, 2020
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE but review 😉This still needs the final translations for the info dialog after a reset.Description
The mitigation from #1235 only helps users not already affected by the issue (see #642).
Existing users will still keep crashing. There is graceful recovery because the encryption key is gone.
They have to reset their app data. We can do this for them. If the user has automatic updates enabled in Google Play, there may be users who have already been affected, don't know it yet, and where it will be fixed automatically too. They will only see a dialog when they open their app the next time, informing them about what happened (see mock screenshot).
The result should be that the app automatically starts working again if an affected user updates it. We will loose the encrypted data, but the automatic tasks should be able to work again and thus the app perform it's duty.
When do we do it?
GeneralSecurityException("decryption failed")
What do we do?
How to test
throw GeneralSecurityException("decryption failed")
into theactually, insert it into the SecurityHelper, otherwise we keep throwing. Install the new version without data reset. You should see the app reset and then display the dialog, once.EncryptedPreferencesFactory