未验证 提交 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
......@@ -303,12 +303,12 @@ func GetQuote(report []byte, spid string, linkable bool) ([]byte, error) {
req := pb.AesmServiceRequest{}
req.GetQuote = &pb.AesmServiceRequest_GetQuote{
Report: report,
QuoteType: t,
Spid: s,
BufSize: SgxMaxQuoteLength,
QeReport: false,
Timeout: 10000,
Report: report,
QuoteTypePresent: &pb.AesmServiceRequest_GetQuote_QuoteType{QuoteType: t},
Spid: s,
BufSize: SgxMaxQuoteLength,
QeReportPresent: &pb.AesmServiceRequest_GetQuote_QeReport{QeReport: false},
Timeout: 10000,
}
rdata, err := transmitAesmd(conn, &req)
......
......@@ -12,12 +12,16 @@ message AesmServiceRequest {
message GetQuote {
bytes report = 1;
uint32 quote_type = 2;
oneof quote_type_present {
uint32 quote_type = 2;
}
bytes spid = 3;
bytes nonce = 4;
bytes sig_rl = 5;
uint32 buf_size = 6;
bool qe_report = 7;
oneof qe_report_present {
bool qe_report = 7;
}
uint32 timeout = 9;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册