diff --git a/modules/passkey/contracts/WebAuthnSigner.sol b/modules/passkey/contracts/WebAuthnSigner.sol index fba58f56..488ee099 100644 --- a/modules/passkey/contracts/WebAuthnSigner.sol +++ b/modules/passkey/contracts/WebAuthnSigner.sol @@ -62,6 +62,8 @@ contract WebAuthnSigner is SignatureValidator { * @dev A factory contract for creating and managing WebAuthn signers. */ contract WebAuthnSignerFactory is ICustom256BitECSignerFactory, SignatureValidatorConstants { + address private constant SECP256R1_PRECOMPILE_ADDRESS = address(0x0b); + // @inheritdoc ICustom256BitECSignerFactory function getSigner(uint256 qx, uint256 qy, address verifier) public view override returns (address signer) { bytes32 codeHash = keccak256(abi.encodePacked(type(WebAuthnSigner).creationCode, qx, qy, uint256(uint160(verifier)))); @@ -85,7 +87,8 @@ contract WebAuthnSignerFactory is ICustom256BitECSignerFactory, SignatureValidat */ function _validVerifier(address verifier) internal view returns (bool) { // The verifier should contain code (The only way to implement a webauthn verifier is with a smart contract) - return !_hasNoCode(verifier); + // or be the precompile address for the secp256r1 curve defined in the RIP-7212 + return !_hasNoCode(verifier) || verifier == SECP256R1_PRECOMPILE_ADDRESS; } // @inheritdoc ICustom256BitECSignerFactory