From c24eef3424d6fcbb7a09f73fada46439a1908053 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 14 Mar 2025 11:38:54 +0100 Subject: [PATCH] hci: on re-authentication, wait for encryption key refresh before emitting security level --- src/hci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index 6d2874707..e8751ca49 100644 --- a/src/hci.c +++ b/src/hci.c @@ -4293,11 +4293,11 @@ static void event_handler(uint8_t *packet, uint16_t size){ // authenticated conn->authentication_flags |= AUTH_FLAG_CONNECTION_AUTHENTICATED; - // If not already encrypted, start encryption + // If not already encrypted, start encryption, otherwise, wait for reencryption complete if ((conn->authentication_flags & AUTH_FLAG_CONNECTION_ENCRYPTED) == 0){ conn->bonding_flags |= BONDING_SEND_ENCRYPTION_REQUEST; - break; } + break; } // emit updated security level (will be 0 if not authenticated)