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 CreateBondLe(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
13  rpc CancelBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
14  rpc RemoveBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
15  rpc SetIoCapability(IoCapabilityMessage) returns (google.protobuf.Empty) {}
16  rpc SetAuthenticationRequirements(AuthenticationRequirementsMessage) returns (google.protobuf.Empty) {}
17  rpc SetOobDataPresent(OobDataPresentMessage) returns (google.protobuf.Empty) {}
18  rpc SetLeIoCapability(LeIoCapabilityMessage) returns (google.protobuf.Empty) {}
19  rpc SetLeAuthRequirements(LeAuthRequirementsMessage) returns (google.protobuf.Empty) {}
20  rpc GetOutOfBandData(google.protobuf.Empty) returns (OobDataMessage) {}
21  rpc SetOutOfBandData(OobDataMessage) returns (google.protobuf.Empty) {}
22  rpc SetLeOobDataPresent(LeOobDataPresentMessage) returns (google.protobuf.Empty) {}
23  rpc SetLeInitiatorAddressPolicy(hci.PrivacyPolicy) returns (google.protobuf.Empty) {}
24  rpc SendUiCallback(UiCallbackMsg) returns (google.protobuf.Empty) {}
25  rpc FetchUiEvents(google.protobuf.Empty) returns (stream UiMsg) {}
26  rpc FetchBondEvents(google.protobuf.Empty) returns (stream BondMsg) {}
27  rpc EnforceSecurityPolicy(SecurityPolicyMessage) returns (google.protobuf.Empty) {}
28  rpc FetchEnforceSecurityPolicyEvents(google.protobuf.Empty) returns (stream EnforceSecurityPolicyMsg) {}
29}
30
31message OobDataMessage {
32  facade.BluetoothAddressWithType address = 1;
33  bytes le_sc_confirmation_value = 2;
34  bytes le_sc_random_value = 3;
35}
36
37enum UiMsgType {
38  DISPLAY_YES_NO_WITH_VALUE = 0;
39  DISPLAY_YES_NO = 1;
40  DISPLAY_PASSKEY = 2;
41  DISPLAY_PASSKEY_ENTRY = 3;
42  DISPLAY_CANCEL = 4;
43  DISPLAY_PAIRING_PROMPT = 5;
44}
45
46message UiMsg {
47  UiMsgType message_type = 1;
48  facade.BluetoothAddressWithType peer = 2;
49  uint32 numeric_value = 3;
50  uint32 unique_id = 4;
51}
52
53enum UiCallbackType {
54  YES_NO = 0;
55  PASSKEY = 1;
56  PAIRING_PROMPT = 2;
57}
58
59message UiCallbackMsg {
60  UiCallbackType message_type = 1;
61  bool boolean = 2;
62  uint32 numeric_value = 3;
63  uint32 unique_id = 4;
64  facade.BluetoothAddressWithType address = 5;
65}
66
67enum BondMsgType {
68  DEVICE_BONDED = 0;
69  DEVICE_UNBONDED = 1;
70  DEVICE_BOND_FAILED = 2;
71}
72
73message BondMsg {
74  BondMsgType message_type = 1;
75  facade.BluetoothAddressWithType peer = 2;
76}
77
78enum IoCapabilities {
79  DISPLAY_ONLY = 0;
80  DISPLAY_YES_NO_IO_CAP = 1;
81  KEYBOARD_ONLY = 2;
82  NO_INPUT_NO_OUTPUT = 3;
83}
84
85message IoCapabilityMessage {
86  IoCapabilities capability = 1;
87}
88
89message LeIoCapabilityMessage {
90  enum LeIoCapabilities {
91    DISPLAY_ONLY = 0;
92    DISPLAY_YES_NO_IO_CAP = 1;
93    KEYBOARD_ONLY = 2;
94    NO_INPUT_NO_OUTPUT = 3;
95    KEYBOARD_DISPLAY = 4;
96  }
97  LeIoCapabilities capabilities = 1;
98}
99
100enum AuthenticationRequirements {
101  NO_BONDING = 0;
102  NO_BONDING_MITM_PROTECTION = 1;
103  DEDICATED_BONDING = 2;
104  DEDICATED_BONDING_MITM_PROTECTION = 3;
105  GENERAL_BONDING = 4;
106  GENERAL_BONDING_MITM_PROTECTION = 5;
107}
108
109message AuthenticationRequirementsMessage {
110  AuthenticationRequirements requirement = 1;
111}
112
113message LeAuthRequirementsMessage {
114  bool bond = 1;
115  bool mitm = 2;
116  bool secure_connections = 3;
117  bool keypress = 4;
118  bool ct2 = 5;
119  uint32 reserved_bits = 6;
120}
121
122message LeOobDataPresentMessage {
123  enum LeOobDataFlag {
124    NOT_PRESENT = 0;
125    PRESENT = 1;
126  }
127
128  LeOobDataFlag data_present = 1;
129}
130
131enum OobDataPresent {
132  NOT_PRESENT = 0;
133  P192_PRESENT = 1;
134  P256_PRESENT = 2;
135  P192_AND_256_PRESENT = 3;
136}
137
138message OobDataPresentMessage {
139  OobDataPresent data_present = 1;
140}
141
142message SecurityPolicyMessage {
143  facade.BluetoothAddressWithType address = 1;
144  l2cap.classic.ClassicSecurityPolicy policy = 2;
145}
146
147message EnforceSecurityPolicyMsg {
148  bool result = 1;
149}
150