Skip to content

Commit

Permalink
fix: challenge validation (#88)
Browse files Browse the repository at this point in the history
fixes the length of the challenge slice for webauthn validation + a few
minor fixes for the playwright tests
  • Loading branch information
sarahschwartz authored Sep 30, 2024
1 parent e7897fd commit 30ba846
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions code/webauthn/contracts/contracts/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ contract Account is IAccount, IERC1271 {
// ANCHOR_END: callVerifier

function extractChallengeFromClientData(bytes memory clientDataJSON) public pure returns (string memory) {
bytes memory challengeSlice = slice(clientDataJSON, 36, 58);
bytes memory challengeSlice = slice(clientDataJSON, 36, 88);
string memory challenge = string(challengeSlice);
return challenge;
}
Expand Down Expand Up @@ -319,7 +319,7 @@ contract Account is IAccount, IERC1271 {
if (base64Bytes[i] == '/') base64Bytes[i] = '_';
}

return string(slice(base64Bytes, 0, 58));
return string(base64Bytes);
}

fallback() external {
Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/erc20-paymaster/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Next, navigate into the project directory and install the dependencies:
:test-action{actionId="npm-install"}

```sh
cd custom-paymaster-tutorial && npm install --force
cd custom-paymaster-tutorial && npm install
```

:test-action{actionId="wait-for-install"}
Expand Down
2 changes: 1 addition & 1 deletion tests/configs/daily-spend-limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { IStepConfig } from '../utils/types';
export const steps: IStepConfig = {
'initialize-project': {
action: 'runCommand',
prompts: 'Private key of the wallet: |npm: ',
prompts: 'Private key of the wallet: |npm: ',
},
'wait-for-init': {
action: 'wait',
Expand Down
2 changes: 1 addition & 1 deletion tests/configs/erc20-paymaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { IStepConfig } from '../utils/types';
export const steps: IStepConfig = {
'initialize-hardhat-project': {
action: 'runCommand',
prompts: 'Private key of the wallet:0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110|npm: ',
prompts: 'Private key of the wallet:0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110|npm: ',
},
'wait-for-init': {
action: 'wait',
Expand Down

0 comments on commit 30ba846

Please sign in to comment.