Skip to content

Commit 68f2561

Browse files
no need to ask for encryption after pairing, fold deref under the null check
1 parent e706b41 commit 68f2561

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

features/FEATURE_BLE/source/generic/GenericSecurityManager.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -900,14 +900,10 @@ void GenericSecurityManager::on_pairing_timed_out(connection_handle_t connection
900900
void GenericSecurityManager::on_pairing_completed(connection_handle_t connection) {
901901
ControlBlock_t *cb = get_control_block(connection);
902902
if (cb) {
903-
if (cb->encryption_requested) {
904-
enable_encryption(connection);
905-
}
903+
// set the distribution flags in the db
904+
_db.set_distribution_flags(cb->db_entry, *cb);
906905
}
907906

908-
// set the distribution flags in the db
909-
_db.set_distribution_flags(cb->db_entry, *cb);
910-
911907
eventHandler->pairingResult(
912908
connection,
913909
SecurityManager::SEC_STATUS_SUCCESS

0 commit comments

Comments
 (0)