-
Notifications
You must be signed in to change notification settings - Fork 494
Ursache: 2000 - etwas ist schiefgelaufen. #1214
Comments
The string "something went wrong during a critical part of the application ensuring security, please refer" + The actual error 2000 seems to come from https://github.com/corona-warn-app/cwa-app-android/blob/master/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/security/SecurityHelper.kt . |
@d4rken FYI: see comments above. Related to #642 (comment) Tink? - Keystore busy? |
Likely the same cause as #642 |
Hey @kereng5, Thanks for your report. The issue has been forwarded to the developers and is tracked as Jira ticket EXPOSUREAPP-2871. Regards, Corona-Warn-App Open Source Team |
@d4rken looking to the screenshots above: |
I think the |
Hi @d4rken , CWA wants to read a special value from a key/value-pair in ESP -> API call androidx.security -> Tink calls AndroidKeyStore for de-/encryption key -> SharedPreferences are opened -> all keys (of the key/value-pairs) in SharedPreferences are decrypted -> key found: value is decrypted -> value is returned to CWA in the end. CWA wants to write a special value to a key/value-pair in ESP -> API call androidx.security -> Tink calls AndroidKeyStore for de-/encryption key -> SharedPreferences are opened -> all keys (of the key/value-pairs) in SharedPreferences are decrypted -> key found: value is stored encrpted - OR: key not found: key/value-pair is stored encrypted -> SharedPreferences are saved and closed. Is this assumption plausible? According to this comment tink-crypto/tink#321 (comment) , there are two options in case of error in the currently used version: either a new key/value-pair is created, or the master key (from AndroidKeyStore) for de-/encryption is changed. EncryptedSharedPreferences then would only be not accessible at all, if the master key was changed. I guess, that is the reason why CWA crashes in the beginning. EncryptedSharedPreferences can be accessed, if the master key is still usable, but a single read from key/value-pair may fail. I think, this is what originally caused 9002: file is not a database, when key/value-pair for the db-password could not be read. So, in above case, it might have happened, that master key was still intact, but key/value-pair was not readable and it failed with cause 2000, but a new key/value-pair might have been created. Interesting question: if that new pair is created, but not overwritten, could it be possible, that the original pair can be read again, after the AndroidKeyStore becomes accessible again and decryption of the original values works fine? To examine this, the SharedPreferences.xml would need to be examined. If it contains more entries than values are needed for CWA, then this could have happened. By the way: I think that the KeyStore busy problem does not only occur when several apps are accessing the KeyStore in the same time, but also when a single app uses the KeyStore frequently. Does it make sense? |
I can't answer all of that reliably as I currently don't know enough. We only create the These comments seem to support that 1 and 2. So I currently don't see how it could fail to only access part of the keys. You are right though that the initial 9002 error behavior without new onboarding somehow doesn't fit. It's really a difficult issue to debug
I don't think it reaccesses the systems keystore for that again after it has already done so.
I have thought about that too, especially with our app woes of being killed in the background by battery optimizations. Maybe it's a combination of
There will be an overhaul of our LocalData class and I'll consider changing everything to |
@d4rken
Ok, got it. Thx for the link.
Makes sense in this context.
Probably...
This sounds really good.
This is probably the best solution. Some people call me obsessive about data privacy, but I can't find any critical information to protect additionally in a second layer at the moment. Ah... Only critical information would be a positive test result, but I don't know at the moment, if the result is stored/cached locally? Or is it always fetched from server on runtime? Anyway, thanks again, and I hope you find some time to relax this week-end. |
Dear @kereng5 and community , Did the error happen to you again in the latest releases of the Corona Warn App? Regards, Corona-Warn-App Open Source Team |
@heinezen In CwaSecurityException.kt#L8-L9
could be reformatted to:
for better readability if the error does reoccur. |
@heinezen |
Closing this because we received positive feedback. @MikeMcC399 's remark about the error message was also fixed. Corona-Warn-App Open Source Team |
Helly, I have the same issue "Ursache 2001" I already checked the certificates of safety but its all set... |
|
Avoid duplicates
I have searched for "2000" and found no matching issue.
Describe the bug
After opening CWA:
Sorry, I did not hit "DETAILS" because I supposed "Ursache: 2000" would already be well known.
(Note the spelling error "referto")
Expected behaviour
CWA should perform the check and show the green screen below.
Steps to reproduce the issue
Technical details
Additional context
The ENF log shows 14 lines all with 08:37.
So there was just the error message but no enduring problem.
Internal Tracking ID: EXPOSUREAPP-2871
The text was updated successfully, but these errors were encountered: