Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
inclavare-containers
提交
0f0693db
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看板
提交
0f0693db
编写于
9月 03, 2020
作者:
Y
YiLin.Li
提交者:
jia zhang
9月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rune/libenclave: Pass IAS resonpse in the format of map[string]string to init-runelet
Signed-off-by:
N
Yilin Li
<
YiLin.Li@linux.alibaba.com
>
上级
44b238c9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
20 deletion
+21
-20
rune/libenclave/agent.go
rune/libenclave/agent.go
+2
-2
rune/libenclave/internal/runtime/core/core.go
rune/libenclave/internal/runtime/core/core.go
+2
-2
rune/libenclave/internal/runtime/enclave_runtime.go
rune/libenclave/internal/runtime/enclave_runtime.go
+2
-2
rune/libenclave/internal/runtime/pal/pal_linux.go
rune/libenclave/internal/runtime/pal/pal_linux.go
+13
-13
rune/libenclave/runelet.go
rune/libenclave/runelet.go
+2
-1
未找到文件。
rune/libenclave/agent.go
浏览文件 @
0f0693db
...
...
@@ -159,9 +159,9 @@ func handleRequest(conn net.Conn, id int) {
defer
connFile
.
Close
()
if
req
.
Attest
!=
nil
{
logrus
.
Infof
(
"In function handleRequest: get a attest request"
)
logrus
.
Infof
(
"In function handleRequest: get a
n
attest request"
)
resp
.
Attest
=
&
pb
.
AgentServiceResponse_Attest
{}
err
=
enclaveRuntime
.
LaunchAttestation
(
req
.
Attest
.
Spid
,
_
,
err
:
=
enclaveRuntime
.
LaunchAttestation
(
req
.
Attest
.
Spid
,
req
.
Attest
.
SubscriptionKey
,
req
.
Attest
.
Product
,
req
.
Attest
.
QuoteType
)
...
...
rune/libenclave/internal/runtime/core/core.go
浏览文件 @
0f0693db
...
...
@@ -25,8 +25,8 @@ func (pal *enclaveRuntimeCore) Init(args string, logLevel string) (err error) {
return
fmt
.
Errorf
(
"enclave runtime core Init() unimplemented"
)
}
func
(
pal
*
enclaveRuntimeCore
)
Attest
(
string
,
string
,
uint32
,
uint32
)
(
err
error
)
{
return
fmt
.
Errorf
(
"enclave runtime core Attest() unimplemented"
)
func
(
pal
*
enclaveRuntimeCore
)
Attest
(
string
,
string
,
uint32
,
uint32
)
(
map
[
string
]
string
,
error
)
{
return
nil
,
fmt
.
Errorf
(
"enclave runtime core Attest() unimplemented"
)
}
func
(
pal
*
enclaveRuntimeCore
)
Exec
(
cmd
[]
string
,
envp
[]
string
,
stdio
[
3
]
*
os
.
File
)
(
int32
,
error
)
{
...
...
rune/libenclave/internal/runtime/enclave_runtime.go
浏览文件 @
0f0693db
...
...
@@ -12,7 +12,7 @@ import (
type
EnclaveRuntime
interface
{
Init
(
args
string
,
logLevel
string
)
error
Attest
(
string
,
string
,
uint32
,
uint32
)
error
Attest
(
string
,
string
,
uint32
,
uint32
)
(
map
[
string
]
string
,
error
)
Exec
(
cmd
[]
string
,
envp
[]
string
,
stdio
[
3
]
*
os
.
File
)
(
int32
,
error
)
Kill
(
sig
int
,
pid
int
)
error
Destroy
()
error
...
...
@@ -49,7 +49,7 @@ func StartInitialization(config *configs.InitEnclaveConfig, logLevel string) (*E
return
rt
,
nil
}
func
(
rt
*
EnclaveRuntimeWrapper
)
LaunchAttestation
(
spid
string
,
subscriptionKey
string
,
product
uint32
,
quoteType
uint32
)
error
{
func
(
rt
*
EnclaveRuntimeWrapper
)
LaunchAttestation
(
spid
string
,
subscriptionKey
string
,
product
uint32
,
quoteType
uint32
)
(
map
[
string
]
string
,
error
)
{
logrus
.
Debugf
(
"attesting enclave runtime"
)
return
rt
.
runtime
.
Attest
(
spid
,
subscriptionKey
,
product
,
quoteType
)
...
...
rune/libenclave/internal/runtime/pal/pal_linux.go
浏览文件 @
0f0693db
...
...
@@ -87,27 +87,27 @@ func parseAttestParameters(spid string, subscriptionKey string, product uint32)
return
p
}
func
(
pal
*
enclaveRuntimePal
)
Attest
(
spid
string
,
subscriptionKey
string
,
product
uint32
,
quoteType
uint32
)
(
err
error
)
{
func
(
pal
*
enclaveRuntimePal
)
Attest
(
spid
string
,
subscriptionKey
string
,
product
uint32
,
quoteType
uint32
)
(
map
[
string
]
string
,
error
)
{
if
pal
.
GetLocalReport
==
nil
{
return
nil
return
nil
,
nil
}
targetInfo
,
err
:=
intelsgx
.
GetQeTargetInfo
()
if
err
!=
nil
{
return
err
return
nil
,
err
}
if
len
(
targetInfo
)
!=
intelsgx
.
TargetinfoLength
{
return
fmt
.
Errorf
(
"len(targetInfo) is not %d, but %d"
,
intelsgx
.
TargetinfoLength
,
len
(
targetInfo
))
return
nil
,
fmt
.
Errorf
(
"len(targetInfo) is not %d, but %d"
,
intelsgx
.
TargetinfoLength
,
len
(
targetInfo
))
}
// get local report of SGX
report
,
err
:=
pal
.
GetLocalReport
(
targetInfo
)
if
err
!=
nil
{
return
err
return
nil
,
err
}
if
len
(
report
)
!=
intelsgx
.
ReportLength
{
return
fmt
.
Errorf
(
"len(report) is not %d, but %d"
,
intelsgx
.
ReportLength
,
len
(
report
))
return
nil
,
fmt
.
Errorf
(
"len(report) is not %d, but %d"
,
intelsgx
.
ReportLength
,
len
(
report
))
}
// get quote from QE(aesmd)
...
...
@@ -117,12 +117,12 @@ func (pal *enclaveRuntimePal) Attest(spid string, subscriptionKey string, produc
}
quote
,
err
:=
intelsgx
.
GetQuote
(
report
,
spid
,
linkable
)
if
err
!=
nil
{
return
err
return
nil
,
err
}
q
:=
&
intelsgx
.
Quote
{}
if
err
:=
restruct
.
Unpack
(
quote
,
binary
.
LittleEndian
,
&
q
);
err
!=
nil
{
return
err
return
nil
,
err
}
// get IAS remote attestation report
...
...
@@ -131,20 +131,20 @@ func (pal *enclaveRuntimePal) Attest(spid string, subscriptionKey string, produc
svc
,
err
:=
attestation
.
NewService
(
p
,
verbose
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
return
err
return
nil
,
err
}
if
err
=
svc
.
Check
(
quote
);
err
!=
nil
{
log
.
Fatal
(
err
)
return
err
return
nil
,
err
}
status
,
_
,
err
:=
svc
.
GetVerifiedReport
(
quote
)
status
,
iasReport
,
err
:=
svc
.
GetVerifiedReport
(
quote
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"%s"
,
err
)
return
nil
,
fmt
.
Errorf
(
"%s"
,
err
)
}
svc
.
ShowStatus
(
status
)
return
nil
return
iasReport
,
nil
}
rune/libenclave/runelet.go
浏览文件 @
0f0693db
...
...
@@ -73,7 +73,7 @@ func StartInitialization(cmd []string, cfg *RuneletConfig) (exitCode int32, err
// Launch a remote attestation to the enclave runtime.
if
config
.
RaType
==
sgx
.
EPID
{
if
err
=
rt
.
LaunchAttestation
(
config
.
RaEpidSpid
,
config
.
RaEpidSubscriptionKey
,
config
.
IsProductEnclave
,
config
.
RaEpidIsLinkable
);
err
!=
nil
{
if
_
,
err
:
=
rt
.
LaunchAttestation
(
config
.
RaEpidSpid
,
config
.
RaEpidSubscriptionKey
,
config
.
IsProductEnclave
,
config
.
RaEpidIsLinkable
);
err
!=
nil
{
return
1
,
err
}
}
...
...
@@ -313,6 +313,7 @@ func remoteAttest(agentPipe *os.File, config *configs.InitEnclaveConfig, notifyS
}
else
{
err
=
fmt
.
Errorf
(
resp
.
Attest
.
Error
)
}
return
resp
.
Attest
.
ExitCode
,
err
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录