nimble/host: Update existing bond while re-pairing

While re-pairing ble_store_config_find_sec function was checking peer address,
ediv and random number. Even if peer address was the same, the bond could be
recognized as not the one we was looking for, because ediv and random number
could be different. This was causting issues when the BLE_STORE_MAX_BONDS syscfg val
was used. Re-pairing to the same device was treated as pairing to the
new device and if current number of bonds was the same as BLE_STORE_MAX_BONDS,
the re-pairing was failing.
This commit is contained in:
Michal Gorecki
2023-03-20 10:05:01 +01:00
committed by Andrzej Kaczmarek
parent 64758379a6
commit 7cc8c08d67
7 changed files with 33 additions and 104 deletions
-13
View File
@@ -2258,17 +2258,6 @@ cmd_keystore_parse_keydata(int argc, char **argv, union ble_store_key *out,
return rc;
}
out->sec.ediv = parse_arg_uint16("ediv", &rc);
if (rc != 0) {
console_printf("invalid 'ediv' parameter\n");
return rc;
}
out->sec.rand_num = parse_arg_uint64("rand", &rc);
if (rc != 0) {
console_printf("invalid 'rand' parameter\n");
return rc;
}
return 0;
default:
@@ -2317,8 +2306,6 @@ cmd_keystore_parse_valuedata(int argc, char **argv,
return rc;
}
out->sec.peer_addr = key->sec.peer_addr;
out->sec.ediv = key->sec.ediv;
out->sec.rand_num = key->sec.rand_num;
break;
}