Change or upgrade the bluetooth security level #993
Replies: 2 comments 3 replies
-
|
@Vudentz could you please help me here? |
Beta Was this translation helpful? Give feedback.
-
|
@Prashaanth06 for GATT we do the encryption when an attribute return an error: https://github.com/bluez/bluez/blob/master/src/shared/att.c#L748 So we follow what the security required by the server, otherwise we could end up requesting a security level that the server doesn't support and fail in the process. Btw, the security is then set via socket option BT_SECURITY: https://github.com/bluez/bluez/blob/master/doc/l2cap.rst#bt_security-since-linux-2630 So if the security is left to BT_SECURITY_LOW it probably means there is no attribute requiring encryption to change the security. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently I am using bluez 5.55 version and I have developed a gatt server for read, write and notify and things are working as expected, able to send and receive data. When I checked for the security level of bluetooth I got to know that it is falling back to security mode 1 and level 1(got to know after performing bluetooth sniffing using nrf52840 dongle) which has no encryption and authentication.
I am using Just works pairing mechanism so my aim is to atleast move to security mode 1 and level 2(encryption: yes and authentication: No) I checked in the main.conf file of bluez 5.55 I dont have any properties related to security so, I tried to move to bluez 5.78 which is the latest and tried setting this property SecureConnection = on and SecureConnection = only then restarted the bluetooth daemon,
Logs after the change:
bluetoothd[1269]: Bluetooth daemon 5.78
bluetoothd[1269]: src/main.c:check_config() Unknown group AVRCP in /etc/bluetooth/main.conf
bluetoothd[1269]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf
bluetoothd[1269]: src/main.c:parse_config_string() General.SecureConnections = only
bluetoothd[1269]: src/adapter.c:adapter_init() sending read version command
bluetoothd[1269]: Starting SDP server
In logs I could see that the secureconnections properties is configured to only and I am using bluez 5.78 but still I see it's in security level 1. How to upgrade to security level2 ?
I am checking the security level when it's pairing with a nomadic device. I am pretty sure that the nomadic device also supports secured connections. Am I missing something how do I approach to upgrade to security level 2?
Beta Was this translation helpful? Give feedback.
All reactions