Skip to content
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

Add Explicit Master Key Alias for Encrypted Shared Prefs #612

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

sshropshire
Copy link
Contributor

Summary of changes

Checklist

  • Added a changelog entry

Authors

List GitHub usernames for everyone who contributed to this pull request.

@sshropshire sshropshire requested a review from a team as a code owner October 20, 2022 15:00
Copy link
Contributor

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👻

@@ -27,7 +28,7 @@ private BraintreeSharedPreferences() {}

static SharedPreferences getSharedPreferences(Context context) {
try {
MasterKey masterKey = new MasterKey.Builder(context)
MasterKey masterKey = new MasterKey.Builder(context, BRAINTREE_KEY_ALIAS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically this change switches from using the default key alias, to using com.braintreepayments.api.masterkey.

I know we use BraintreeSharedPreferences for config caching, but is there anything else it is used for that is merchant-facing, where changing this key value could break a merchant integration? Could they be relying on it for anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I can think of. The storage is mostly ephemeral, even config is cached for 5 minutes at a time I believe.

@sshropshire sshropshire merged commit 1423d0d into master Oct 25, 2022
@sshropshire sshropshire deleted the shared_prefs_key_alias branch October 25, 2022 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants