diff --git a/rune/libcontainer/configs/enclave.go b/rune/libcontainer/configs/enclave.go index a739268152622ce4d8591d242ebdb8c4b9cba636..e129dc2609d3b5df8527c8b2326846cd8e5ed027 100644 --- a/rune/libcontainer/configs/enclave.go +++ b/rune/libcontainer/configs/enclave.go @@ -7,7 +7,11 @@ const ( ) type Enclave struct { - Type string `json:"type"` - Path string `json:"path"` - Args string `json:"args,omitempty"` + Type string `json:"type"` + Path string `json:"path"` + Args string `json:"args,omitempty"` + RaType string `json:"ra_type,omitempty"` + RaEpidSpid string `json:"ra_epid_spid,omitempty"` + RaEpidSubscriptionKey string `json:"ra_epid_subscription_key,omitempty"` + RaEpidQuoteType string `json:"ra_epid_quote_type,omitempty"` } diff --git a/rune/libcontainer/process_linux.go b/rune/libcontainer/process_linux.go index 716c69543a000b4cfd521f755db1a11a985276ce..89e18bde299817c1916d01eaea8f22b299dd9abf 100644 --- a/rune/libcontainer/process_linux.go +++ b/rune/libcontainer/process_linux.go @@ -141,9 +141,13 @@ func (p *setnsProcess) start() (err error) { return newSystemErrorWithCause(nil, "received syncT 'EnclaveConfigReq'") } config := &enclave_configs.InitEnclaveConfig{ - Type: p.config.Config.Enclave.Type, - Path: p.config.Config.Enclave.Path, - Args: p.config.Config.Enclave.Args, + Type: p.config.Config.Enclave.Type, + Path: p.config.Config.Enclave.Path, + Args: p.config.Config.Enclave.Args, + RaType: p.config.Config.Enclave.RaType, + RaEpidSpid: p.config.Config.Enclave.RaEpidSpid, + RaEpidSubscriptionKey: p.config.Config.Enclave.RaEpidSubscriptionKey, + RaEpidQuoteType: p.config.Config.Enclave.RaEpidQuoteType, } err := utils.WriteJSON(p.messageSockPair.parent, config) if err != nil { @@ -471,9 +475,13 @@ func (p *initProcess) start() (retErr error) { return newSystemErrorWithCause(nil, "received syncT 'EnclaveConfigReq'") } config := &enclave_configs.InitEnclaveConfig{ - Type: p.config.Config.Enclave.Type, - Path: p.config.Config.Enclave.Path, - Args: p.config.Config.Enclave.Args, + Type: p.config.Config.Enclave.Type, + Path: p.config.Config.Enclave.Path, + Args: p.config.Config.Enclave.Args, + RaType: p.config.Config.Enclave.RaType, + RaEpidSpid: p.config.Config.Enclave.RaEpidSpid, + RaEpidSubscriptionKey: p.config.Config.Enclave.RaEpidSubscriptionKey, + RaEpidQuoteType: p.config.Config.Enclave.RaEpidQuoteType, } err := utils.WriteJSON(p.messageSockPair.parent, config) if err != nil { diff --git a/rune/libcontainer/specconv/spec_linux.go b/rune/libcontainer/specconv/spec_linux.go index aba9be96c8cf732c2d192e65bbb728071cb2ca66..d65c31fad1e5a733ba1851d78afc2754bebecfcc 100644 --- a/rune/libcontainer/specconv/spec_linux.go +++ b/rune/libcontainer/specconv/spec_linux.go @@ -332,11 +332,35 @@ func createEnclaveConfig(spec *specs.Spec, config *configs.Config) { args = strings.Join(a, " ") } + ra_type := filterOut(env, "ENCLAVE_RA_TYPE") + if ra_type == "" { + ra_type = libcontainerUtils.SearchLabels(config.Labels, "ra_type") + } + + ra_epid_spid := filterOut(env, "ENCLAVE_RA_EPID_SPID") + if ra_epid_spid == "" { + ra_epid_spid = libcontainerUtils.SearchLabels(config.Labels, "ra_epid_spid") + } + + ra_epid_subscription_key := filterOut(env, "ENCLAVE_RA_EPID_SUB_KEY") + if ra_epid_subscription_key == "" { + ra_epid_subscription_key = libcontainerUtils.SearchLabels(config.Labels, "ra_epid_subscription_key") + } + + ra_epid_quote_type := filterOut(env, "ENCLAVE_RA_EPID_SIGNATURE_TYPE") + if ra_epid_quote_type == "" { + ra_epid_quote_type = libcontainerUtils.SearchLabels(config.Labels, "ra_epid_quote_type") + } + if etype != "" { config.Enclave = &configs.Enclave{ - Type: etype, - Path: path, - Args: args, + Type: etype, + Path: path, + Args: args, + RaType: ra_type, + RaEpidSpid: ra_epid_spid, + RaEpidSubscriptionKey: ra_epid_subscription_key, + RaEpidQuoteType: ra_epid_quote_type, } } } diff --git a/rune/libenclave/configs/config.go b/rune/libenclave/configs/config.go index 66a0ff679eeb80922628d54732dc8f7894bc507f..0514018ccb288c411d41e7dd03741ff853f45f3e 100644 --- a/rune/libenclave/configs/config.go +++ b/rune/libenclave/configs/config.go @@ -1,7 +1,11 @@ package configs // import "github.com/opencontainers/runc/libenclave/configs" type InitEnclaveConfig struct { - Type string `json:"type"` - Path string `json:"path"` - Args string `json:"args"` + Type string `json:"type"` + Path string `json:"path"` + Args string `json:"args"` + RaType string `json:"ra_type"` + RaEpidSpid string `json:"ra_epid_spid"` + RaEpidSubscriptionKey string `json:"ra_epid_subscription_key"` + RaEpidQuoteType string `json:"ra_epid_quote_type"` }