-
Notifications
You must be signed in to change notification settings - Fork 277
Fix WebView passkey excludeCredentials bug (b/363019823) #201
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,14 @@ var __webauthn_hooks__; | |||||||||||||||||||||||||||||||||||
| var encodedString = CM_base64url_encode(temppk.user.id); | ||||||||||||||||||||||||||||||||||||
| temppk.user.id = encodedString; | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| if (temppk.hasOwnProperty('excludeCredentials')) { | ||||||||||||||||||||||||||||||||||||
| for (var i = 0; i < temppk.excludeCredentials.length; i++) { | ||||||||||||||||||||||||||||||||||||
| if (temppk.excludeCredentials[i].hasOwnProperty('id')) { | ||||||||||||||||||||||||||||||||||||
| var encodedId = CM_base64url_encode(temppk.excludeCredentials[i].id); | ||||||||||||||||||||||||||||||||||||
| temppk.excludeCredentials[i].id = encodedId; | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To prevent potential runtime crashes, we should use more defensive checks. If Using
Suggested change
|
||||||||||||||||||||||||||||||||||||
| var jsonObj = {"type":"create", "request":temppk} | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| var json = JSON.stringify(jsonObj); | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
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.
The minified JavaScript code in
INJECTED_VALshould be kept in sync with the changes made toencode.js. Updating this string ensures that the robust checks forexcludeCredentialsare also executed by the WebView.