Skip to content

Commit

Permalink
chore: cast to uint256 before zero compare
Browse files Browse the repository at this point in the history
  • Loading branch information
cpb8010 committed Feb 12, 2025
1 parent ff8273d commit ee5b26a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/validators/WebAuthValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ contract WebAuthValidator is VerifierCaller, IModuleValidator {
upperKeyHalf[originDomain][msg.sender] = key32[1];

// we're returning true if this was a new key, false for update
bool keyExists = initialLowerHalf == 0 && initialUpperHalf == 0;
bool keyExists = uint256(initialLowerHalf) == 0 && uint256(initialUpperHalf) == 0;

emit PasskeyCreated(msg.sender, originDomain);

Expand Down Expand Up @@ -133,7 +133,7 @@ contract WebAuthValidator is VerifierCaller, IModuleValidator {
pubkey[0] = lowerKeyHalf[origin][msg.sender];
pubkey[1] = upperKeyHalf[origin][msg.sender];
// This really only validates the origin is set
if (pubkey[0] == 0 || pubkey[1] == 0) {
if (uint256(pubkey[0]) == 0 || uint256(pubkey[1]) == 0) {
return false;
}

Expand Down

0 comments on commit ee5b26a

Please sign in to comment.