Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5886d2e1 authored by Zach Johnson's avatar Zach Johnson Committed by Andre Eisenbach
Browse files

Remove link key request callback

The core security manager stores whether we have link keys
for each peer. This other call up to the bta device manager
to see if it has link keys is a dead end and does nothing.
parent 052b92e3
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ static void bta_dm_discover_next_device(void);
static void bta_dm_sdp_callback (UINT16 sdp_status);
static UINT8 bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, UINT8 *service_name, UINT8 service_id, BOOLEAN is_originator);
static UINT8 bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name);
static UINT8 bta_dm_link_key_request_cback (BD_ADDR bd_addr, LINK_KEY key);
static UINT8 bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, UINT8 key_type);
static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,BD_NAME bd_name, int result);
static void bta_dm_local_name_cback(BD_ADDR bd_addr);
@@ -197,7 +196,6 @@ const tBTM_APPL_INFO bta_security =
    &bta_dm_authorize_cback,
    &bta_dm_pin_cback,
    &bta_dm_new_link_key_cback,
    &bta_dm_link_key_request_cback,
    &bta_dm_authentication_complete_cback,
    NULL,
    &bta_dm_bond_cancel_complete_cback,
@@ -2719,34 +2717,6 @@ static UINT8 bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_
    return BTM_CMD_STARTED;
}



/*******************************************************************************
**
** Function         bta_dm_link_key_request_cback
**
** Description      Callback requesting linkkey
**
** Returns          void
**
*******************************************************************************/
static UINT8  bta_dm_link_key_request_cback (BD_ADDR bd_addr, LINK_KEY key)
{
    /* Application passes all link key to
    BTM during initialization using add_device
    API. If BTM doesn't have the link key in it's
    data base, that's because application doesn't
    it */
    UNUSED(bd_addr);
    UNUSED(key);

    return BTM_NOT_AUTHORIZED;
}





/*******************************************************************************
**
** Function         bta_dm_new_link_key_cback
+0 −14
Original line number Diff line number Diff line
@@ -4772,20 +4772,6 @@ void btm_sec_link_key_request (UINT8 *p_bda)
    /* Notify L2CAP to increase timeout */
    l2c_pin_code_request (p_bda);

    /* Only ask the host for a key if this guy is not already bonding */
    if ( (btm_cb.pairing_state == BTM_PAIR_STATE_IDLE)
         || (memcmp (p_bda, btm_cb.pairing_bda, BD_ADDR_LEN) != 0) )
    {
        if (btm_cb.api.p_link_key_req_callback)
        {
            if ((*btm_cb.api.p_link_key_req_callback)(p_bda, p_dev_rec->link_key) == BTM_SUCCESS)
            {
                btsnd_hcic_link_key_req_reply (p_bda, p_dev_rec->link_key);
                return;
            }
        }
    }

    /* The link key is not in the database and it is not known to the manager */
    btsnd_hcic_link_key_neg_reply (p_bda);
}
+0 −8
Original line number Diff line number Diff line
@@ -1335,13 +1335,6 @@ typedef UINT8 (tBTM_AUTHORIZE_CALLBACK) (BD_ADDR bd_addr, DEV_CLASS dev_class,
typedef UINT8 (tBTM_PIN_CALLBACK) (BD_ADDR bd_addr, DEV_CLASS dev_class,
                                   tBTM_BD_NAME bd_name);


/* Get Link Key for the connection.  Parameters are
**              BD Address of remote
**              Link Key
*/
typedef UINT8 (tBTM_LINK_KEY_REQ_CALLBACK) (BD_ADDR bd_addr, LINK_KEY key);

/* New Link Key for the connection.  Parameters are
**              BD Address of remote
**              Link Key
@@ -1737,7 +1730,6 @@ typedef struct
    tBTM_AUTHORIZE_CALLBACK     *p_authorize_callback;
    tBTM_PIN_CALLBACK           *p_pin_callback;
    tBTM_LINK_KEY_CALLBACK      *p_link_key_callback;
    tBTM_LINK_KEY_REQ_CALLBACK  *p_link_key_req_callback;
    tBTM_AUTH_COMPLETE_CALLBACK *p_auth_complete_callback;
    tBTM_ABORT_CALLBACK         *p_abort_callback;
    tBTM_BOND_CANCEL_CMPL_CALLBACK *p_bond_cancel_cmpl_callback;