Skip to content

Commit

Permalink
Add one require to isDKIMPublicKeyHashValid in UserOverridableDKIMReg…
Browse files Browse the repository at this point in the history
…istry
  • Loading branch information
SoraSuegami committed Oct 24, 2024
1 parent 057b8e9 commit e518903
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/contracts/UserOverrideableDKIMRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ contract UserOverrideableDKIMRegistry is
/// @param authorizer The address of the expected authorizer
/// @return bool True if the DKIM public key hash is valid, false otherwise.
/// @dev This function returns true if 1) at least the given `authorizer` approves the public key hash before `enabledTimeOfDKIMPublicKeyHash` and 2) neither `mainAuthorizer` nor `authorizer` revokes the public key hash. However, after `enabledTimeOfDKIMPublicKeyHash`, only one of their approvals is required. In addition, if the public key hash is reactivated by the `authorizer`, the public key hash revoked only by `mainAuthorizer` is considered valid.
/// @dev The domain name, public key hash, and authorizer address must not be zero.
/// @dev The authorizer address cannot be the mainAuthorizer.
function isDKIMPublicKeyHashValid(
string memory domainName,
bytes32 publicKeyHash,
Expand All @@ -112,6 +114,10 @@ contract UserOverrideableDKIMRegistry is
require(bytes(domainName).length > 0, "domain name cannot be zero");
require(publicKeyHash != bytes32(0), "public key hash cannot be zero");
require(authorizer != address(0), "authorizer address cannot be zero");
require(
authorizer != mainAuthorizer,
"authorizer cannot be mainAuthorizer"
);
uint256 revokeThreshold = _computeRevokeThreshold(
publicKeyHash,
authorizer
Expand Down

0 comments on commit e518903

Please sign in to comment.