hci.c (ca8a5d3cc159fc5f4d20e1d02ddf88244c11863a) hci.c (af411b3ff8e06dca547124b751362f141c390f98)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 4003 unchanged lines hidden (view full) ---

4012 }
4013
4014 // cache link key. link keys stored in little-endian format for legacy reasons
4015 memcpy(&conn->link_key, &packet[8], 16);
4016
4017 // only store link key:
4018 // - if bondable enabled
4019 if (hci_stack->bondable == false) break;
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 4003 unchanged lines hidden (view full) ---

4012 }
4013
4014 // cache link key. link keys stored in little-endian format for legacy reasons
4015 memcpy(&conn->link_key, &packet[8], 16);
4016
4017 // only store link key:
4018 // - if bondable enabled
4019 if (hci_stack->bondable == false) break;
4020 // - if at least one side requests bonding during the IO Capabilities exchange.
4021 // Note: we drop bonding flag in acceptor role if remote doesn't request it
4022 bool bonding_local = conn->io_cap_request_auth_req >= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING;
4023 bool bonding_remote = conn->io_cap_response_auth_req >= SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_DEDICATED_BONDING;
4024 if ((bonding_local == false) && (bonding_remote == false)) break;
4020 // - if security level sufficient
4021 if (gap_security_level_for_link_key_type(link_key_type) < conn->requested_security_level) break;
4022 gap_store_link_key_for_bd_addr(addr, &packet[8], conn->link_key_type);
4023 break;
4024 }
4025
4026 case HCI_EVENT_PIN_CODE_REQUEST:
4027 hci_event_pin_code_request_get_bd_addr(packet, addr);

--- 6887 unchanged lines hidden ---
4025 // - if security level sufficient
4026 if (gap_security_level_for_link_key_type(link_key_type) < conn->requested_security_level) break;
4027 gap_store_link_key_for_bd_addr(addr, &packet[8], conn->link_key_type);
4028 break;
4029 }
4030
4031 case HCI_EVENT_PIN_CODE_REQUEST:
4032 hci_event_pin_code_request_get_bd_addr(packet, addr);

--- 6887 unchanged lines hidden ---