提交 e35cb5b5 编写于 作者: Y YiLin.Li 提交者: jia zhang

rune/libenclave: Pass IAS response in the format of protobuf from init-runelet to runelet

Signed-off-by: NYilin Li <YiLin.Li@linux.alibaba.com>
上级 0f0693db
......@@ -161,7 +161,7 @@ func handleRequest(conn net.Conn, id int) {
if req.Attest != nil {
logrus.Infof("In function handleRequest: get an attest request")
resp.Attest = &pb.AgentServiceResponse_Attest{}
_, err := enclaveRuntime.LaunchAttestation(req.Attest.Spid,
iasReport, err := enclaveRuntime.LaunchAttestation(req.Attest.Spid,
req.Attest.SubscriptionKey,
req.Attest.Product,
req.Attest.QuoteType)
......@@ -170,7 +170,16 @@ func handleRequest(conn net.Conn, id int) {
} else {
exitCode = 0
}
resp.Attest.ExitCode = exitCode
resp.Attest.StatusCode = iasReport["StatusCode"]
resp.Attest.RequestID = iasReport["Request-ID"]
resp.Attest.XIasreportSignature = iasReport["X-Iasreport-Signature"]
resp.Attest.XIasreportSigningCertificate = iasReport["X-Iasreport-Signing-Certificate"]
resp.Attest.ContentLength = iasReport["ContentLength"]
resp.Attest.ContentType = iasReport["Content-Type"]
resp.Attest.Body = iasReport["Body"]
protoBufWrite(conn, resp)
return
}
......
......@@ -319,11 +319,18 @@ func (m *AgentServiceResponse_Execute) GetError() string {
}
type AgentServiceResponse_Attest struct {
ExitCode int32 `protobuf:"varint,1,opt,name=exitCode,proto3" json:"exitCode,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
ExitCode int32 `protobuf:"varint,1,opt,name=exitCode,proto3" json:"exitCode,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
StatusCode string `protobuf:"bytes,3,opt,name=statusCode,proto3" json:"statusCode,omitempty"`
RequestID string `protobuf:"bytes,4,opt,name=requestID,proto3" json:"requestID,omitempty"`
XIasreportSignature string `protobuf:"bytes,5,opt,name=xIasreportSignature,proto3" json:"xIasreportSignature,omitempty"`
XIasreportSigningCertificate string `protobuf:"bytes,6,opt,name=xIasreportSigningCertificate,proto3" json:"xIasreportSigningCertificate,omitempty"`
ContentLength string `protobuf:"bytes,7,opt,name=contentLength,proto3" json:"contentLength,omitempty"`
ContentType string `protobuf:"bytes,8,opt,name=contentType,proto3" json:"contentType,omitempty"`
Body string `protobuf:"bytes,9,opt,name=body,proto3" json:"body,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AgentServiceResponse_Attest) Reset() { *m = AgentServiceResponse_Attest{} }
......@@ -365,6 +372,55 @@ func (m *AgentServiceResponse_Attest) GetError() string {
return ""
}
func (m *AgentServiceResponse_Attest) GetStatusCode() string {
if m != nil {
return m.StatusCode
}
return ""
}
func (m *AgentServiceResponse_Attest) GetRequestID() string {
if m != nil {
return m.RequestID
}
return ""
}
func (m *AgentServiceResponse_Attest) GetXIasreportSignature() string {
if m != nil {
return m.XIasreportSignature
}
return ""
}
func (m *AgentServiceResponse_Attest) GetXIasreportSigningCertificate() string {
if m != nil {
return m.XIasreportSigningCertificate
}
return ""
}
func (m *AgentServiceResponse_Attest) GetContentLength() string {
if m != nil {
return m.ContentLength
}
return ""
}
func (m *AgentServiceResponse_Attest) GetContentType() string {
if m != nil {
return m.ContentType
}
return ""
}
func (m *AgentServiceResponse_Attest) GetBody() string {
if m != nil {
return m.Body
}
return ""
}
func init() {
proto.RegisterType((*AgentServiceRequest)(nil), "libenclave_proto.AgentServiceRequest")
proto.RegisterType((*AgentServiceRequest_Execute)(nil), "libenclave_proto.AgentServiceRequest.Execute")
......@@ -380,27 +436,34 @@ func init() {
}
var fileDescriptor_145c985d4df28d67 = []byte{
// 343 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x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, 0xb0, 0x3e, 0xb4, 0x8c, 0x58, 0xd1, 0x78, 0x9b, 0x17, 0x65,
0xf0, 0x09, 0x9d, 0x52, 0xbe, 0xe0, 0x8c, 0x12, 0xcb, 0x9d, 0x56, 0x51, 0xb3, 0x31, 0x9c, 0x9b,
0x6c, 0x61, 0x62, 0x2d, 0x94, 0x15, 0x32, 0x9d, 0xe3, 0xd6, 0xc9, 0x56, 0xdb, 0xcc, 0x87, 0xae,
0xd2, 0x72, 0x99, 0xc5, 0xe5, 0x6e, 0x67, 0x7c, 0xf7, 0x64, 0x17, 0xd0, 0x5b, 0x67, 0xd2, 0xe2,
0xdb, 0x56, 0xa1, 0xef, 0xd1, 0xdf, 0xa1, 0x31, 0xfa, 0x6a, 0xc2, 0xf0, 0x78, 0x67, 0xa3, 0x64,
0x6a, 0x90, 0x3d, 0x1d, 0x9d, 0x2b, 0xfc, 0x2b, 0xa9, 0x92, 0xaa, 0xdc, 0x6b, 0xb6, 0xcf, 0xbb,
0x59, 0xef, 0xe8, 0x4e, 0xa5, 0x12, 0xf8, 0xc3, 0x21, 0xf0, 0x00, 0x4e, 0x70, 0x23, 0xec, 0xb3,
0x5c, 0xa2, 0x4b, 0x71, 0xff, 0x66, 0x43, 0x68, 0xa3, 0xd6, 0x52, 0xbb, 0x88, 0xca, 0x47, 0x70,
0xbf, 0x0f, 0xf8, 0xdf, 0xec, 0xa2, 0x43, 0x1e, 0xef, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfa,
0xac, 0x2e, 0xf0, 0xfa, 0x02, 0x00, 0x00,
// 455 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x6a, 0xdb, 0x40,
0x10, 0xc6, 0x89, 0x2d, 0xdb, 0xd1, 0x84, 0xd0, 0xb0, 0xce, 0x61, 0x11, 0xa1, 0x84, 0xd0, 0x43,
0x28, 0x8d, 0xe8, 0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0x73, 0x6b, 0x08, 0x0d, 0x7d, 0x45, 0x53, 0xd0, 0x4f, 0x39, 0x62, 0x68, 0x53, 0x14,
0xa7, 0x70, 0xd0, 0x0a, 0xbc, 0x17, 0xfb, 0xdc, 0xf3, 0x5c, 0x0a, 0xfb, 0x38, 0xb5, 0xb3, 0xa5,
0x8c, 0x9b, 0x7d, 0x0c, 0xf5, 0x74, 0xc8, 0x43, 0xfb, 0xf4, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd5,
0xb7, 0xb8, 0x57, 0x0b, 0x04, 0x00, 0x00,
}
......@@ -33,6 +33,13 @@ message AgentServiceResponse {
message Attest {
int32 exitCode = 1;
string error = 2;
string statusCode = 3;
string requestID = 4;
string xIasreportSignature = 5;
string xIasreportSigningCertificate = 6;
string contentLength = 7;
string contentType = 8;
string body = 9;
}
Execute exec = 1;
......
......@@ -314,6 +314,7 @@ func remoteAttest(agentPipe *os.File, config *configs.InitEnclaveConfig, notifyS
err = fmt.Errorf(resp.Attest.Error)
}
logrus.Infof("In runelet, resp.Attest = %v", resp.Attest)
return resp.Attest.ExitCode, err
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册