summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-09 16:33:58 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-06-09 16:33:58 +0000
commit8ed3c68b9286a06881280e0c41bfe8e79fed369f (patch)
tree4e3be96f38e9aa83c70886fe7fcfd3738a8a5691 /hcid
parent6be25e8bc36656d6fd8ba61c8552f9596043eca6 (diff)
Use kernel auth requirement if available
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-hci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 01a37455..93a9db63 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -2469,7 +2469,7 @@ void hcid_dbus_pin_code_reply(bdaddr_t *local, void *ptr)
}
}
-static uint8_t get_auth_type(bdaddr_t *local, bdaddr_t *remote)
+static uint8_t get_auth_requirement(bdaddr_t *local, bdaddr_t *remote)
{
struct hci_auth_info_req req;
char addr[18];
@@ -2513,7 +2513,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t *cap,
return -1;
}
- type = get_auth_type(local, remote);
+ type = get_auth_requirement(local, remote);
debug("kernel authentication requirement = 0x%02x", type);
@@ -2525,9 +2525,12 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t *cap,
*auth = 0x03;
} else {
agent = adapter->agent;
- *auth = 0x01;
+ *auth = 0x00;
}
+ if (type != 0xff && type & 0x01)
+ *auth |= 0x01;
+
if (!agent) {
error("No agent available for IO capability");
return -1;