Commit Graph

25194 Commits

Author SHA1 Message Date
Michał Lowas-Rzechonek
5379e024fc mesh: Fix model publication status after set
This patch fixes usage of send_pub_status() when handling publication
set message - mod_id was swapped with pub_addr, resulting in malformed
message being sent back to the Config Client.
2020-03-26 10:00:33 -07:00
Prathyusha N
424f88e7b8 mesh: Handle close for Acceptor
Provision complete callback is handled in provision failure case.
If link closed received abruptly with reason success, triggered
provision complete callback. Removed session timeout and session
free as they are handled in pb_adv_unreg.
2020-03-25 10:31:14 -07:00
Brian Gix
936122a230 mesh: Whitespace correction 2020-03-25 09:55:49 -07:00
Prathyusha N
ac940a70ce mesh: Send input complete for input OOB Authentication
Send input complete when user completes input operation.
2020-03-25 09:50:05 -07:00
Prathyusha N
8ef71fca7f mesh: Handle invalid public keys
Check for invalid public keys received and send provision failed.
2020-03-25 09:43:50 -07:00
Prathyusha N
9b4d8f1dc1 mesh: Handle netkey delete when netkey is not in netkeylist
4.4.1.2.9 of Mesh Profile Bluetooth specification:
When an element receives a Config NetKey Delete message that
identifies a NetKey that is not in the NetKey List, it
responds with Success, because the result of deleting the
key that does not exist in the NetKey List will be the same
as if the key was deleted from the NetKey List.
2020-03-25 09:42:30 -07:00
Howard Chung
622d98afbb avdtp: Fix crashes in avdtp_abort
In avdtp_abort, if setup->stream is NULL, trying to access
stream->lsep will crash.
2020-03-23 22:39:06 -07:00
Brian Gix
97e24f9182 mesh: Fix Replay Protection Cache
There was a bug identified in the RPL storage, such that the real-time
queue was being filled by incorrect unicast addresses. (Thx ccsanden).
2020-03-23 14:37:04 -07:00
Brian Gix
e8c870c63b mesh: Allow short messages to be segmented
For added reliability, it is legal to send short messages as "single
segment" segmented messages, which require transport layer
acknowledgement. This feature is intended for heavy usage in the future
so I am adding it now.

Further, to support this functionality, an additional queue has been
added to allow multiple SAR messages to the same DST to be queued and
sent serially.
2020-03-20 11:51:18 -07:00
Inga Stotland
40339fed96 tools/mesh-cfgclient: Increase app's CRPL size
This increases the value of the CRPL supplied by the applicaiton
to 0x7fff: since the tool is intended to be a provisioner and config
client, it may have to keep track of communications with a significant
number of unique mesh nodes, each with its corresponding CRPL entry in
config client node storage. Therefore, a large CRPL size is necessary.
2020-03-18 11:16:21 -07:00
Inga Stotland
5885eab5bd mesh: Fix processing of Config Node Reset message
This fixes a condition when a node continues processing messages
after it has been reset by a remote configuration client.
Upon receiving Config Node Reset message, node removal happens after
a grace interval to allow sending of Config Node Reset Status reply.
2020-03-18 09:20:28 -07:00
Inga Stotland
fe43810b78 tools/mesh-cfgclient: Implement node-reset command
This implements one-pass removal oa a remote node from a mesh network
by issuing a node-reset command from config menu. The following actions
are performed:
- Config Node Reset message is sent to a remote node
- Upon either receiving Config Node Reset Status or response timeout,
  node record is removed from configuration client's database and,
  by calling DeleteRemoteNode() method on mesh.Management interface

node-delete command from the main menu is removed.
2020-03-18 09:20:28 -07:00
Luiz Augusto von Dentz
f2778f5877 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.
2020-03-16 13:32:11 -07:00
Luiz Augusto von Dentz
35d8d895cd 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.
2020-03-16 13:32:10 -07:00
Marcel Holtmann
ab8a80b04f Release 5.54 2020-03-15 07:35:59 +01:00
Marcel Holtmann
209a689b26 build: Update library version 2020-03-15 07:26:51 +01:00
Marcel Holtmann
787180f523 lib: Add version number for Bluetooth 5.2 2020-03-15 07:25:19 +01:00
Łukasz Rymanowski
031728b411 monitor: Fix for incorrect len in L2CAP Enhanced Reconfigure 2020-03-12 16:28:27 -07:00
Archie Pusaka
9541d862f0 a2dp: Fix race when connecting and being connected at the same time
There is a possibility where BlueZ initiate an A2DP connection just
around the same time as the peripheral also initiate it.

One scenario is the peripheral initiate the connection first, so
confirm_cb() on /profiles/audio/a2dp.c is called. However, while we
are waiting for the authentication step, BlueZ initiate a connection
to the peripheral, therefore a2dp_sink_connect() is called, which
from there a2dp_avdtp_get() is called.

If this happens: When calling confirm_cb(), chan for the
corresponding device is created.

Then when calling a2dp_avdtp_get(), chan will be found as it is
created in confirm_cb(), and the value of chan->io is not NULL.
However, a NULL is supplied instead to create a new session and
assigned to chan->session.

Then when calling connect_cb(), chan->session will NOT be NULL, as
it is assigned in a2dp_avdtp_get(). Nevertheless, chan->session is
always assigned a new value.

These cause failure in connection.

Therefore, fixing this by supplying the value of chan->io inside
a2dp_avdtp_get() (it's going to be NULL on the normal case so it is
fine), and check whether chan->session already assigned inside
connect_cb().
2020-03-12 16:24:44 -07:00
Inga Stotland
14151f9b52 test/test-mesh: Add support for static OOB in the agent
This allows to display a 16-octet key to be entered on the remote
device during provisioning.
2020-03-12 11:19:14 -07:00
Brian Gix
65e38696a2 tools/mesh-cfgclient: Add support for Static OOB key
This fixes a bug that didn't allow 16 octet Static OOB strings during
provisioning.
2020-03-12 11:17:35 -07:00
Brian Gix
ad50deead4 README: Add Mesh required Kernel Configuration section
Not all distributions include all required mesh crypto support.  This
adds a section with known kernel required options.
2020-03-12 11:16:10 -07:00
Alain Michaud
3cccdbab23 HID accepts bonded device connections only.
This change adds a configuration for platforms to choose a more secure
posture for the HID profile.  While some older mice are known to not
support pairing or encryption, some platform may choose a more secure
posture by requiring the device to be bonded  and require the
connection to be encrypted when bonding is required.

Reference:
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.html
2020-03-10 06:22:16 +01:00
Alain Michaud
8cdbd3b09f HOGP must only accept data from bonded devices.
HOGP 1.0 Section 6.1 establishes that the HOGP must require bonding.

Reference:
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.htm
2020-03-10 06:19:48 +01:00
Marcel Holtmann
2f2ea96135 doc: Mention the Wideband Speech setting and add new kernel version 2020-03-08 09:11:04 +01:00
Inga Stotland
f1eb453eb7 tools/mesh-cfgclient: Record remote node's default TTL
This adds code to save the value of a remote node's default TTL
upon receiving Config Default TTL Status message.

Also, cleanup leftover "#if 0" clause
2020-03-05 08:01:28 -08:00
Inga Stotland
dd81aa0534 tools/mesh-cfgclient: Add address checks for pub/sub commands
This addrs verification of subscriptpion address value entered on
the command line: unassigned address, unicast address, and
all-nodes address are not allowed. Publication address check verifies
that the entered value falls into mesh address space.

Also, change the type of parameter count in comaand processing routines
from int to uint32_t to match the retrun type of the parameter parsing
routine.
2020-03-05 08:01:28 -08:00
Inga Stotland
ff41bce83d mesh: Remove unused parameters from internal rx functions
This removes unused ttl parameter from mesh_model_rx(). The TTL value
is not processed at the access layer, so there is no need to pass it
to a model.
Also, remove "uint32_t dst" parameter from the typedef of
mesh_model_recv_cb: providing a just destination address is sufficient
for internally implemented models (currently, it's only Config Server)
2020-03-05 08:01:28 -08:00
Alain Michaud
6e93cf4409 lib: Adding definitions for Wide Band Speech configuration
This change adds the corresponding user space definition for wide band
speech.
2020-03-05 12:09:41 +01:00
Marcel Holtmann
9cb7406d54 doc: Add settings and command for Wideband Speech support 2020-03-04 08:37:43 +01:00
Marcel Holtmann
2c24268167 doc: Add another missing PHY Configuration value 2020-03-04 08:35:14 +01:00
Luiz Augusto von Dentz
209e2568c6 monitor: Add support for decoding EATT
This decodes packets received over EATT PSM.
2020-03-02 14:42:35 -08:00
Luiz Augusto von Dentz
cc441474e7 core: Add support for setting the number of GATT bearers
This adds option to set the numbers of GATT Channels/Bearers to be
connected in main.conf.
2020-03-02 14:42:35 -08:00
Luiz Augusto von Dentz
b8b59af4e8 gatt: Add support for Notify Multiple
This adds support for Notify Multiple procedure marking its bit as
supported in the Client Features.
2020-03-02 14:42:34 -08:00
Luiz Augusto von Dentz
923d9b47be shared/gatt: Add support for Handle Value Multiple Notifications
Handle Value Multiple Notification can be used to notify multiple
values at once.
2020-03-02 14:42:34 -08:00
Luiz Augusto von Dentz
6ea204dca0 shared/gatt-client: Add support for Read Multiple Variable Length
The Read Multiple Variable Length Request is used to request that the
server read two or more values of a set of attributes that have a
variable or unknown value length and return their values in a
Read Multiple Variable Length Response.
2020-03-02 14:42:33 -08:00
Luiz Augusto von Dentz
3c5088f040 shared/gatt-server: Add support for Read Multiple Variable Length
The Read Multiple Variable Length Request is used to request that the
server read two or more values of a set of attributes that have a
variable or unknown value length and return their values in a
Read Multiple Variable Length Response.
2020-03-02 14:42:33 -08:00
Luiz Augusto von Dentz
4521919061 gatt: Enable EATT bearer support
This adds support for EATT connections.
2020-03-02 14:42:32 -08:00
Luiz Augusto von Dentz
76d63c91b2 shared/gatt-client: Add support for EATT features
This enables EATT in the Client Features if the EATT characteristic is
present in the database.
2020-03-02 14:42:32 -08:00
Luiz Augusto von Dentz
0379b6c876 share/att: Add EATT support
This adds EATT support to bt_att, EATT bearers are handled as
additional channels which auto allocated for queued requests.
2020-03-02 14:42:30 -08:00
Archie Pusaka
c730f68303 src/profile: Ensure class UUID matches before connecting profile
According to bluetooth spec Ver 5.1, Vol 3, Part B, 4.7.2, there
might be multiple service records returned in a SDP Service Search
Attribute Response. Also, according to 2.5.2, the service pattern
can match any UUID contained within the service record, it doesn't
have to match only some specific attributes of the record.

Therefore, before using the service record to connect to any
profile, first we must check that the service class ID of the
service record matches with whatever UUID specified in the service
pattern we are looking for.

This patch checks the service class ID of the records against the
requested UUID whenever bt_search_service() is called and filter
out the ones that don't match. For the alternative where filtering
is not applied, use the method bt_search().
2020-03-02 14:13:17 -08:00
Marcel Holtmann
2fa0703398 doc: Mention the mgmt API version 1.15 changes 2020-02-28 09:18:58 +01:00
Alain Michaud
6460926163 doc: Adding missing Phy Configuration bit description.
This change simply adds the missing Phy Configuration settings bit
description to the Read Controller Information Command documentation.
2020-02-28 09:17:01 +01:00
Inga Stotland
9695f369d1 test/test-mesh: Fix output of UpdateModelConfig method
This correctly unpacks configuration dictionary received
in the UpdateModelConfig() method
2020-02-26 11:20:08 -08:00
Inga Stotland
818a59aead mesh: Clean up handling config model publication message
This tightens up the Config Server code that handles the processing of
Config Model Publication Set and Config Model Publication Get messages.
2020-02-26 11:20:08 -08:00
Inga Stotland
754b2c387b mesh: Simplify model virtual pub/sub logic
This reorganizes the part of the code that handles model publishing
and subscribitng to virtual labels.
2020-02-26 11:20:08 -08:00
Inga Stotland
19e5fa44f3 tools/mesh-cfgclient: Save and restore group addresses
This allows to save created virtual labels and group addresses
in configuration file. The stored values can be restored upon
the tool start up.
2020-02-26 11:20:08 -08:00
Inga Stotland
c872d0a48b tools/mesh-cfgclient: Clean up subscription list output
This tightens up the subscritpiton list status print out:
use the same function for vendor and SIG models.
2020-02-26 11:20:08 -08:00
Inga Stotland
496ed29398 tools/mesh-cfgclient: Add support for virtual labels
This adds commands to generate and use virtual addresses for
configuring remote node's publication and subscription.

New commands:
virt-add - generate a new label and calculate virtual address
group-list - displays group addresses that are in use and available
             virtual labels with corresponding virtual addresses
2020-02-26 11:20:08 -08:00
Brian Gix
6a6fe856a9 mesh: rework incoming advertisement filtering
Future versions of Mesh will introduce new advertising packets, which
do not fit in the limited and rigid filtering currently used. This minor
rewrite allows registering and receiving of *any* AD types, including
the filtering on multiple octets of the incoming AD parts.
2020-02-26 11:20:08 -08:00