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

🐛 fix challenge offset constants #31

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Conversation

qd-qd
Copy link
Member

@qd-qd qd-qd commented Mar 25, 2024

The constant value used as an offset to retrieve the
challenge from the webauthn response was only correct
for payload of type webauthn.get. This commit makes
the offset value dynamic to also handle webauthn.create
payloads. Both payloads are now correctly supported.

@qd-qd qd-qd self-assigned this Mar 25, 2024
Copy link

github-actions bot commented Mar 25, 2024

Changes to gas cost

Generated at commit: 3e6736fff3a32538a4c84cb215e88e90da5b799b, compared to commit: 8590224fd9c32a94a32182534f8c723e80e260fd

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
WebAuthnWrapper _generateMessage
verify
+63 ❌
+102 ❌
+2.12%
+0.04%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
WebAuthnWrapper 1,465,171 (+24,051) _generateMessage
verify
1,028 (0)
237,845 (+102)
0.00%
+0.04%
3,036 (+63)
237,845 (+102)
+2.12%
+0.04%
3,539 (+100)
237,845 (+102)
+2.91%
+0.04%
7,108 (+100)
237,845 (+102)
+1.43%
+0.04%
771 (0)
1 (0)
WebAuthn256r1Test 3,292,284 (+22,623)

The constant value used as an offset to retrieve the
challenge from the webauthn response was only correct
for payload of type `webauthn.get`. This commit makes
the offset value dynamic to also handle `webauthn.create`
payloads. Both payloads are now correctly supported.
@qd-qd qd-qd force-pushed the fix/webauthn-challenge-offset branch from aa67e99 to faf33fe Compare March 25, 2024 15:43
@qd-qd qd-qd changed the title WIIIP -- Fix challenge offset 🐛 fix challenge offset constants Mar 25, 2024
@qd-qd qd-qd marked this pull request as ready for review March 25, 2024 15:43
@qd-qd qd-qd merged commit faf33fe into main Mar 25, 2024
4 checks passed
@qd-qd qd-qd deleted the fix/webauthn-challenge-offset branch March 25, 2024 15:46
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.

1 participant