Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/FlashtestationRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ contract FlashtestationRegistry is
* @notice Verifies + Registers a TEE workload with a specific TEE-controlled address in the FlashtestationRegistry
* @dev In order to mitigate DoS attacks, the quote must be less than 20KB
* @dev This is a costly operation (5 million gas) and should be used sparingly.
* @param caller The address from which registration request originates, must match the one in the quote
* @param signer The address from which registration request originates, must match the one in the quote
* @param rawQuote The raw quote from the TEE device. Must be a V4 TDX quote
* @param extendedRegistrationData Abi-encoded application specific attested data
*/
function doRegister(address caller, bytes calldata rawQuote, bytes calldata extendedRegistrationData)
function doRegister(address signer, bytes calldata rawQuote, bytes calldata extendedRegistrationData)
internal
limitBytesSize(rawQuote)
limitBytesSize(extendedRegistrationData)
Expand All @@ -158,8 +158,8 @@ contract FlashtestationRegistry is

// Ensure that the caller is the TEE-controlled address, otherwise we have no guarantees that
// the TEE-controlled address is the one that is registering the TEE
if (caller != teeAddress) {
revert SenderMustMatchTEEAddress(caller, teeAddress);
if (signer != teeAddress) {
revert SignerMustMatchTEEAddress(signer, teeAddress);
}

// Verify that the extended registration data matches the hash in the TDX report data
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IFlashtestationRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ interface IFlashtestationRegistry {
error ByteSizeExceeded(uint256 size);
/// @notice Emitted when the TEE service is already registered when registering
error TEEServiceAlreadyRegistered(address teeAddress);
/// @notice Emitted when the sender must match the TEE address
error SenderMustMatchTEEAddress(address sender, address teeAddress);
/// @notice Emitted when the signer doesn't match the TEE address
error SignerMustMatchTEEAddress(address signer, address teeAddress);
/// @notice Emitted when the TEE service is not registered
error TEEServiceNotRegistered(address teeAddress);
/// @notice Emitted when the TEE service is already invalid when trying to invalidate a TEE registration
Expand Down
2 changes: 1 addition & 1 deletion test/FlashtestationRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ contract FlashtestationRegistryTest is Test {
vm.prank(differentAddress);
vm.expectRevert(
abi.encodeWithSelector(
IFlashtestationRegistry.SenderMustMatchTEEAddress.selector, differentAddress, expectedAddress
IFlashtestationRegistry.SignerMustMatchTEEAddress.selector, differentAddress, expectedAddress
)
);
registry.registerTEEService(mockQuote, mockf200.extData);
Expand Down