don't send encryption command if authentication failed

This commit is contained in:
matthias.ringwald@gmail.com 2014-01-17 16:32:54 +00:00
parent df3354fc67
commit b5cb6874c1
2 changed files with 1 additions and 2 deletions

View File

@ -711,7 +711,7 @@ static void event_handler(uint8_t *packet, int size){
handle = READ_BT_16(packet, 3);
conn = hci_connection_for_handle(handle);
if (!conn) break;
if (gap_security_level_for_link_key_type(conn->link_key_type) >= conn->requested_security_level){
if (packet[2] == 0 && gap_security_level_for_link_key_type(conn->link_key_type) >= conn->requested_security_level){
// link key sufficient for requested security
conn->bonding_flags |= BONDING_SEND_ENCRYPTION_REQUEST;
} else {

View File

@ -287,7 +287,6 @@ static void l2cap_start_ertx(l2cap_channel_t * channel){
}
static int l2cap_security_level_0_allowed_for_PSM(uint16_t psm){
// return 0; // TESTING!
return psm != PSM_SDP;
}