Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
inclavare-containers
提交
fee7b69b
I
inclavare-containers
项目概览
openanolis
/
inclavare-containers
通知
4
Star
7
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
5
列表
看板
标记
里程碑
合并请求
0
分析
仓库
DevOps
项目成员
Pages
I
inclavare-containers
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
5
Issue
5
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
fee7b69b
编写于
7月 25, 2020
作者:
H
hustliyilin
提交者:
GitHub
7月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rune/libcontainer: Collect and sanity check attestation parameters
Signed-off-by:
N
Yilin Li
<
YiLin.Li@linux.alibaba.com
>
上级
a9d4c594
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
56 addition
and
54 deletion
+56
-54
rune/libcontainer/configs/validate/validator.go
rune/libcontainer/configs/validate/validator.go
+14
-8
rune/libcontainer/specconv/spec_linux.go
rune/libcontainer/specconv/spec_linux.go
+41
-45
rune/libenclave/attestation/sgx/attest.go
rune/libenclave/attestation/sgx/attest.go
+1
-1
未找到文件。
rune/libcontainer/configs/validate/validator.go
浏览文件 @
fee7b69b
...
@@ -226,16 +226,22 @@ func (v *ConfigValidator) enclave(config *configs.Config) error {
...
@@ -226,16 +226,22 @@ func (v *ConfigValidator) enclave(config *configs.Config) error {
return
err
return
err
}
}
if
config
.
Enclave
.
RaType
!=
sgx
.
UnknownRaType
{
if
config
.
Enclave
.
IsProductEnclave
==
sgx
.
InvalidEnclaveType
{
if
config
.
Enclave
.
IsProductEnclave
==
sgx
.
InvalidEnclaveType
{
return
fmt
.
Errorf
(
"Unsupported enclave.is_product_enclave Configuration %v!
\n
"
,
config
.
Enclave
.
IsProductEnclave
)
return
fmt
.
Errorf
(
"Unsupported enclave.is_product_enclave Configuration!
\n
"
)
}
}
if
config
.
Enclave
.
RaType
==
sgx
.
InvalidRaType
{
if
config
.
Enclave
.
RaEpidSpid
==
""
{
return
fmt
.
Errorf
(
"Unsupported enclave.attestation.ra_type Configuration %v!
\n
"
,
config
.
Enclave
.
RaType
)
return
fmt
.
Errorf
(
"The enclave.attestation.ra_epid_spid Configuration isn't set!
\n
"
)
}
if
config
.
Enclave
.
RaEpidSubscriptionKey
==
""
{
return
fmt
.
Errorf
(
"The enclave.attestation.ra_epid_subscription_key Configuration isn't set!
\n
"
)
}
}
if
config
.
Enclave
.
RaEpidIsLinkable
==
intelsgx
.
InvalidQuoteSignatureType
{
if
config
.
Enclave
.
RaEpidIsLinkable
==
intelsgx
.
InvalidQuoteSignatureType
{
return
fmt
.
Errorf
(
"Unsupported enclave.attestation.ra_epid_is_linkable Configuration %v!
\n
"
,
config
.
Enclave
.
RaEpidIsLinkable
)
return
fmt
.
Errorf
(
"Unsupported enclave.attestation.ra_epid_is_linkable Configuration!
\n
"
)
}
}
}
return
nil
return
nil
...
...
rune/libcontainer/specconv/spec_linux.go
浏览文件 @
fee7b69b
...
@@ -334,53 +334,49 @@ func createEnclaveConfig(spec *specs.Spec, config *configs.Config) {
...
@@ -334,53 +334,49 @@ func createEnclaveConfig(spec *specs.Spec, config *configs.Config) {
args
=
strings
.
Join
(
a
,
" "
)
args
=
strings
.
Join
(
a
,
" "
)
}
}
isProductEnclave
:=
filterOut
(
env
,
"ENCLAVE_IS_PRODUCT_ENCLAVE"
)
if
isProductEnclave
==
""
{
isProductEnclave
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.is_product_enclave"
)
}
var
is_product_enclave
uint32
if
strings
.
EqualFold
(
isProductEnclave
,
"false"
)
{
is_product_enclave
=
sgx
.
DebugEnclave
}
else
if
strings
.
EqualFold
(
isProductEnclave
,
"true"
)
{
is_product_enclave
=
sgx
.
ProductEnclave
}
else
{
is_product_enclave
=
sgx
.
InvalidEnclaveType
}
raType
:=
filterOut
(
env
,
"ENCLAVE_RA_TYPE"
)
raType
:=
filterOut
(
env
,
"ENCLAVE_RA_TYPE"
)
if
raType
==
""
{
if
raType
==
""
{
raType
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_type"
)
raType
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_type"
)
}
}
var
ra_type
uint32
var
enclaveRaType
,
sgxEnclaveType
,
raEpidIsLinkable
uint32
=
sgx
.
UnknownRaType
,
sgx
.
InvalidEnclaveType
,
intelsgx
.
InvalidQuoteSignatureType
var
raEpidSpid
,
raEpidSubscriptionKey
string
if
raType
!=
""
{
if
strings
.
EqualFold
(
raType
,
"EPID"
)
{
if
strings
.
EqualFold
(
raType
,
"EPID"
)
{
ra_t
ype
=
sgx
.
EPID
enclaveRaT
ype
=
sgx
.
EPID
}
else
if
strings
.
EqualFold
(
raType
,
"DCAP"
)
{
}
else
if
strings
.
EqualFold
(
raType
,
"DCAP"
)
{
ra_type
=
sgx
.
DCAP
enclaveRaType
=
sgx
.
DCAP
}
else
{
ra_type
=
sgx
.
InvalidRaType
}
}
ra_epid_spid
:=
filterOut
(
env
,
"ENCLAVE_RA_EPID_SPID"
)
isProductEnclave
:=
filterOut
(
env
,
"ENCLAVE_IS_PRODUCT_ENCLAVE"
)
if
ra_epid_spid
==
""
{
if
isProductEnclave
==
""
{
ra_epid_spid
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_epid_spid"
)
isProductEnclave
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.is_product_enclave"
)
}
if
strings
.
EqualFold
(
isProductEnclave
,
"false"
)
{
sgxEnclaveType
=
sgx
.
DebugEnclave
}
else
if
strings
.
EqualFold
(
isProductEnclave
,
"true"
)
{
sgxEnclaveType
=
sgx
.
ProductEnclave
}
raEpidSpid
=
filterOut
(
env
,
"ENCLAVE_RA_EPID_SPID"
)
if
raEpidSpid
==
""
{
raEpidSpid
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_epid_spid"
)
}
}
ra_epid_subscription_key
:
=
filterOut
(
env
,
"ENCLAVE_RA_EPID_SUB_KEY"
)
raEpidSubscriptionKey
=
filterOut
(
env
,
"ENCLAVE_RA_EPID_SUB_KEY"
)
if
ra_epid_subscription_k
ey
==
""
{
if
raEpidSubscriptionK
ey
==
""
{
ra_epid_subscription_k
ey
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_epid_subscription_key"
)
raEpidSubscriptionK
ey
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_epid_subscription_key"
)
}
}
linkable
:=
filterOut
(
env
,
"ENCLAVE_RA_EPID_IS_LINKABLE"
)
linkable
:=
filterOut
(
env
,
"ENCLAVE_RA_EPID_IS_LINKABLE"
)
if
linkable
==
""
{
if
linkable
==
""
{
linkable
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_epid_is_linkable"
)
linkable
=
libcontainerUtils
.
SearchLabels
(
config
.
Labels
,
"enclave.attestation.ra_epid_is_linkable"
)
}
}
var
ra_epid_is_linkable
uint32
if
strings
.
EqualFold
(
linkable
,
"true"
)
{
if
strings
.
EqualFold
(
linkable
,
"true"
)
{
ra_epid_is_l
inkable
=
intelsgx
.
QuoteSignatureTypeLinkable
raEpidIsL
inkable
=
intelsgx
.
QuoteSignatureTypeLinkable
}
else
if
strings
.
EqualFold
(
linkable
,
"false"
)
{
}
else
if
strings
.
EqualFold
(
linkable
,
"false"
)
{
ra_epid_is_linkable
=
intelsgx
.
QuoteSignatureTypeUnlinkable
raEpidIsLinkable
=
intelsgx
.
QuoteSignatureTypeUnlinkable
}
else
{
}
ra_epid_is_linkable
=
intelsgx
.
InvalidQuoteSignatureType
}
}
if
etype
!=
""
{
if
etype
!=
""
{
...
@@ -388,11 +384,11 @@ func createEnclaveConfig(spec *specs.Spec, config *configs.Config) {
...
@@ -388,11 +384,11 @@ func createEnclaveConfig(spec *specs.Spec, config *configs.Config) {
Type
:
etype
,
Type
:
etype
,
Path
:
path
,
Path
:
path
,
Args
:
args
,
Args
:
args
,
IsProductEnclave
:
is_product_enclav
e
,
IsProductEnclave
:
sgxEnclaveTyp
e
,
RaType
:
ra_t
ype
,
RaType
:
enclaveRaT
ype
,
RaEpidSpid
:
ra
_epid_s
pid
,
RaEpidSpid
:
ra
EpidS
pid
,
RaEpidSubscriptionKey
:
ra
_epid_subscription_k
ey
,
RaEpidSubscriptionKey
:
ra
EpidSubscriptionK
ey
,
RaEpidIsLinkable
:
ra
_epid_is_l
inkable
,
RaEpidIsLinkable
:
ra
EpidIsL
inkable
,
}
}
}
}
}
}
...
...
rune/libenclave/attestation/sgx/attest.go
浏览文件 @
fee7b69b
...
@@ -2,7 +2,7 @@ package sgx // import "github.com/opencontainers/runc/libenclave/attestation/sgx
...
@@ -2,7 +2,7 @@ package sgx // import "github.com/opencontainers/runc/libenclave/attestation/sgx
// RA Type
// RA Type
const
(
const
(
Invalid
RaType
=
iota
Unknown
RaType
=
iota
EPID
EPID
DCAP
DCAP
)
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录