summaryrefslogtreecommitdiff
path: root/plugins/autopair.c
Commit message (Collapse)AuthorAgeFilesLines
* build: Fix errors with glibc < 2.25Fabrice Fontaine2022-02-151-2/+2
| | | | | | | | | | | | | | | | | | getrandom and sys/random.h are only available since glibc 2.25: https://www.gnu.org/software/gnulib/manual/html_node/sys_002frandom_002eh.html resulting in the following build failures since version 5.63 and https://git.kernel.org/pub/scm/bluetooth/bluez.git/log/?qt=grep&q=getrandom: plugins/autopair.c:20:24: fatal error: sys/random.h: No such file or directory #include <sys/random.h> ^ To fix this build failure, add util_getrandom and a fallback (borrowed from pipewire and licensed under MIT): https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/pipewire/utils.c Fixes: - http://autobuild.buildroot.org/results/6b8870d12e0804d6154230a7322c49416c1dc0e2
* plugins: Replace random number generation functionTedd Ho-Jeong An2021-12-081-1/+7
| | | | | | | | This patch replaces the rand() function to the getrandom() syscall. It was reported by the Coverity scan rand() should not be used for security-related applications, because linear congruential algorithms are too easy to break
* plugins: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- GPL-2.0-or-later : 7 License: GPL-2.0-or-later plugins/autopair.c plugins/hostname.c plugins/neard.c plugins/policy.c plugins/sixaxis.c plugins/wiimote.c plugins/external-dummy.c
* autopair: Fix compiler warningSonny Sasaka2020-03-261-1/+1
| | | | | | With clang, comparing an array with NULL generates a warning because the value is always non-NULL. With maintainer mode enabled, this becomes a compilation error.
* autopair: Add pin codes to try for gaming input devicesBastien Nocera2019-03-261-0/+12
| | | | As well as remote controls.
* autopair: Add more common PIN codes for audio devicesBastien Nocera2019-03-261-4/+14
| | | | | | PIN codes "1111", and "1234" are fairly common PIN codes used for audio devices such as speakers and headsets. This replaces similar quirks already present in gnome-bluetooth's PIN database.
* autopair: Don't handle the iCadeBastien Nocera2017-10-171-1/+11
| | | | | | | | | We can't easily enter digits other than 1 through 4 (inclusive) so leave it up to the agent to figure out a good passcode for the iCade. Note that we can not use the VID/PID of the device, as it is not yet known at that point.
* autopair: Use unsigned int for passcode stringMarcel Holtmann2017-07-131-2/+2
|
* autopair: Fix PIN string buffer sizeMarcel Holtmann2017-07-111-1/+1
|
* plugins: Fix local libbluetooth includes orderMarcel Holtmann2015-02-281-0/+1
|
* plugins: Use local libbluetooth includesMarcel Holtmann2015-02-281-1/+2
|
* plugins/autopair: Provide descriptive error logGowtham Anandha Babu2014-11-251-2/+2
| | | | Add more description in error logging.
* autopair: Remove time(NULL) fallback when seeding rand()Anderson Lizardo2014-03-051-9/+18
| | | | | | | If /dev/urandom cannot be opened or read, just fail the plugin initialization, as it is very unlikely that a fully working Linux system does not have a working /dev/urandom. This also simplifies the code logic.
* plugins: Use full include path for header filesMarcel Holtmann2014-01-251-5/+5
|
* autopair: Add special handling for printersBastien Nocera2013-11-191-0/+8
| | | | | As was done in gnome-bluetooth since 2009: https://git.gnome.org/browse/gnome-bluetooth/commit/?id=7a472c151d44a3378ecbd3c2a75c763f5c577fe9
* core: Avoid unnecessary gboolean on pincode callback APIAnderson Lizardo2013-06-131-4/+4
| | | | | Use standard "bool" type instead. Callers in plugins/* are fixed on the same commit to avoid compilation errors.
* plugins: Use open()/read() instead of fopen()/fread() on autopairAnderson Lizardo2013-06-131-7/+15
| | | | | | | | | open()/read() is more common on BlueZ code. Incidentally, get rid of this compilation error (using gcc 4.6.3): plugins/autopair.c: In function ‘autopair_init’: plugins/autopair.c:154:8: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
* autopair: Clean up coding styleJohan Hedberg2013-05-101-8/+12
|
* autopair: Try a fixed pincode for keyboards rejecting random codesAlex Deymo2013-05-101-1/+16
| | | | | | | | This patch makes the autopair plugin try a fixed "0000" pincode for keyboards that reject the pincode too fast (less than 500ms). This too short delay rejecting the pincode means that the user didn't have time to type the random pincode in the bluetooth keyboard and was the keyboard who actually rejected it.
* autopair: Add the autopair pluginAlex Deymo2013-05-101-0/+150
The autopair plugin tries standard pincodes for different devices with dumb pincodes. It also generates a random 6 digit pincode for keyboards that support any pincode but fallbacks to the agent call in case the random generated pincode didn't work.