Skip to content

Commit 085b747

Browse files
committed
kms: Reject to send keys to outdated TCB nodes
1 parent 1105d9a commit 085b747

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

kms/auth-eth/contracts/KmsAuth.sol

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ contract KmsAuth is
131131
}
132132

133133
// Function to deregister an aggregated MR measurement
134-
function removeKmsAggregatedMr(
135-
bytes32 mrAggregated
136-
) external onlyOwner {
134+
function removeKmsAggregatedMr(bytes32 mrAggregated) external onlyOwner {
137135
kmsAllowedAggregatedMrs[mrAggregated] = false;
138136
emit KmsAggregatedMrRemoved(mrAggregated);
139137
}
@@ -178,6 +176,14 @@ contract KmsAuth is
178176
function isKmsAllowed(
179177
AppBootInfo calldata bootInfo
180178
) external view returns (bool isAllowed, string memory reason) {
179+
// Check if the TCB status is up to date
180+
if (
181+
keccak256(abi.encodePacked(bootInfo.tcbStatus)) !=
182+
keccak256(abi.encodePacked("UpToDate"))
183+
) {
184+
return (false, "TCB status is not up to date");
185+
}
186+
181187
// Check if the aggregated MR is allowed
182188
if (!kmsAllowedAggregatedMrs[bootInfo.mrAggregated]) {
183189
return (false, "Aggregated MR not allowed");

0 commit comments

Comments
 (0)