BLE: improved pairing security (#4240)

* ble: use unique root security keys for new pairings after pairing reset; added migrations for existing pairing data; unit_tests: added migration tests

* bt: lower logging level

* hal: bt: updated doxygen strings

* hal: ble: Added checks for root_keys ptr

* service: ble: bt_keys_storage minor cleanup
This commit is contained in:
hedger
2025-09-24 19:36:45 +01:00
committed by GitHub
parent 30077dd512
commit 0d5beedb01
11 changed files with 391 additions and 86 deletions

View File

@@ -6,6 +6,7 @@
#include <furi_hal_version.h>
#define GAP_MAC_ADDR_SIZE (6)
#define GAP_KEY_SIZE (0x10)
/*
* GAP helpers - background thread that handles BLE GAP events and advertising.
@@ -83,7 +84,18 @@ typedef struct {
GapConnectionParamsRequest conn_param;
} GapConfig;
bool gap_init(GapConfig* config, GapEventCallback on_event_cb, void* context);
typedef struct {
// Encryption Root key. Must be unique per-device (or app)
uint8_t erk[GAP_KEY_SIZE];
// Identity Root key. Used for resolving RPAs, if configured
uint8_t irk[GAP_KEY_SIZE];
} GapRootSecurityKeys;
bool gap_init(
GapConfig* config,
const GapRootSecurityKeys* root_keys,
GapEventCallback on_event_cb,
void* context);
void gap_start_advertising(void);