diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-06-11 03:22:14 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-06-11 03:22:14 +0000 |
commit | 130ec73e48a959f397856808fdd64d3b0084a3d2 (patch) | |
tree | d2482962f80c6924cba7353102b9b93027bc04e2 /hcid/security.c | |
parent | d4dc948acace9ab535c78b15d3fc04b11a0e3751 (diff) |
Retrieve link key type together with the key itself
Diffstat (limited to 'hcid/security.c')
-rw-r--r-- | hcid/security.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hcid/security.c b/hcid/security.c index b4520745..5a395055 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -278,17 +278,19 @@ static void link_key_request(int dev, bdaddr_t *sba, bdaddr_t *dba) { unsigned char key[16]; char sa[18], da[18]; + uint8_t type; int err; ba2str(sba, sa); ba2str(dba, da); info("link_key_request (sba=%s, dba=%s)", sa, da); - err = read_link_key(sba, dba, key); + err = read_link_key(sba, dba, key, &type); if (err < 0) { /* Link key not found */ hci_send_cmd(dev, OGF_LINK_CTL, OCF_LINK_KEY_NEG_REPLY, 6, dba); } else { /* Link key found */ + debug("Link key with type %d", type); link_key_reply_cp lr; memcpy(lr.link_key, key, 16); bacpy(&lr.bdaddr, dba); @@ -477,7 +479,7 @@ static void pin_code_request(int dev, bdaddr_t *sba, bdaddr_t *dba) pinlen = read_pin_code(sba, dba, pin); if (pairing == HCID_PAIRING_ONCE) { - err = read_link_key(sba, dba, key); + err = read_link_key(sba, dba, key, NULL); if (!err) { ba2str(dba, da); error("PIN code request for already paired device %s", da); |