-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[secure-store][android] Secure store audit #23804
Merged
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
# Conflicts: # packages/expo-secure-store/build/SecureStore.d.ts.map # packages/expo-secure-store/build/SecureStore.js.map
behenate
force-pushed
the
@behenate/secure-store-api-migration
branch
from
August 3, 2023 10:44
9cc1f06
to
b076255
Compare
lukmccall
reviewed
Aug 7, 2023
...ges/expo-secure-store/android/src/main/java/expo/modules/securestore/AuthenticationHelper.kt
Outdated
Show resolved
Hide resolved
...ges/expo-secure-store/android/src/main/java/expo/modules/securestore/AuthenticationHelper.kt
Outdated
Show resolved
Hide resolved
...ges/expo-secure-store/android/src/main/java/expo/modules/securestore/AuthenticationPrompt.kt
Outdated
Show resolved
Hide resolved
...secure-store/android/src/main/java/expo/modules/securestore/encryptors/HybridAESEncryptor.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Expo Bot <[email protected]>
expo-bot
added
bot: passed checks
ExpoBot has nothing to complain about
and removed
bot: suggestions
ExpoBot has some suggestions
labels
Aug 7, 2023
lukmccall
reviewed
Aug 8, 2023
android/expoview/src/main/java/versioned/host/exp/exponent/ExperiencePackagePicker.kt
Show resolved
Hide resolved
…tion' into @behenate/secure-store-api-migration
tsapeta
reviewed
Aug 8, 2023
lukmccall
reviewed
Aug 21, 2023
...oview/src/main/java/versioned/host/exp/exponent/modules/universal/ScopedSecureStoreModule.kt
Show resolved
Hide resolved
# Conflicts: # packages/expo-secure-store/CHANGELOG.md
lukmccall
approved these changes
Aug 24, 2023
# Conflicts: # android/expoview/src/main/java/versioned/host/exp/exponent/modules/universal/ExpoModuleRegistryAdapter.kt
tsapeta
approved these changes
Aug 25, 2023
behenate
added a commit
that referenced
this pull request
Dec 5, 2023
# Why In #23804 I modified the behaviour of SecureStore to be consistent with iOS. This introduced a change, where trying to get a value from a keychain service in which it isn't registered will return null instead of throwing an exception. (I would prefer to do it the other way around - throwing an exception in that case seems to make more sense - it was not possible to do on iOS) This causes one of the tests to fail in `test-suite` # How Removed OS type check from the failing test # Test Plan ✅ `native-component-list` in unversioned Expo Go
behenate
added a commit
that referenced
this pull request
Dec 7, 2023
…dling (#23841) # Why Synchronous read and write functions will be added to Android in this PR #23804, we need to add them to iOS too. The Android PR also changes the keychain handling to allow users to save authenticated and unauthenticated values under the same keychain, this PR adds similar changes to iOS. # How Added synchronous functions, keychainService will now add a "auth" or "no-auth" suffix to it's name to allow saving authenticated and unauthenticated values into the same keychain from the JS perspective. This behaviour is a more intuitive for the users and makes Android and iOS versions of the module work exactly the same, but adds some complexity on the native side. # Test Plan Tested on a physical iOS 16 device. ## Do NOT merge before #23804 as this PR relies on some code changes from that PR
onizam95
pushed a commit
to onizam95/expo-av-drm
that referenced
this pull request
Jan 15, 2024
# Why In expo#23804 I modified the behaviour of SecureStore to be consistent with iOS. This introduced a change, where trying to get a value from a keychain service in which it isn't registered will return null instead of throwing an exception. (I would prefer to do it the other way around - throwing an exception in that case seems to make more sense - it was not possible to do on iOS) This causes one of the tests to fail in `test-suite` # How Removed OS type check from the failing test # Test Plan ✅ `native-component-list` in unversioned Expo Go
onizam95
pushed a commit
to onizam95/expo-av-drm
that referenced
this pull request
Jan 15, 2024
…dling (expo#23841) # Why Synchronous read and write functions will be added to Android in this PR expo#23804, we need to add them to iOS too. The Android PR also changes the keychain handling to allow users to save authenticated and unauthenticated values under the same keychain, this PR adds similar changes to iOS. # How Added synchronous functions, keychainService will now add a "auth" or "no-auth" suffix to it's name to allow saving authenticated and unauthenticated values into the same keychain from the JS perspective. This behaviour is a more intuitive for the users and makes Android and iOS versions of the module work exactly the same, but adds some complexity on the native side. # Test Plan Tested on a physical iOS 16 device. ## Do NOT merge before expo#23804 as this PR relies on some code changes from that PR
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
ENG-6327
Secure-store was using the old modules API. We wanted to add synchronous functions to the API, so it's possible to use SecureStore in the global JS scope. During the migration I've also found some bugs/unexpected behaviours which were corrected
How
secure-store
to Kotlin and the new modules APIgetItemSync
andsetItemSync
functionssecure-store
always asked for biometrics correctly)Secure-store
can now differentiate between them. Before savingvalue1
underkey1
andkeychain1
andvalue2
underkey1
andkeychain2
would overwrite thevalue1
underkey1
with a new value. Now they are separate. This archived by saving the items in shared preferences under a key which includes the keychain eq.keychain1-key1
andkeychain2-key1
. This emulates theios
secure-store
behaviorexpo-secure-store
as it is not possible to determine if value was stored with a keychain without making an decryption attempt.Test Plan
Tested in Bare Expo and Expo Go on a physical android 13 and 7 devices (forced api < 23 functions on android 7 only for testing since we don't have such an old device)