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

chore: [SIW-1208] Use base64url for iOS integrity keys #88

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

LazyAfternoons
Copy link
Contributor

@LazyAfternoons LazyAfternoons commented Jun 8, 2024

List of Changes

  • Edit generateIntegrityHarwareKeyTag to use the function exposed io-react-native-jwt to convert the base64 key returned from the native method to base64url;
  • Edit getHardwareSignatureWithAuthData and getAttestation to convert the base64url key used in this package to base64 which is what io-react-native-integrity uses;
  • Defines getAttestation for Android as well due to different implementation which previously converged into the same native method.

Motivation and Context

Currently, io-wallet might return a 500 while creating a wallet instance on iOS due to the hardware key tag being encoded in base64 and thus having characters which can't be stored on the underlying Cosmos DB.
This PR converts the base64 key tag to base64url in the IntegrityContext, thus making it safe to be stored on Cosmos DB.
This doesn't happen on Android as the we can decide the name of the key tag used.

I belive this change belongs to this package rather than io-react-native-integrity which should be agnostic.

How Has This Been Tested?

  • Run an instance of apps/io-wallet-user-func from io-wallet with an appropriate local.settings.json (I can provide it privately) by pointing at the branch used for this PR;
  • Run an instance of dev-proxy in this example folder by providing a .env file pointing at the running azure function of the previous point (http://localhost:7071/api/v1 by default). I can provide the remaining variables privately);
  • Run the example app on both Android and iOS by providing a .env file. The WALLET_PROVIDER_BASE_URL should point to the IP of your local machine URL where the dev-proxy is running (again, I can provide the remaining variables privately). Consequentially press every available button in the app and everything should work just fine.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Contributor

@grausof grausof left a comment

Choose a reason for hiding this comment

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

❤️

@LazyAfternoons LazyAfternoons added this pull request to the merge queue Jun 13, 2024
Merged via the queue into master with commit 4402fd4 Jun 13, 2024
7 checks passed
@LazyAfternoons LazyAfternoons deleted the SIW-1208-base64url-keytag-ios branch June 13, 2024 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants