/ components / protocomm / proto / sec1.proto
sec1.proto
 1  syntax = "proto3";
 2  
 3  import "constants.proto";
 4  
 5  /* Data structure of Session command1 packet */
 6  message SessionCmd1 {
 7      bytes client_verify_data = 2;
 8  }
 9  
10  /* Data structure of Session response1 packet */
11  message SessionResp1 {
12      Status status = 1;
13      bytes device_verify_data = 3;
14  }
15  
16  /* Data structure of Session command0 packet */
17  message SessionCmd0 {
18      bytes client_pubkey = 1;
19  }
20  
21  /* Data structure of Session response0 packet */
22  message SessionResp0 {
23      Status status = 1;
24      bytes device_pubkey = 2;
25      bytes device_random = 3;
26  }
27  
28  /* A message must be of type Cmd0 / Cmd1 / Resp0 / Resp1 */
29  enum Sec1MsgType {
30      Session_Command0 = 0;
31      Session_Response0 = 1;
32      Session_Command1 = 2;
33      Session_Response1 = 3;
34  }
35  
36  /* Payload structure of session data */
37  message Sec1Payload {
38      Sec1MsgType msg = 1;        /*!< Type of message */
39      oneof payload {
40          SessionCmd0 sc0 = 20;   /*!< Payload data interpreted as Cmd0 */
41          SessionResp0 sr0 = 21;  /*!< Payload data interpreted as Resp0 */
42          SessionCmd1 sc1 = 22;   /*!< Payload data interpreted as Cmd1 */
43          SessionResp1 sr1 = 23;  /*!< Payload data interpreted as Resp1 */
44      }
45  }