mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-18 14:42:33 +00:00
hci: start encryption after authentication to increase security level
This commit is contained in:
parent
1cf0a6c88b
commit
131ef17ae4
@ -2766,9 +2766,8 @@ static void event_handler(uint8_t *packet, uint16_t size){
|
|||||||
// authenticated
|
// authenticated
|
||||||
conn->authentication_flags |= CONNECTION_AUTHENTICATED;
|
conn->authentication_flags |= CONNECTION_AUTHENTICATED;
|
||||||
|
|
||||||
// If link key sufficient for requested security and not already encrypted, start encryption
|
// If not already encrypted, start encryption
|
||||||
if (((gap_security_level_for_link_key_type(conn->link_key_type) >= conn->requested_security_level)) &&
|
if ((conn->authentication_flags & CONNECTION_ENCRYPTED) == 0){
|
||||||
((conn->authentication_flags & CONNECTION_ENCRYPTED) == 0)){
|
|
||||||
conn->bonding_flags |= BONDING_SEND_ENCRYPTION_REQUEST;
|
conn->bonding_flags |= BONDING_SEND_ENCRYPTION_REQUEST;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user