1syntax = "proto3"; 2 3package blueberry.facade.security; 4 5import "google/protobuf/empty.proto"; 6import "blueberry/facade/common.proto"; 7import "blueberry/facade/l2cap/classic/facade.proto"; 8import "blueberry/facade/hci/le_initiator_address_facade.proto"; 9 10service SecurityModuleFacade { 11 rpc CreateBond(blueberry.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(blueberry.facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {} 16 rpc CancelBond(blueberry.facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {} 17 rpc RemoveBond(blueberry.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 rpc FetchAdvertisingCallbackEvents(google.protobuf.Empty) returns (stream AdvertisingCallbackMsg) {} 35} 36 37message OobDataMessage { 38 blueberry.facade.BluetoothAddressWithType address = 1; 39 bytes confirmation_value = 2; 40 bytes random_value = 3; 41} 42 43message OobDataBondMessage { 44 blueberry.facade.BluetoothAddressWithType address = 1; 45 OobDataMessage p192_data = 2; 46 OobDataMessage p256_data = 3; 47} 48 49enum UiMsgType { 50 DISPLAY_YES_NO_WITH_VALUE = 0; 51 DISPLAY_YES_NO = 1; 52 DISPLAY_PASSKEY = 2; 53 DISPLAY_PASSKEY_ENTRY = 3; 54 DISPLAY_CANCEL = 4; 55 DISPLAY_PAIRING_PROMPT = 5; 56 DISPLAY_PIN_ENTRY = 6; 57} 58 59message UiMsg { 60 UiMsgType message_type = 1; 61 blueberry.facade.BluetoothAddressWithType peer = 2; 62 uint32 numeric_value = 3; 63 uint32 unique_id = 4; 64} 65 66enum UiCallbackType { 67 YES_NO = 0; 68 PASSKEY = 1; 69 PAIRING_PROMPT = 2; 70 PIN = 3; 71} 72 73message UiCallbackMsg { 74 UiCallbackType message_type = 1; 75 blueberry.facade.BluetoothAddressWithType address = 2; 76 bool boolean = 3; 77 uint32 numeric_value = 4; 78 uint32 unique_id = 5; 79 bytes pin = 6; 80} 81 82enum BondMsgType { 83 DEVICE_BONDED = 0; 84 DEVICE_UNBONDED = 1; 85 DEVICE_BOND_FAILED = 2; 86} 87 88message BondMsg { 89 BondMsgType message_type = 1; 90 blueberry.facade.BluetoothAddressWithType peer = 2; 91 uint32 reason = 3; 92} 93 94enum HelperMsgType { DEVICE_DISCONNECTED = 0; } 95 96message SecurityHelperMsg { 97 HelperMsgType message_type = 1; 98 blueberry.facade.BluetoothAddressWithType peer = 2; 99} 100 101enum IoCapabilities { 102 DISPLAY_ONLY = 0; 103 DISPLAY_YES_NO_IO_CAP = 1; 104 KEYBOARD_ONLY = 2; 105 NO_INPUT_NO_OUTPUT = 3; 106} 107 108message IoCapabilityMessage { 109 IoCapabilities capability = 1; 110} 111 112message LeIoCapabilityMessage { 113 enum LeIoCapabilities { 114 DISPLAY_ONLY = 0; 115 DISPLAY_YES_NO_IO_CAP = 1; 116 KEYBOARD_ONLY = 2; 117 NO_INPUT_NO_OUTPUT = 3; 118 KEYBOARD_DISPLAY = 4; 119 } 120 LeIoCapabilities capabilities = 1; 121} 122 123enum AuthenticationRequirements { 124 NO_BONDING = 0; 125 NO_BONDING_MITM_PROTECTION = 1; 126 DEDICATED_BONDING = 2; 127 DEDICATED_BONDING_MITM_PROTECTION = 3; 128 GENERAL_BONDING = 4; 129 GENERAL_BONDING_MITM_PROTECTION = 5; 130} 131 132message AuthenticationRequirementsMessage { 133 AuthenticationRequirements requirement = 1; 134} 135 136message LeAuthRequirementsMessage { 137 bool bond = 1; 138 bool mitm = 2; 139 bool secure_connections = 3; 140 bool keypress = 4; 141 bool ct2 = 5; 142 uint32 reserved_bits = 6; 143} 144 145message LeMaximumEncryptionKeySizeMessage { 146 uint32 maximum_encryption_key_size = 1; 147} 148 149message LeOobDataPresentMessage { 150 enum LeOobDataFlag { 151 NOT_PRESENT = 0; 152 PRESENT = 1; 153 } 154 155 LeOobDataFlag data_present = 1; 156} 157 158enum OobDataPresent { 159 NOT_PRESENT = 0; 160 P192_PRESENT = 1; 161 P256_PRESENT = 2; 162 P192_AND_256_PRESENT = 3; 163} 164 165message OobDataPresentMessage { 166 OobDataPresent data_present = 1; 167} 168 169message SecurityPolicyMessage { 170 blueberry.facade.BluetoothAddressWithType address = 1; 171 blueberry.facade.l2cap.classic.ClassicSecurityPolicy policy = 2; 172} 173 174message EnforceSecurityPolicyMsg { 175 bool result = 1; 176} 177 178message DisconnectMsg { 179 blueberry.facade.BluetoothAddressWithType address = 1; 180} 181 182enum AdvertisingCallbackMsgType { 183 ADVERTISING_SET_STARTED = 0; 184 OWN_ADDRESS_READ = 1; 185} 186 187enum AdvertisingSetStarted { 188 NOT_STARTED = 0; 189 STARTED = 1; 190} 191 192message AdvertisingCallbackMsg { 193 AdvertisingCallbackMsgType message_type = 1; 194 uint32 advertiser_id = 2; 195 AdvertisingSetStarted advertising_started = 3; 196 blueberry.facade.BluetoothAddress address = 4; 197} 198