summaryrefslogtreecommitdiffstats
path: root/input/server.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-26 09:53:30 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-26 09:53:30 +0000
commit5753e415a5ef3308f1408ad07623ae07047faaf5 (patch)
tree68a35ac9cfc9a37dadc07fd5afb0b4fd5ddfefba /input/server.c
parent7671d152752e7daff9e27025d5d5365bb894fe07 (diff)
Add encryption support
Diffstat (limited to 'input/server.c')
-rw-r--r--input/server.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/input/server.c b/input/server.c
index 9e97490f..b140bb6b 100644
--- a/input/server.c
+++ b/input/server.c
@@ -34,6 +34,8 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/l2cap.h>
#include <bluetooth/hidp.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
#include <glib.h>
@@ -98,6 +100,14 @@ static void create_device(struct session_data *session)
goto cleanup;
}
+ if (req.subclass & 0x40) {
+ if (encrypt_link(&session->src, &session->dst) < 0) {
+ if (req.rd_data)
+ free(req.rd_data);
+ goto cleanup;
+ }
+ }
+
info("New input device %s (%s)", addr, req.name);
err = ioctl(ctl, HIDPCONNADD, &req);