mirror of
https://github.com/google/bumble.git
synced 2026-05-06 03:38:01 +00:00
reverted: 662704e "classic: complete authentication when being the .authenticate acceptor"
This commit is contained in:
@@ -448,7 +448,6 @@ class Connection(CompositeEventEmitter):
|
||||
self.authenticated = False
|
||||
self.sc = False
|
||||
self.link_key_type = None
|
||||
self.authenticating = False
|
||||
self.phy = phy
|
||||
self.att_mtu = ATT_DEFAULT_MTU
|
||||
self.data_length = DEVICE_DEFAULT_DATA_LENGTH
|
||||
@@ -1992,13 +1991,9 @@ class Device(CompositeEventEmitter):
|
||||
)
|
||||
raise HCI_StatusError(result)
|
||||
|
||||
# Save in connection we are trying to authenticate
|
||||
connection.authenticating = True
|
||||
|
||||
# Wait for the authentication to complete
|
||||
await connection.abort_on('disconnection', pending_authentication)
|
||||
finally:
|
||||
connection.authenticating = False
|
||||
connection.remove_listener('connection_authentication', on_authentication)
|
||||
connection.remove_listener(
|
||||
'connection_authentication_failure', on_authentication_failure
|
||||
@@ -2394,19 +2389,6 @@ class Device(CompositeEventEmitter):
|
||||
)
|
||||
connection.emit('connection_authentication_failure', error)
|
||||
|
||||
@host_event_handler
|
||||
@with_connection_from_address
|
||||
def on_ssp_complete(self, connection):
|
||||
# On Secure Simple Pairing complete, in case:
|
||||
# - Connection isn't already authenticated
|
||||
# - AND we are not the initiator of the authentication
|
||||
# We must trigger authentication to known if we are truly authenticated
|
||||
if not connection.authenticating and not connection.authenticated:
|
||||
logger.debug(
|
||||
f'*** Trigger Connection Authentication: [0x{connection.handle:04X}] {connection.peer_address}'
|
||||
)
|
||||
asyncio.create_task(connection.authenticate())
|
||||
|
||||
# [Classic only]
|
||||
@host_event_handler
|
||||
@with_connection_from_address
|
||||
|
||||
Reference in New Issue
Block a user