device: set authenticated and sc state on AES encryption change

This commit is contained in:
Lucas Abel
2023-11-21 23:49:16 -08:00
parent 2900b93bb3
commit 9bf2e03354

View File

@@ -3158,10 +3158,18 @@ class Device(CompositeEventEmitter):
connection.encryption = encryption
if (
not connection.authenticated
and connection.transport == BT_BR_EDR_TRANSPORT
and encryption == HCI_Encryption_Change_Event.AES_CCM
):
connection.authenticated = True
connection.sc = True
if (
not connection.authenticated
and connection.transport == BT_LE_TRANSPORT
and encryption == HCI_Encryption_Change_Event.E0_OR_AES_CCM
):
connection.authenticated = True
connection.sc = True
connection.emit('connection_encryption_change')
@host_event_handler