Skip to content

Commit 2af5508

Browse files
committed
Nordic BLE: Do not conditionnaly assign sm key pointers.
This change has been forced by a change in latest softdevice that requires all key pointers to not be NULL unlike what is indicated in the documentation.
1 parent dc54da0 commit 2af5508

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5x/source/nRF5xPalSecurityManager.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,28 +1136,17 @@ ble_gap_sec_keyset_t nRF5xSecurityManager::make_keyset(
11361136
pairing_cb.initiator_dist = initiator_dist;
11371137
pairing_cb.responder_dist = responder_dist;
11381138

1139-
KeyDistribution* own_dist = NULL;
1140-
KeyDistribution* peer_dist = NULL;
1141-
1142-
if (pairing_cb.role == PAIRING_INITIATOR) {
1143-
own_dist = &initiator_dist;
1144-
peer_dist = &responder_dist;
1145-
} else {
1146-
own_dist = &responder_dist;
1147-
peer_dist = &initiator_dist;
1148-
}
1149-
11501139
ble_gap_sec_keyset_t keyset = {
11511140
/* keys_own */ {
1152-
own_dist->get_encryption() ? &pairing_cb.own_enc_key : NULL,
1153-
own_dist->get_identity() ? &pairing_cb.own_id_key : NULL,
1154-
own_dist->get_signing() ? &pairing_cb.own_sign_key : NULL,
1141+
&pairing_cb.own_enc_key,
1142+
&pairing_cb.own_id_key,
1143+
&pairing_cb.own_sign_key,
11551144
&pairing_cb.own_pk
11561145
},
11571146
/* keys_peer */ {
1158-
peer_dist->get_encryption() ? &pairing_cb.peer_enc_key : NULL,
1159-
peer_dist->get_identity() ? &pairing_cb.peer_id_key : NULL,
1160-
peer_dist->get_signing() ? &pairing_cb.peer_sign_key : NULL,
1147+
&pairing_cb.peer_enc_key,
1148+
&pairing_cb.peer_id_key,
1149+
&pairing_cb.peer_sign_key,
11611150
&pairing_cb.peer_pk
11621151
}
11631152
};

0 commit comments

Comments
 (0)