-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: [SIW-860,SIW-946] Add Android integrity implementation #5
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
This reverts commit e707c0e.
shadowsheep1
requested changes
Mar 28, 2024
Co-authored-by: Fabio Bombardi <[email protected]>
Co-authored-by: Fabio Bombardi <[email protected]>
shadowsheep1
requested changes
Mar 28, 2024
Co-authored-by: Fabio Bombardi <[email protected]>
shadowsheep1
approved these changes
Mar 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎉 All dependencies have been resolved ! |
LazyAfternoons
force-pushed
the
SIW-860-integrity-android
branch
from
April 5, 2024 15:38
620ea12
to
a421012
Compare
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.
Important
Depends on #6
Short description
This PR adds the Android implementation to retrive a key attestation and to generate a Play Integrity standard request.
It also implements a basic backend server to verify these attestations.
List of Changes
Adds Android native implementation of the following functions:
isPlayServicesAvailable
which checks whether or not Google Play Services are available on the device. They are request for Play Integrity API to work, along with Play Store;prepareIntegrityToken
is the first function which must be called for a Play Integrity standard request. It prepares the provider which is later used to obtain the integrity token. A Google Cloud Project Number is required and must be provided in the const declaration ofAndroidApp.tsx
;requestIntegrityToken
is the second function to be called for a Play Integrity standard request. ArequestHash
can be provided and will be later checked from the server which decrypts the integrity token;getAttestation
returns the key attestation which will be later checked from the server.Adds backend endpoints implementation of:
/verifyIntegrityToken
which verifies and decodes a Google Play Integrity integrity token and returns its verdict;/verifyAttestation
which verifies the attestation by checking if the root certificate is signed by Google; if each certificate in the chain is signed by the previous one; if there's any revoked certificate in the chain. Each step is implemented separately for clarity's sake, at the cost of cycling through the chain multiple times.The
AndroidApp.tsx
component of the example app incapsulates the whole UI needed to test these function and thus is only rendered if the platform is Android.On iOS these functions are rejected by default.
The
androidRouter.ts
component of the backend exposes any Android related endpoint.How Has This Been Tested?
Run the Android example app by following the instructions in the README.md.
You can test the generated tokens and attestation with the local backend. Read the README.md for more information.
The flow to test a Google Play Integrity check is:
The flow for the key attestation is:
Contact me in private and I'll share my Google Cloud credentials to facilitate the review process.