Skip to content

Commit 3aefcc2

Browse files
committed
Fixup: Remove redundant UseKMAPolicy flag (tentative)
1 parent 675d4e5 commit 3aefcc2

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
@@ -590,10 +590,6 @@ type CapabilityTEEVerifyParams struct {
590590
// NodeID is the node identity the attestation must be bound to.
591591
NodeID signature.PublicKey
592592

593-
// UseKMAPolicy specifies whether optional key manager access policy
594-
// overrides default policy.
595-
UseKMAPolicy bool
596-
597593
// IsFeatureVersion242 is true for consensus at version 24.2 or higher.
598594
IsFeatureVersion242 bool
599595
}
@@ -629,7 +625,6 @@ func (c *CapabilityTEE) Verify(params CapabilityTEEVerifyParams) error {
629625
c.RAK,
630626
c.REK,
631627
params.NodeID,
632-
params.UseKMAPolicy,
633628
)
634629
default:
635630
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
@@ -439,7 +439,6 @@ func isSuitableExecutorWorker(
439439
Height: uint64(ctx.LastHeight()),
440440
Constraints: activeDeployment.TEE,
441441
NodeID: n.node.ID,
442-
UseKMAPolicy: true,
443442
IsFeatureVersion242: isFeatureVersion242,
444443
}); err != nil {
445444
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
Now: ts,
850846
Height: height,
851847
Constraints: rtVersionInfo.TEE,
852848
NodeID: nodeID,
853-
UseKMAPolicy: useKMAPolicy,
854849
IsFeatureVersion242: isFeatureVersion242,
855850
}); err != nil {
856851
logger.Error("VerifyNodeRuntimeEnclaveIDs: failed to validate attestation",

0 commit comments

Comments
 (0)