hci: handle encryption change with error -> trigger emit security level_0 (classic only)

This commit is contained in:
Matthias Ringwald 2023-08-20 15:53:56 +02:00
parent 617c03d6ea
commit 8eae094c26

View File

@ -3949,14 +3949,18 @@ static void event_handler(uint8_t *packet, uint16_t size){
conn->authentication_flags &= ~AUTH_FLAG_CONNECTION_ENCRYPTED;
}
} else {
uint8_t status = hci_event_encryption_change_get_status(packet);
if ((conn->bonding_flags & BONDING_DEDICATED) != 0){
conn->bonding_flags &= ~BONDING_DEDICATED;
conn->bonding_flags |= BONDING_DISCONNECT_DEDICATED_DONE;
conn->bonding_status = status;
#ifdef ENABLE_CLASSIC
if (!hci_is_le_connection(conn)){
uint8_t status = hci_event_encryption_change_get_status(packet);
if ((conn->bonding_flags & BONDING_DEDICATED) != 0){
conn->bonding_flags &= ~BONDING_DEDICATED;
conn->bonding_flags |= BONDING_DISCONNECT_DEDICATED_DONE;
conn->bonding_status = status;
}
// trigger security update -> level 0
hci_handle_mutual_authentication_completed(conn);
}
// trigger security update -> level 0
hci_handle_mutual_authentication_completed(conn);
#endif
}
break;