gap: only store link key if it allows requested security level

This commit is contained in:
Matthias Ringwald 2021-05-25 11:22:58 +02:00
parent 6047cb1e01
commit 6edaed7f18
2 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- HID: Move `src/classic/hid.h` into `src` and prefix with `btstack_` to use it with BLE and avoid name clashes
- SM: start pairing as Central for already encrypted connection on Slave Security Request
- GAP: provide Device ID from EIR in GAP_EVENT_INQUIRY_RESULT
- GAP: only store link key if it allows requested security level
## Release v1.3.2

View File

@ -2623,6 +2623,8 @@ static void event_handler(uint8_t *packet, uint16_t size){
// only store link key:
// - if bondable enabled
if (hci_stack->bondable == false) break;
// - if security level sufficient
if (gap_security_level_for_link_key_type(link_key_type) < conn->requested_security_level) break;
// - for SSP, also check if remote side requested bonding as well
if (conn->link_key_type != COMBINATION_KEY){
uint8_t auth_req_ignoring_mitm = conn->io_cap_response_auth_req & 0xfe;