Skip to content

Commit

Permalink
bluetooth: nrf52: Fix the IRK not saving in bonding information
Browse files Browse the repository at this point in the history
Fix the IRK not saving in bonding information caused by reversing
the source and destination of the memory copy.
  • Loading branch information
SPRESENSE committed Oct 18, 2024
1 parent b58ca51 commit 34ccc4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/modules/bluetooth/hal/nrf52/ble_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ static void set_bondinfo_for_save_event(struct ble_bondinfo_s *apps,
nrf52->bondInfo.addr,
BLE_GAP_ADDR_LENGTH);

memcpy(nrf52->ownIdKey.id_info.irk, apps->own.irk, BLE_GAP_SEC_KEY_LEN);
memcpy(nrf52->peerIdKey.id_info.irk, apps->peer.irk, BLE_GAP_SEC_KEY_LEN);
memcpy(apps->own.irk, nrf52->ownIdKey.id_info.irk, BLE_GAP_SEC_KEY_LEN);
memcpy(apps->peer.irk, nrf52->peerIdKey.id_info.irk, BLE_GAP_SEC_KEY_LEN);
set_EncKey_for_save_event(&apps->own, &nrf52->ownEncKey);
set_EncKey_for_save_event(&apps->peer, &nrf52->peerEncKey);

Expand Down

0 comments on commit 34ccc4e

Please sign in to comment.