Skip to content

Commit b594fc7

Browse files
committed
Fixup: Remove redundant UseKMAPolicy flag (tentative)
1 parent 9bbc723 commit b594fc7

5 files changed

Lines changed: 2 additions & 17 deletions

File tree

go/common/node/node.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,6 @@ type CapabilityTEEVerifyParams struct {
566566
// NodeID is the node identity the TEE capability must be bound to.
567567
NodeID signature.PublicKey
568568

569-
// UseKMAPolicy specifies whether optional key manager access policy
570-
// overrides default policy.
571-
UseKMAPolicy bool
572-
573569
// IsFeatureVersion261 is true for consensus at version 26.1 or higher.
574570
IsFeatureVersion261 bool
575571
}
@@ -620,7 +616,6 @@ func (c *CapabilityTEE) Verify(params CapabilityTEEVerifyParams) error {
620616
c.RAK,
621617
c.REK,
622618
params.NodeID,
623-
params.UseKMAPolicy,
624619
)
625620
default:
626621
return ErrInvalidTEEHardware

go/common/node/sgx.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ func (sa *SGXAttestation) Verify(
258258
rak signature.PublicKey,
259259
rek *x25519.PublicKey,
260260
nodeID signature.PublicKey,
261-
useKMAPolicy bool,
262261
) error {
263262
if cfg == nil {
264263
cfg = &emptyFeatures
@@ -269,7 +268,7 @@ func (sa *SGXAttestation) Verify(
269268
// See https://github.com/oasisprotocol/oasis-core/issues/6459.
270269
cfg.SGX.ApplyDefaultConstraints(sc)
271270

272-
policy := sc.ResolvePolicy(useKMAPolicy)
271+
policy := sc.ResolvePolicy(true)
273272

274273
// Verify the quote.
275274
verifiedQuote, err := sa.Quote.Verify(policy, ts)

go/common/node/sgx_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,9 @@ func TestKeyManagerAccessPolicySanity(t *testing.T) {
291291
var nodeID signature.PublicKey
292292
cfg := &TEEFeatures{SGX: TEEFeaturesSGX{PCS: true}}
293293

294-
err = sa.Verify(cfg, time.Now(), 0, &sc, rak, nil, nodeID, true)
294+
err = sa.Verify(cfg, time.Now(), 0, &sc, rak, nil, nodeID)
295295
require.Error(err, "attestation should be rejected when key manager access policy is used")
296296
require.ErrorContains(err, "PCS quotes are disabled by policy")
297-
298-
err = sa.Verify(cfg, time.Now(), 0, &sc, rak, nil, nodeID, false)
299-
require.NoError(err, "attestation should pass when falling back to default policy")
300297
}
301298

302299
func FuzzSGXConstraints(f *testing.F) {

go/consensus/cometbft/apps/scheduler/scheduler.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ func isSuitableExecutorWorker(
443443
Height: uint64(ctx.LastHeight()),
444444
Constraints: activeDeployment.TEE,
445445
NodeID: n.node.ID,
446-
UseKMAPolicy: true,
447446
IsFeatureVersion261: isFeatureVersion261,
448447
}); err != nil {
449448
ctx.Logger().Warn("failed to verify node TEE attestation",

go/registry/api/api.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,17 +840,12 @@ func VerifyNodeRuntimeEnclaveIDs(
840840
continue
841841
}
842842

843-
// Use the key manager access policy (if it exists) for compute runtimes.
844-
// This is safe because only nodes with TEE capabilities reach this point,
845-
// which implies a compute or observer role.
846-
useKMAPolicy := regRt.Kind == KindCompute
847843
if err := rt.Capabilities.TEE.Verify(node.CapabilityTEEVerifyParams{
848844
Features: teeCfg,
849845
Time: ts,
850846
Height: height,
851847
Constraints: rtVersionInfo.TEE,
852848
NodeID: nodeID,
853-
UseKMAPolicy: useKMAPolicy,
854849
IsFeatureVersion261: isFeatureVersion261,
855850
}); err != nil {
856851
logger.Error("VerifyNodeRuntimeEnclaveIDs: failed to validate attestation",

0 commit comments

Comments
 (0)