File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
features/FEATURE_BLE/targets/TARGET_CORDIO/source Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -210,11 +210,19 @@ ble_error_t CordioSecurityManager::set_ltk(
210
210
bool mitm,
211
211
bool secure_connections
212
212
) {
213
- // FIXME: get access to the security level of a key
213
+ uint8_t security_level = DM_SEC_LEVEL_NONE;
214
+ if (secure_connections) {
215
+ security_level = DM_SEC_LEVEL_ENC_LESC;
216
+ } else if (mitm) {
217
+ security_level = DM_SEC_LEVEL_ENC_AUTH;
218
+ } else {
219
+ security_level = DM_SEC_LEVEL_ENC;
220
+ }
221
+
214
222
DmSecLtkRsp (
215
223
connection,
216
224
/* key found */ true ,
217
- /* sec level ??? */ DM_SEC_LEVEL_ENC_AUTH ,
225
+ /* sec level */ security_level ,
218
226
const_cast <uint8_t *>(ltk.data ())
219
227
);
220
228
return BLE_ERROR_NONE;
@@ -226,7 +234,7 @@ ble_error_t CordioSecurityManager::set_ltk_not_found(
226
234
DmSecLtkRsp (
227
235
connection,
228
236
/* key found */ false ,
229
- /* sec level ??? */ DM_SEC_LEVEL_NONE,
237
+ /* sec level */ DM_SEC_LEVEL_NONE,
230
238
NULL
231
239
);
232
240
You can’t perform that action at this time.
0 commit comments