forked from pool/bluez
- update to 5.55:
* Fix issue with handling security level for HoG. * Fix issue with handling HIDSDPDisable attribute. * Fix issue with handling HID virtual cable unplug. * Fix issue with handling HID channel disconnect order. * Fix issue with handling AVDTP delay reporting states. * Fix issue with handling AVRCP notification events. * Fix issue with handling AVRCP list player attributes. * Fix issue with handling AVRCP category 1 player settings. * Fix issue with handling AVRCP media player passthrough bitmask. * Fix issue with handling HFP 1.7 default features. * Fix issue with handling GATT disconnecting handling. * Fix issue with handling GATT database hash. * Fix issue with handling service changed characteristic. * Fix issue with handling read of multiple characteristic values. * Fix issue with handling Just-Works auto-accept pairing. * Fix issue with handling authentication of bonded devices. * Fix issue with handling L2CAP streaming mode for AVDTP. * Fix issue with handling SysEx parser for MIDI support. * Fix issue with handling configured scan parameter values. * Fix issue with handling temporary devices removal. * Fix issue with handling advertising flags. - remove input-hog-Attempt-to-set-security-level-if-not-bonde.patch, input-Add-LEAutoSecurity-setting-to-input.conf.patch: upstream - use autopatch, spec-cleaner OBS-URL: https://build.opensuse.org/package/show/Base:System/bluez?expand=0&rev=296
This commit is contained in:
parent
4bd1ce113e
commit
b754a9895d
@ -12,11 +12,11 @@ Do not allow to read more then buffer size.
|
||||
tools/parser/hci.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/parser/hci.c b/tools/parser/hci.c
|
||||
index 8c7bd2581..adfd9ab1d 100644
|
||||
--- a/tools/parser/hci.c
|
||||
+++ b/tools/parser/hci.c
|
||||
@@ -988,8 +988,14 @@ static inline void pin_code_reply_dump(int level, struct frame *frm)
|
||||
Index: bluez-5.55/tools/parser/hci.c
|
||||
===================================================================
|
||||
--- bluez-5.55.orig/tools/parser/hci.c
|
||||
+++ bluez-5.55/tools/parser/hci.c
|
||||
@@ -989,8 +989,14 @@ static inline void pin_code_reply_dump(i
|
||||
memset(pin, 0, sizeof(pin));
|
||||
if (parser.flags & DUMP_NOVENDOR)
|
||||
memset(pin, '*', cp->pin_len);
|
||||
@ -32,6 +32,3 @@ index 8c7bd2581..adfd9ab1d 100644
|
||||
printf("bdaddr %s len %d pin \'%s\'\n", addr, cp->pin_len, pin);
|
||||
}
|
||||
|
||||
--
|
||||
2.16.2
|
||||
|
||||
|
@ -13,11 +13,11 @@ Do not allow to read more then the size.
|
||||
tools/parser/csr.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/tools/parser/csr.c b/tools/parser/csr.c
|
||||
index a0a4eb5fe..2d3db878a 100644
|
||||
--- a/tools/parser/csr.c
|
||||
+++ b/tools/parser/csr.c
|
||||
@@ -145,6 +145,11 @@ static inline void commands_dump(int level, char *str, struct frame *frm)
|
||||
Index: bluez-5.55/tools/parser/csr.c
|
||||
===================================================================
|
||||
--- bluez-5.55.orig/tools/parser/csr.c
|
||||
+++ bluez-5.55/tools/parser/csr.c
|
||||
@@ -146,6 +146,11 @@ static inline void commands_dump(int lev
|
||||
unsigned char commands[64];
|
||||
unsigned int i;
|
||||
|
||||
@ -29,6 +29,3 @@ index a0a4eb5fe..2d3db878a 100644
|
||||
memcpy(commands, frm->ptr, frm->len);
|
||||
|
||||
p_indent(level, frm);
|
||||
--
|
||||
2.16.3
|
||||
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] Move the 43xx firmware into /lib/firmware
|
||||
tools/hciattach_bcm43xx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
|
||||
index f3231ec..21450ac 100644
|
||||
--- a/tools/hciattach_bcm43xx.c
|
||||
+++ b/tools/hciattach_bcm43xx.c
|
||||
@@ -43,7 +43,7 @@
|
||||
Index: bluez-5.55/tools/hciattach_bcm43xx.c
|
||||
===================================================================
|
||||
--- bluez-5.55.orig/tools/hciattach_bcm43xx.c
|
||||
+++ bluez-5.55/tools/hciattach_bcm43xx.c
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "hciattach.h"
|
||||
|
||||
#ifndef FIRMWARE_DIR
|
||||
@ -20,6 +20,3 @@ index f3231ec..21450ac 100644
|
||||
#endif
|
||||
|
||||
#define FW_EXT ".hcd"
|
||||
--
|
||||
2.9.3
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:68cdab9e63e8832b130d5979dc8c96fdb087b31278f342874d992af3e56656dc
|
||||
size 2003760
|
3
bluez-5.55.tar.xz
Normal file
3
bluez-5.55.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8863717113c4897e2ad3271fc808ea245319e6fd95eed2e934fae8e0894e9b88
|
||||
size 2041428
|
@ -1,8 +1,8 @@
|
||||
Index: b/Makefile.in
|
||||
Index: bluez-5.55/Makefile.in
|
||||
===================================================================
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -3548,7 +3548,7 @@ unit_tests = $(am__append_54) unit/test-
|
||||
--- bluez-5.55.orig/Makefile.in
|
||||
+++ bluez-5.55/Makefile.in
|
||||
@@ -3545,7 +3545,7 @@ unit_tests = $(am__append_54) unit/test-
|
||||
@DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
|
||||
@DEPRECATED_TRUE@@READLINE_TRUE@ src/libshared-glib.la $(GLIB_LIBS) -lreadline
|
||||
|
||||
@ -11,11 +11,11 @@ Index: b/Makefile.in
|
||||
@CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \
|
||||
@CUPS_TRUE@ profiles/cups/cups.h \
|
||||
@CUPS_TRUE@ profiles/cups/sdp.c \
|
||||
Index: b/Makefile.tools
|
||||
Index: bluez-5.55/Makefile.tools
|
||||
===================================================================
|
||||
--- a/Makefile.tools
|
||||
+++ b/Makefile.tools
|
||||
@@ -463,7 +463,7 @@ endif
|
||||
--- bluez-5.55.orig/Makefile.tools
|
||||
+++ bluez-5.55/Makefile.tools
|
||||
@@ -462,7 +462,7 @@ endif
|
||||
endif
|
||||
|
||||
if CUPS
|
||||
|
@ -1,3 +1,32 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 10 06:20:53 UTC 2020 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- update to 5.55:
|
||||
* Fix issue with handling security level for HoG.
|
||||
* Fix issue with handling HIDSDPDisable attribute.
|
||||
* Fix issue with handling HID virtual cable unplug.
|
||||
* Fix issue with handling HID channel disconnect order.
|
||||
* Fix issue with handling AVDTP delay reporting states.
|
||||
* Fix issue with handling AVRCP notification events.
|
||||
* Fix issue with handling AVRCP list player attributes.
|
||||
* Fix issue with handling AVRCP category 1 player settings.
|
||||
* Fix issue with handling AVRCP media player passthrough bitmask.
|
||||
* Fix issue with handling HFP 1.7 default features.
|
||||
* Fix issue with handling GATT disconnecting handling.
|
||||
* Fix issue with handling GATT database hash.
|
||||
* Fix issue with handling service changed characteristic.
|
||||
* Fix issue with handling read of multiple characteristic values.
|
||||
* Fix issue with handling Just-Works auto-accept pairing.
|
||||
* Fix issue with handling authentication of bonded devices.
|
||||
* Fix issue with handling L2CAP streaming mode for AVDTP.
|
||||
* Fix issue with handling SysEx parser for MIDI support.
|
||||
* Fix issue with handling configured scan parameter values.
|
||||
* Fix issue with handling temporary devices removal.
|
||||
* Fix issue with handling advertising flags.
|
||||
- remove input-hog-Attempt-to-set-security-level-if-not-bonde.patch,
|
||||
input-Add-LEAutoSecurity-setting-to-input.conf.patch: upstream
|
||||
- use autopatch, spec-cleaner
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 15 15:37:48 UTC 2020 - Jan Engelhardt <jengelh@inai.de>
|
||||
|
||||
|
94
bluez.spec
94
bluez.spec
@ -22,27 +22,25 @@
|
||||
%else
|
||||
%bcond_with mesh
|
||||
%endif
|
||||
|
||||
%bcond_without bluez_deprecated
|
||||
|
||||
# maintained at https://github.com/seifes-opensuse-packages/bluez.git
|
||||
# contributions via pull requests are welcome!
|
||||
#
|
||||
Name: bluez
|
||||
Version: 5.54
|
||||
Version: 5.55
|
||||
Release: 0
|
||||
Summary: Bluetooth Stack for Linux
|
||||
License: GPL-2.0-or-later
|
||||
Group: Hardware/Mobile
|
||||
URL: http://www.bluez.org
|
||||
Source: http://www.kernel.org/pub/linux/bluetooth/bluez-%{version}.tar.xz
|
||||
# unused in the package, but allows to use "extract *.*" in source service
|
||||
Source42: README.md
|
||||
NoSource: 42
|
||||
# we still want debuginfo
|
||||
#KEEP NOSOURCE DEBUGINFO
|
||||
Source5: baselibs.conf
|
||||
Source7: bluetooth.modprobe
|
||||
# unused in the package, but allows to use "extract *.*" in source service
|
||||
Source42: README.md
|
||||
NoSource: 42
|
||||
# fix some logitech HID devices, bnc#681049, bnc#850478 --seife+obs@b1-systems.com
|
||||
Patch1: bluez-5.11-logitech-hid2hci.patch
|
||||
Patch2: bluez-sdp-unix-path.patch
|
||||
@ -57,10 +55,6 @@ Patch10: RPi-Move-the-43xx-firmware-into-lib-firmware.patch
|
||||
# fix some memory leak with malformed packet (reported upstream but not yet fixed)
|
||||
Patch101: CVE-2016-9800-tool-hcidump-Fix-memory-leak-with-malformed-packet.patch
|
||||
Patch102: CVE-2016-9804-tool-hcidump-Fix-memory-leak-with-malformed-packet.patch
|
||||
# PATCH-FIX-UPSTREAM: bsc#1166751 CVE-2020-0556
|
||||
Patch105: input-hog-Attempt-to-set-security-level-if-not-bonde.patch
|
||||
Patch106: input-Add-LEAutoSecurity-setting-to-input.conf.patch
|
||||
|
||||
BuildRequires: automake
|
||||
BuildRequires: flex
|
||||
BuildRequires: libtool
|
||||
@ -70,22 +64,15 @@ BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: pkgconfig(alsa)
|
||||
BuildRequires: pkgconfig(check)
|
||||
BuildRequires: pkgconfig(dbus-1) >= 1.6
|
||||
%if 0%{?suse_version} >= 1550
|
||||
BuildRequires: pkgconfig(ell) >= 0.28
|
||||
%endif
|
||||
BuildRequires: pkgconfig(glib-2.0) >= 2.28
|
||||
# libgio-2_0-0 has a runtime dependency on shared-mime-info, which is not
|
||||
# required for building here, but causes a build loop
|
||||
#!BuildIgnore: shared-mime-info
|
||||
%if %{with mesh}
|
||||
# json-c is needed for --enable-mesh
|
||||
BuildRequires: pkgconfig(json-c)
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libcap-ng)
|
||||
BuildRequires: pkgconfig(libical)
|
||||
BuildRequires: pkgconfig(libudev)
|
||||
BuildRequires: pkgconfig(sndfile)
|
||||
BuildRequires: pkgconfig(udev)
|
||||
# libgio-2_0-0 has a runtime dependency on shared-mime-info, which is not
|
||||
# required for building here, but causes a build loop
|
||||
#!BuildIgnore: shared-mime-info
|
||||
Requires(post): systemd
|
||||
Recommends: sbc
|
||||
Provides: bluez-utils = 3.36
|
||||
@ -96,8 +83,14 @@ Obsoletes: bluez-hcidump < 5.0
|
||||
Provides: bluez-hcidump = %{version}
|
||||
Obsoletes: obexd-client < 5.0
|
||||
Provides: obexd-client = %{version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%{?systemd_requires}
|
||||
%if 0%{?suse_version} >= 1550
|
||||
BuildRequires: pkgconfig(ell) >= 0.28
|
||||
%endif
|
||||
%if %{with mesh}
|
||||
# json-c is needed for --enable-mesh
|
||||
BuildRequires: pkgconfig(json-c)
|
||||
%endif
|
||||
|
||||
%description
|
||||
BlueZ provides support for the core Bluetooth layers and protocols.
|
||||
@ -184,15 +177,7 @@ to use the modern tools instead.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch10 -p1
|
||||
%patch101 -p1
|
||||
%patch102 -p1
|
||||
%patch105 -p1
|
||||
%patch106 -p1
|
||||
%autopatch -p1
|
||||
mkdir dbus-apis
|
||||
cp -a doc/*.txt dbus-apis/
|
||||
# FIXME: Change the dbus service to be a real service, not systemd launched
|
||||
@ -213,6 +198,7 @@ autoreconf -fi
|
||||
--enable-library \
|
||||
--enable-tools \
|
||||
--enable-cups \
|
||||
--enable-hid2hci \
|
||||
%if %{with mesh}
|
||||
--enable-mesh \
|
||||
%endif
|
||||
@ -230,7 +216,7 @@ autoreconf -fi
|
||||
--with-systemdsystemunitdir=%{_unitdir} \
|
||||
--with-systemduserunitdir=%{_userunitdir}
|
||||
|
||||
make %{?_smp_mflags} all
|
||||
%make_build all
|
||||
|
||||
%install
|
||||
%make_install
|
||||
@ -256,7 +242,7 @@ install -m0755 tools/btgatt-client %{buildroot}%{_bindir}
|
||||
# btmgmt can be useful
|
||||
install -m0755 tools/btmgmt %{buildroot}%{_bindir}
|
||||
# avinfo can be useful for debugging
|
||||
install -m0755 tools/avinfo $RPM_BUILD_ROOT%{_bindir}
|
||||
install -m0755 tools/avinfo %{buildroot}%{_bindir}
|
||||
|
||||
# for auto-enable subpackage
|
||||
find . -name main.conf
|
||||
@ -288,8 +274,8 @@ touch -r %{SOURCE0} %{buildroot}%{_defaultdocdir}/%{name}/README-mesh.SUSE
|
||||
%endif
|
||||
|
||||
%if %{with bluez_deprecated}
|
||||
mkdir -p %{buildroot}/var/adm/update-messages
|
||||
UM=%{buildroot}/var/adm/update-messages/bluez-deprecated-%version-%release-1
|
||||
mkdir -p %{buildroot}%{_localstatedir}/adm/update-messages
|
||||
UM=%{buildroot}%{_localstatedir}/adm/update-messages/bluez-deprecated-%{version}-%{release}-1
|
||||
cat >> $UM << EOF
|
||||
WARNING:
|
||||
The bluez-deprecated package contains tools that are considered obsolete by
|
||||
@ -308,7 +294,7 @@ touch -r %{SOURCE0} $UM
|
||||
%if ! 0%{?qemu_user_space_build}
|
||||
##make %%{?_smp_mflags} check
|
||||
# deliberately not running parallel, as the test suite has spurious failures otherwise
|
||||
make check V=0
|
||||
%make_build check V=0
|
||||
%endif
|
||||
|
||||
%pre
|
||||
@ -320,8 +306,8 @@ make check V=0
|
||||
%{fillup_only -n bluetooth}
|
||||
# We need the bluez systemd service enabled at any time. It won't start up
|
||||
# on its own, as it is triggered by udev in the end (bnc#796671)
|
||||
/usr/bin/systemctl enable bluetooth.service 2>&1 || :
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
%{_bindir}/systemctl enable bluetooth.service 2>&1 || :
|
||||
%{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
|
||||
%preun
|
||||
%service_del_preun bluetooth.service bluetooth-mesh.service
|
||||
@ -333,7 +319,6 @@ make check V=0
|
||||
%postun -n libbluetooth3 -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%doc AUTHORS ChangeLog README dbus-apis src/main.conf
|
||||
%if %{with mesh}
|
||||
%doc %{_defaultdocdir}/%{name}/*
|
||||
@ -361,12 +346,12 @@ make check V=0
|
||||
%endif
|
||||
%{_bindir}/bccmd
|
||||
%{_prefix}/lib/udev/
|
||||
%{_mandir}/man1/btattach.1%{ext_man}
|
||||
%{_mandir}/man8/bluetoothd.8%{ext_man}
|
||||
%{_mandir}/man1/hid2hci.1%{ext_man}
|
||||
%{_mandir}/man1/bccmd.1%{ext_man}
|
||||
%{_mandir}/man1/l2ping.1%{ext_man}
|
||||
%{_mandir}/man1/rctest.1%{ext_man}
|
||||
%{_mandir}/man1/btattach.1%{?ext_man}
|
||||
%{_mandir}/man8/bluetoothd.8%{?ext_man}
|
||||
%{_mandir}/man1/bccmd.1%{?ext_man}
|
||||
%{_mandir}/man1/hid2hci.1%{?ext_man}
|
||||
%{_mandir}/man1/l2ping.1%{?ext_man}
|
||||
%{_mandir}/man1/rctest.1%{?ext_man}
|
||||
%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
|
||||
# not packaged, boo#1151518
|
||||
###%%config %%{_sysconfdir}/dbus-1/system.d/bluetooth-mesh.conf
|
||||
@ -393,36 +378,32 @@ make check V=0
|
||||
%{_bindir}/hciattach
|
||||
%{_bindir}/hciconfig
|
||||
%{_bindir}/hcidump
|
||||
%{_mandir}/man1/hcidump.1%{ext_man}
|
||||
%{_mandir}/man1/hciattach.1%{ext_man}
|
||||
%{_mandir}/man1/hciconfig.1%{ext_man}
|
||||
%{_mandir}/man1/hcitool.1%{ext_man}
|
||||
%{_mandir}/man1/sdptool.1%{ext_man}
|
||||
%{_mandir}/man1/ciptool.1%{ext_man}
|
||||
%{_mandir}/man1/rfcomm.1%{ext_man}
|
||||
/var/adm/update-messages/bluez-deprecated-%version-%release-1
|
||||
%{_mandir}/man1/hcidump.1%{?ext_man}
|
||||
%{_mandir}/man1/hciattach.1%{?ext_man}
|
||||
%{_mandir}/man1/hciconfig.1%{?ext_man}
|
||||
%{_mandir}/man1/hcitool.1%{?ext_man}
|
||||
%{_mandir}/man1/sdptool.1%{?ext_man}
|
||||
%{_mandir}/man1/ciptool.1%{?ext_man}
|
||||
%{_mandir}/man1/rfcomm.1%{?ext_man}
|
||||
%{_localstatedir}/adm/update-messages/bluez-deprecated-%{version}-%{release}-1
|
||||
%endif
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
%{_includedir}/bluetooth
|
||||
%{_libdir}/libbluetooth.so
|
||||
%{_libdir}/pkgconfig/bluez.pc
|
||||
|
||||
%files -n libbluetooth3
|
||||
%defattr(-, root, root)
|
||||
%{_libdir}/libbluetooth.so.*
|
||||
%doc AUTHORS ChangeLog README
|
||||
%license COPYING
|
||||
|
||||
%files cups
|
||||
%defattr(-,root,root)
|
||||
%dir %{_libexecdir}/cups
|
||||
%dir %{_libexecdir}/cups/backend
|
||||
%{_libexecdir}/cups/backend/bluetooth
|
||||
|
||||
%files test
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/avinfo
|
||||
#{_bindir}/hciemu
|
||||
%{_bindir}/l2test
|
||||
@ -433,7 +414,6 @@ make check V=0
|
||||
%{_libdir}/bluez/test
|
||||
|
||||
%files auto-enable-devices
|
||||
%defattr(-,root,root)
|
||||
%dir %{_sysconfdir}/bluetooth
|
||||
%config(noreplace) %{_sysconfdir}/bluetooth/main.conf
|
||||
|
||||
|
@ -1,121 +0,0 @@
|
||||
From f2778f5877d20696d68a452b26e4accb91bfb19e Mon Sep 17 00:00:00 2001
|
||||
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
||||
Date: Wed, 11 Mar 2020 11:43:21 -0700
|
||||
Subject: [PATCH] input: Add LEAutoSecurity setting to input.conf
|
||||
|
||||
LEAutoSecurity can be used to enable/disable automatic upgrades of
|
||||
security for LE devices, by default it is enabled so existing devices
|
||||
that did not require security and were not bonded will automatically
|
||||
upgrade the security.
|
||||
|
||||
Note: Platforms disabling this setting would require users to manually
|
||||
bond the device which may require changes to the user interface to
|
||||
always force bonding for input devices as APIs such as Device.Connect
|
||||
will no longer work which maybe perceived as a regression.
|
||||
---
|
||||
profiles/input/device.h | 1 +
|
||||
profiles/input/hog.c | 13 +++++++++++--
|
||||
profiles/input/input.conf | 5 +++++
|
||||
profiles/input/manager.c | 11 ++++++++++-
|
||||
4 files changed, 27 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/profiles/input/device.h b/profiles/input/device.h
|
||||
index 3044db673..5a077f92a 100644
|
||||
--- a/profiles/input/device.h
|
||||
+++ b/profiles/input/device.h
|
||||
@@ -30,6 +30,7 @@ struct input_conn;
|
||||
void input_set_idle_timeout(int timeout);
|
||||
void input_enable_userspace_hid(bool state);
|
||||
void input_set_classic_bonded_only(bool state);
|
||||
+void input_set_auto_sec(bool state);
|
||||
|
||||
int input_device_register(struct btd_service *service);
|
||||
void input_device_unregister(struct btd_service *service);
|
||||
diff --git a/profiles/input/hog.c b/profiles/input/hog.c
|
||||
index f0226ebbd..327a1d1c3 100644
|
||||
--- a/profiles/input/hog.c
|
||||
+++ b/profiles/input/hog.c
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "src/shared/gatt-client.h"
|
||||
#include "src/plugin.h"
|
||||
|
||||
+#include "device.h"
|
||||
#include "suspend.h"
|
||||
#include "attrib/att.h"
|
||||
#include "attrib/gattrib.h"
|
||||
@@ -67,8 +68,14 @@ struct hog_device {
|
||||
};
|
||||
|
||||
static gboolean suspend_supported = FALSE;
|
||||
+static bool auto_sec = true;
|
||||
static struct queue *devices = NULL;
|
||||
|
||||
+void input_set_auto_sec(bool state)
|
||||
+{
|
||||
+ auto_sec = state;
|
||||
+}
|
||||
+
|
||||
static void hog_device_accept(struct hog_device *dev, struct gatt_db *db)
|
||||
{
|
||||
char name[248];
|
||||
@@ -192,11 +199,13 @@ static int hog_accept(struct btd_service *service)
|
||||
if (!device_is_bonded(device, btd_device_get_bdaddr_type(device))) {
|
||||
struct bt_gatt_client *client;
|
||||
|
||||
+ if (!auto_sec)
|
||||
+ return -ECONNREFUSED;
|
||||
+
|
||||
client = btd_device_get_gatt_client(device);
|
||||
if (!bt_gatt_client_set_security(client,
|
||||
- BT_ATT_SECURITY_MEDIUM)) {
|
||||
+ BT_ATT_SECURITY_MEDIUM))
|
||||
return -ECONNREFUSED;
|
||||
- }
|
||||
}
|
||||
|
||||
/* TODO: Replace GAttrib with bt_gatt_client */
|
||||
diff --git a/profiles/input/input.conf b/profiles/input/input.conf
|
||||
index 166aff4a4..4c70bc561 100644
|
||||
--- a/profiles/input/input.conf
|
||||
+++ b/profiles/input/input.conf
|
||||
@@ -19,3 +19,8 @@
|
||||
# pairing/encryption.
|
||||
# Defaults to false to maximize device compatibility.
|
||||
#ClassicBondedOnly=true
|
||||
+
|
||||
+# LE upgrade security
|
||||
+# Enables upgrades of security automatically if required.
|
||||
+# Defaults to true to maximize device compatibility.
|
||||
+#LEAutoSecurity=true
|
||||
diff --git a/profiles/input/manager.c b/profiles/input/manager.c
|
||||
index 5cd27b839..bf4acb4ed 100644
|
||||
--- a/profiles/input/manager.c
|
||||
+++ b/profiles/input/manager.c
|
||||
@@ -96,7 +96,7 @@ static int input_init(void)
|
||||
config = load_config_file(CONFIGDIR "/input.conf");
|
||||
if (config) {
|
||||
int idle_timeout;
|
||||
- gboolean uhid_enabled, classic_bonded_only;
|
||||
+ gboolean uhid_enabled, classic_bonded_only, auto_sec;
|
||||
|
||||
idle_timeout = g_key_file_get_integer(config, "General",
|
||||
"IdleTimeout", &err);
|
||||
@@ -125,6 +125,15 @@ static int input_init(void)
|
||||
} else
|
||||
g_clear_error(&err);
|
||||
|
||||
+ auto_sec = g_key_file_get_boolean(config, "General",
|
||||
+ "LEAutoSecurity", &err);
|
||||
+ if (!err) {
|
||||
+ DBG("input.conf: LEAutoSecurity=%s",
|
||||
+ auto_sec ? "true" : "false");
|
||||
+ input_set_auto_sec(auto_sec);
|
||||
+ } else
|
||||
+ g_clear_error(&err);
|
||||
+
|
||||
}
|
||||
|
||||
btd_profile_register(&input_profile);
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 35d8d895cd0b724e58129374beb0bb4a2edf9519 Mon Sep 17 00:00:00 2001
|
||||
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
||||
Date: Tue, 10 Mar 2020 09:59:07 -0700
|
||||
Subject: [PATCH] input: hog: Attempt to set security level if not bonded
|
||||
|
||||
This attempts to set the security if the device is not bonded, the
|
||||
kernel will block any communication on the ATT socket while bumping
|
||||
the security and if that fails the device will be disconnected which
|
||||
is better than having the device dangling around without being able to
|
||||
communicate with it until it is properly bonded.
|
||||
---
|
||||
profiles/input/hog.c | 13 +++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/profiles/input/hog.c b/profiles/input/hog.c
|
||||
index dfac68921..f0226ebbd 100644
|
||||
--- a/profiles/input/hog.c
|
||||
+++ b/profiles/input/hog.c
|
||||
@@ -49,6 +49,8 @@
|
||||
#include "src/shared/util.h"
|
||||
#include "src/shared/uhid.h"
|
||||
#include "src/shared/queue.h"
|
||||
+#include "src/shared/att.h"
|
||||
+#include "src/shared/gatt-client.h"
|
||||
#include "src/plugin.h"
|
||||
|
||||
#include "suspend.h"
|
||||
@@ -187,8 +189,15 @@ static int hog_accept(struct btd_service *service)
|
||||
}
|
||||
|
||||
/* HOGP 1.0 Section 6.1 requires bonding */
|
||||
- if (!device_is_bonded(device, btd_device_get_bdaddr_type(device)))
|
||||
- return -ECONNREFUSED;
|
||||
+ if (!device_is_bonded(device, btd_device_get_bdaddr_type(device))) {
|
||||
+ struct bt_gatt_client *client;
|
||||
+
|
||||
+ client = btd_device_get_gatt_client(device);
|
||||
+ if (!bt_gatt_client_set_security(client,
|
||||
+ BT_ATT_SECURITY_MEDIUM)) {
|
||||
+ return -ECONNREFUSED;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* TODO: Replace GAttrib with bt_gatt_client */
|
||||
bt_hog_attach(dev->hog, attrib);
|
||||
--
|
||||
2.25.1
|
||||
|
Loading…
Reference in New Issue
Block a user