Skip to content
Snippets Groups Projects
Commit 346174d2 authored by Chris Manton's avatar Chris Manton
Browse files

Log when setting illegal address type in security record

Bug: 231373910
Tag: #refactor
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I84b650ea59284166b4d82f761abb3fec9fbda261
parent 5922eec9
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ typedef struct {
uint32_t local_counter; /* local sign counter for sending signed write cmd*/
} tBTM_SEC_BLE_KEYS;
typedef struct {
struct tBTM_SEC_BLE {
RawAddress pseudo_addr; /* LE pseudo address of the device if different from
device address */
private:
......@@ -101,7 +101,12 @@ typedef struct {
public:
tBLE_ADDR_TYPE AddressType() const { return ble_addr_type_; }
void SetAddressType(tBLE_ADDR_TYPE ble_addr_type) {
if (is_ble_addr_type_known(ble_addr_type)) ble_addr_type_ = ble_addr_type;
if (is_ble_addr_type_known(ble_addr_type)) {
ble_addr_type_ = ble_addr_type;
} else {
LOG(ERROR) << "Please don't store illegal addresses into security record:"
<< AddressTypeText(ble_addr_type);
}
}
tBLE_BD_ADDR identity_address_with_type;
......@@ -121,7 +126,8 @@ typedef struct {
tBTM_LE_KEY_TYPE key_type; /* bit mask of valid key types in record */
tBTM_SEC_BLE_KEYS keys; /* LE device security info in peripheral rode */
} tBTM_SEC_BLE;
};
typedef struct tBTM_SEC_BLE tBTM_SEC_BLE;
enum : uint16_t {
BTM_SEC_AUTHENTICATED = 0x0002,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment