1syntax = "proto3";
2
3package bluetooth.security;
4
5import "google/protobuf/empty.proto";
6import "facade/common.proto";
7import "l2cap/classic/facade.proto";
8import "hci/facade/le_initiator_address_facade.proto";
9
10service SecurityModuleFacade {
11  rpc CreateBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
12  rpc CreateBondOutOfBand(OobDataBondMessage) returns (google.protobuf.Empty) {}
13  rpc GetOutOfBandData(google.protobuf.Empty) returns (google.protobuf.Empty) {}
14  rpc FetchGetOutOfBandDataEvents(google.protobuf.Empty) returns (stream OobDataBondMessage) {}
15  rpc CreateBondLe(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
16  rpc CancelBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
17  rpc RemoveBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
18  rpc SetIoCapability(IoCapabilityMessage) returns (google.protobuf.Empty) {}
19  rpc SetAuthenticationRequirements(AuthenticationRequirementsMessage) returns (google.protobuf.Empty) {}
20  rpc SetLeIoCapability(LeIoCapabilityMessage) returns (google.protobuf.Empty) {}
21  rpc SetLeAuthRequirements(LeAuthRequirementsMessage) returns (google.protobuf.Empty) {}
22  rpc SetLeMaximumEncryptionKeySize(LeMaximumEncryptionKeySizeMessage) returns (google.protobuf.Empty) {}
23  rpc GetLeOutOfBandData(google.protobuf.Empty) returns (OobDataMessage) {}
24  rpc SetOutOfBandData(OobDataMessage) returns (google.protobuf.Empty) {}
25  rpc SetLeOobDataPresent(LeOobDataPresentMessage) returns (google.protobuf.Empty) {}
26  rpc SetLeInitiatorAddressPolicy(hci.PrivacyPolicy) returns (google.protobuf.Empty) {}
27  rpc SendUiCallback(UiCallbackMsg) returns (google.protobuf.Empty) {}
28  rpc FetchUiEvents(google.protobuf.Empty) returns (stream UiMsg) {}
29  rpc FetchBondEvents(google.protobuf.Empty) returns (stream BondMsg) {}
30  rpc FetchHelperEvents(google.protobuf.Empty) returns (stream SecurityHelperMsg) {}
31  rpc EnforceSecurityPolicy(SecurityPolicyMessage) returns (google.protobuf.Empty) {}
32  rpc FetchEnforceSecurityPolicyEvents(google.protobuf.Empty) returns (stream EnforceSecurityPolicyMsg) {}
33  rpc FetchDisconnectEvents(google.protobuf.Empty) returns (stream DisconnectMsg) {}
34}
35
36message OobDataMessage {
37  facade.BluetoothAddressWithType address = 1;
38  bytes confirmation_value = 2;
39  bytes random_value = 3;
40}
41
42message OobDataBondMessage {
43  facade.BluetoothAddressWithType address = 1;
44  OobDataMessage p192_data = 2;
45  OobDataMessage p256_data = 3;
46}
47
48enum UiMsgType {
49  DISPLAY_YES_NO_WITH_VALUE = 0;
50  DISPLAY_YES_NO = 1;
51  DISPLAY_PASSKEY = 2;
52  DISPLAY_PASSKEY_ENTRY = 3;
53  DISPLAY_CANCEL = 4;
54  DISPLAY_PAIRING_PROMPT = 5;
55  DISPLAY_PIN_ENTRY = 6;
56}
57
58message UiMsg {
59  UiMsgType message_type = 1;
60  facade.BluetoothAddressWithType peer = 2;
61  uint32 numeric_value = 3;
62  uint32 unique_id = 4;
63}
64
65enum UiCallbackType {
66  YES_NO = 0;
67  PASSKEY = 1;
68  PAIRING_PROMPT = 2;
69  PIN = 3;
70}
71
72message UiCallbackMsg {
73  UiCallbackType message_type = 1;
74  facade.BluetoothAddressWithType address = 2;
75  bool boolean = 3;
76  uint32 numeric_value = 4;
77  uint32 unique_id = 5;
78  bytes pin = 6;
79}
80
81enum BondMsgType {
82  DEVICE_BONDED = 0;
83  DEVICE_UNBONDED = 1;
84  DEVICE_BOND_FAILED = 2;
85}
86
87message BondMsg {
88  BondMsgType message_type = 1;
89  facade.BluetoothAddressWithType peer = 2;
90  uint32 reason = 3;
91}
92
93enum HelperMsgType { DEVICE_DISCONNECTED = 0; }
94
95message SecurityHelperMsg {
96  HelperMsgType message_type = 1;
97  facade.BluetoothAddressWithType peer = 2;
98}
99
100enum IoCapabilities {
101  DISPLAY_ONLY = 0;
102  DISPLAY_YES_NO_IO_CAP = 1;
103  KEYBOARD_ONLY = 2;
104  NO_INPUT_NO_OUTPUT = 3;
105}
106
107message IoCapabilityMessage {
108  IoCapabilities capability = 1;
109}
110
111message LeIoCapabilityMessage {
112  enum LeIoCapabilities {
113    DISPLAY_ONLY = 0;
114    DISPLAY_YES_NO_IO_CAP = 1;
115    KEYBOARD_ONLY = 2;
116    NO_INPUT_NO_OUTPUT = 3;
117    KEYBOARD_DISPLAY = 4;
118  }
119  LeIoCapabilities capabilities = 1;
120}
121
122enum AuthenticationRequirements {
123  NO_BONDING = 0;
124  NO_BONDING_MITM_PROTECTION = 1;
125  DEDICATED_BONDING = 2;
126  DEDICATED_BONDING_MITM_PROTECTION = 3;
127  GENERAL_BONDING = 4;
128  GENERAL_BONDING_MITM_PROTECTION = 5;
129}
130
131message AuthenticationRequirementsMessage {
132  AuthenticationRequirements requirement = 1;
133}
134
135message LeAuthRequirementsMessage {
136  bool bond = 1;
137  bool mitm = 2;
138  bool secure_connections = 3;
139  bool keypress = 4;
140  bool ct2 = 5;
141  uint32 reserved_bits = 6;
142}
143
144message LeMaximumEncryptionKeySizeMessage {
145  uint32 maximum_encryption_key_size = 1;
146}
147
148message LeOobDataPresentMessage {
149  enum LeOobDataFlag {
150    NOT_PRESENT = 0;
151    PRESENT = 1;
152  }
153
154  LeOobDataFlag data_present = 1;
155}
156
157enum OobDataPresent {
158  NOT_PRESENT = 0;
159  P192_PRESENT = 1;
160  P256_PRESENT = 2;
161  P192_AND_256_PRESENT = 3;
162}
163
164message OobDataPresentMessage {
165  OobDataPresent data_present = 1;
166}
167
168message SecurityPolicyMessage {
169  facade.BluetoothAddressWithType address = 1;
170  l2cap.classic.ClassicSecurityPolicy policy = 2;
171}
172
173message EnforceSecurityPolicyMsg {
174  bool result = 1;
175}
176
177message DisconnectMsg {
178  facade.BluetoothAddressWithType address = 1;
179}
180