@@ -14,6 +14,7 @@ import (
1414 "github.com/oasisprotocol/oasis-core/go/common/crypto/hash"
1515 "github.com/oasisprotocol/oasis-core/go/common/node"
1616 "github.com/oasisprotocol/oasis-core/go/common/sgx"
17+ "github.com/oasisprotocol/oasis-core/go/common/sgx/quote"
1718 "github.com/oasisprotocol/oasis-core/go/common/version"
1819 "github.com/oasisprotocol/oasis-core/go/oasis-test-runner/env"
1920 registry "github.com/oasisprotocol/oasis-core/go/registry/api"
@@ -48,8 +49,9 @@ type Runtime struct {
4849 // of this file is discouraged (if not entirely forbidden).
4950 cfgSave runtimeCfgSave
5051
51- teeHardware node.TEEHardware
52- mrSigner * sgx.MrSigner
52+ teeHardware node.TEEHardware
53+ mrSigner * sgx.MrSigner
54+ keyManagerAccessPolicy * quote.Policy
5355
5456 pruner RuntimePrunerCfg
5557
@@ -59,12 +61,13 @@ type Runtime struct {
5961
6062// RuntimeCfg is the Oasis runtime provisioning configuration.
6163type RuntimeCfg struct {
62- ID common.Namespace
63- Kind registry.RuntimeKind
64- Entity * Entity
65- Keymanager * Runtime
66- TEEHardware node.TEEHardware
67- MrSigner * sgx.MrSigner
64+ ID common.Namespace
65+ Kind registry.RuntimeKind
66+ Entity * Entity
67+ Keymanager * Runtime
68+ TEEHardware node.TEEHardware
69+ MrSigner * sgx.MrSigner
70+ KeyManagerAccessPolicy * quote.Policy
6871
6972 Deployments []DeploymentCfg
7073 GenesisRound uint64
@@ -230,14 +233,19 @@ func (rt *Runtime) toRuntimeBundle(index int, cfg *deploymentCfg) (*bundle.Bundl
230233 return fmt .Errorf ("oasis/runtime: failed to derive MRENCLAVE: %w" , err )
231234 }
232235
233- cfg . versionInfo . TEE = cbor . Marshal ( node.SGXConstraints {
236+ sc := node.SGXConstraints {
234237 Enclaves : []sgx.EnclaveIdentity {
235238 {
236239 MrEnclave : * mrEnclave ,
237240 MrSigner : * rt .mrSigner ,
238241 },
239242 },
240- })
243+ }
244+ if rt .keyManagerAccessPolicy != nil {
245+ sc .Versioned = cbor .NewVersioned (1 )
246+ sc .KeyManagerAccessPolicy = rt .keyManagerAccessPolicy
247+ }
248+ cfg .versionInfo .TEE = cbor .Marshal (sc )
241249 cfg .mrEnclave = mrEnclave
242250 return nil
243251 }
@@ -368,12 +376,13 @@ func (net *Network) NewRuntime(cfg *RuntimeCfg) (*Runtime, error) {
368376 cfgSave : runtimeCfgSave {
369377 id : cfg .ID ,
370378 },
371- kind : cfg .Kind ,
372- teeHardware : cfg .TEEHardware ,
373- mrSigner : cfg .MrSigner ,
374- pruner : cfg .Pruner ,
375- excludeFromGenesis : cfg .ExcludeFromGenesis ,
376- descriptor : descriptor ,
379+ kind : cfg .Kind ,
380+ teeHardware : cfg .TEEHardware ,
381+ mrSigner : cfg .MrSigner ,
382+ keyManagerAccessPolicy : cfg .KeyManagerAccessPolicy ,
383+ pruner : cfg .Pruner ,
384+ excludeFromGenesis : cfg .ExcludeFromGenesis ,
385+ descriptor : descriptor ,
377386 }
378387
379388 for _ , deployCfg := range cfg .Deployments {
0 commit comments