未验证 提交 45ab4396 编写于 作者: H hustliyilin 提交者: GitHub

rune/libenclave: Use oneof to distinguish default value and missing value in pb3

If not distinguish default value and missing value in pb3, pb3 will drop default value
in protobuf requests.
Signed-off-by: NYilin Li <YiLin.Li@linux.alibaba.com>
上级 a29c5c58
...@@ -304,10 +304,10 @@ func GetQuote(report []byte, spid string, linkable bool) ([]byte, error) { ...@@ -304,10 +304,10 @@ func GetQuote(report []byte, spid string, linkable bool) ([]byte, error) {
req := pb.AesmServiceRequest{} req := pb.AesmServiceRequest{}
req.GetQuote = &pb.AesmServiceRequest_GetQuote{ req.GetQuote = &pb.AesmServiceRequest_GetQuote{
Report: report, Report: report,
QuoteType: t, QuoteTypePresent: &pb.AesmServiceRequest_GetQuote_QuoteType{QuoteType: t},
Spid: s, Spid: s,
BufSize: SgxMaxQuoteLength, BufSize: SgxMaxQuoteLength,
QeReport: false, QeReportPresent: &pb.AesmServiceRequest_GetQuote_QeReport{QeReport: false},
Timeout: 10000, Timeout: 10000,
} }
......
...@@ -12,12 +12,16 @@ message AesmServiceRequest { ...@@ -12,12 +12,16 @@ message AesmServiceRequest {
message GetQuote { message GetQuote {
bytes report = 1; bytes report = 1;
oneof quote_type_present {
uint32 quote_type = 2; uint32 quote_type = 2;
}
bytes spid = 3; bytes spid = 3;
bytes nonce = 4; bytes nonce = 4;
bytes sig_rl = 5; bytes sig_rl = 5;
uint32 buf_size = 6; uint32 buf_size = 6;
oneof qe_report_present {
bool qe_report = 7; bool qe_report = 7;
}
uint32 timeout = 9; uint32 timeout = 9;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册