From 303db2fca1008b15f3411643ed64a7d612597328 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 10 Sep 2008 01:05:25 +0200 Subject: Use longer timeout value for authentication and encryption --- input/device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'input') diff --git a/input/device.c b/input/device.c index d0798318..2fffe7c3 100644 --- a/input/device.c +++ b/input/device.c @@ -477,6 +477,7 @@ static int encrypt_link(const char *src_addr, const char *dst_addr) char filename[PATH_MAX + 1]; struct hci_conn_info_req *cr; int dd, err, dev_id; + uint32_t handle; char *str; create_name(filename, PATH_MAX, STORAGEDIR, src_addr, "linkkeys"); @@ -516,13 +517,15 @@ static int encrypt_link(const char *src_addr, const char *dst_addr) goto done; } - if (hci_authenticate_link(dd, htobs(cr->conn_info->handle), 1000) < 0) { + handle = htobs(cr->conn_info->handle); + + if (hci_authenticate_link(dd, handle, 20000) < 0) { error("Link authentication failed: %s (%d)", strerror(errno), errno); goto fail; } - if (hci_encrypt_link(dd, htobs(cr->conn_info->handle), 1, 1000) < 0) { + if (hci_encrypt_link(dd, handle, 1, 5000) < 0) { error("Link encryption failed: %s (%d)", strerror(errno), errno); goto fail; -- cgit