Skip to content

Commit

Permalink
T
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Nov 6, 2024
1 parent 063eef9 commit 661cc5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
16 changes: 1 addition & 15 deletions src/utils/WebAuthn.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@ library WebAuthn {
bytes32 s;
}

/// @dev Alternative struct for verification (Ithaca style).
struct WebAuthnMetadata {
// The WebAuthn authenticator data.
bytes authenticatorData;
// The WebAuthn client data JSON.
string clientDataJSON;
// Start index of "challenge":"..." in `clientDataJSON`.
uint256 challengeIndex;
// Start index of "type":"..." in `clientDataJSON`.
uint256 typeIndex;
// Whether to check that the "User Verified" flag in `authenticatorData` is set.
bool requireUserVerification;
}

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
Expand Down Expand Up @@ -180,7 +166,7 @@ library WebAuthn {
if (result) result = P256.verifySignature(h, r, s, x, y);
}

/// @dev Alternative syntax for verification (Ithaca style).
/// @dev Returns if the `auth` is valid.
function verify(
bytes memory challenge,
bool requireUserVerification,
Expand Down
17 changes: 1 addition & 16 deletions src/utils/g/WebAuthn.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,7 @@ struct WebAuthnAuth {
bytes32 s;
}

/// @dev Alternative struct for verification (Ithaca style).
struct WebAuthnMetadata {
// The WebAuthn authenticator data.
bytes authenticatorData;
// The WebAuthn client data JSON.
string clientDataJSON;
// Start index of "challenge":"..." in `clientDataJSON`.
uint256 challengeIndex;
// Start index of "type":"..." in `clientDataJSON`.
uint256 typeIndex;
// Whether to check that the "User Verified" flag in `authenticatorData` is set.
bool requireUserVerification;
}

using WebAuthn for WebAuthnAuth global;
using WebAuthn for WebAuthnMetadata global;

import {Base64} from "../Base64.sol";
import {P256} from "../P256.sol";
Expand Down Expand Up @@ -185,7 +170,7 @@ library WebAuthn {
if (result) result = P256.verifySignature(h, r, s, x, y);
}

/// @dev Alternative syntax for verification (Ithaca style).
/// @dev Returns if the `auth` is valid.
function verify(
bytes memory challenge,
bool requireUserVerification,
Expand Down

0 comments on commit 661cc5f

Please sign in to comment.