| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
When transitioning from Phase 1 to Phase 2 of a network key and we are
beaconing, we need to halt the beaconing on the old key version, and
begin beaconing on the new key version.
|
|
|
|
|
|
|
| |
With this change, we start evaluating received Mesh Private Beacons in
addition to the legacy Secure Network Beacons. We also add the ability
to request Tx of Mesh Private Beacons, which are regenerated with new
Random Nonce a minimum of every 0 - 2550 seconds.
|
|
|
|
|
|
|
| |
When a SAR transmission has been completed or cancelled, the recipent
should store the block authentication values for at least 10 seconds
and ignore new segments with the same values during this period. See
MshPRFv1.0.1 section 3.5.3.4.
|
|
|
|
|
| |
The message cache should be a strict ring buffer, suppressed message
should not move to the front of the queue.
|
|
|
|
|
|
|
| |
If we receive a message from one of our Low Power nodes, which is
encrypted using frendship credentials and where the destination is not
us, we must relay that message using master credentials.
See MshPRFv1.0.1 section 3.6.6.2.
|
|
|
|
|
| |
A friend update should be queued when we receive a Secure Network beacon
that changes the IV Update state.
|
|
|
|
|
| |
The padding bits in a Friend Poll message must be zero.
See MshPRFv1.0.1 section 3.6.5.1.
|
|
|
|
|
|
| |
If we are in Key Refresh Phase 1, and receive a Secure Network beacon
using the new NetKey and with KR flag set to 0, Phase 2 should be
skipped. See MshPRFv1.0.1 section 3.10.4.1.
|
|
|
|
|
|
| |
If we are in IV update in progress state, and receive a Secure Network
beacon with an IV index equal to last known IV index + 1, and IV update
flag set to 1, it should be ignored. See MshPRFv1.0.1 section 3.10.5.
|
|
|
|
|
|
|
| |
If this node is a member of a primary subnet and receives a Secure Network
beacon on a secondary subnet with an IV Index greater than the last known
IV Index of the primary subnet, the Secure Network beacon shall be ignored.
See MshPRFv1.0.1 section 3.10.5.
|
|
|
|
|
|
|
|
|
| |
If heartbeat subscription is disabled, all fields should be set to zero
but collected data should be preserved. If HB subscription is enabled,
the collected data should be reset (which includes Min Hops = 0x7f).
HB subscription is disabled by setting any of the following fields to
zero: Source, destination or period log.
HB subscription is enabled by setting all the same fields to valid values.
|
|
|
|
|
| |
According to the mesh profile (3.4.5.2), if TTL is set to 1 for an
outgoing message, that message shall be dropped.
|
|
|
|
|
|
|
|
| |
For received CTL mesh messages, the wrong network ID variable was
passed to ctl_received. This patch changes to the correct variable.
Also, changed type of net_key_id argument in ctl_received function
to be consistent wich the whole call chain.
|
|
|
|
|
|
|
|
|
| |
This addresses a situation when a boolean type is represented by
an integer and performing a left shift on a boolean causes
an integer overflow.
This fixes the following runtime error:
"left shift of 1 by 31 places cannot be represented in type 'int'"
|
|
|
|
|
|
|
|
| |
- key_aid refers to application key AID
- net_key_id refers to unique, internal id of the network key, used in
net-keys.h
Also, remove unused mesh_frnd_pkt struct.
|
|
|
|
|
|
|
| |
As pointed out by https://github.com/bluez/bluez/issues/250, the last
segment of a multi-segmented message added to Friend Queue was getting
reset to the seqAuth value incorrectly. The correct sequence was set
within the preceding for loop.
|
|
|
|
|
|
| |
This fixes an uninitialized memory issue where a message received for
a local node is silently discarded if an uninitialized boolean is
mistakenly set to TRUE, when friendships exist.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes inifinite loop problem caused by recurring call
of the `net_key_beacon_refresh` function.
Problem occurs when at least two nodes are connected to the same
BlueZ instance and they are connected to the same network
(use same network key). Issue is triggered when IVIndex update
process stabilize and one of the nodes receives network beacon
with IVUpdate flag set to 0. Then it processes the "local" beacon
and compose new `snb` (with IVUpdate flag set to 0) attached to
`net_key` instance. After that it calls `net_local_beacon` and
another node processes the new beacon (this node has IVUpdate
flag still set to 1). Note that the `net->ivupdate` has set value 1.
The `update_iv_ivu_state` says that "IVU clear attempted too soon".
The node composes new `snb` with IVUpdate flag set to 1 and writes
it to the `net_key` instance in the `net_key_beacon_refresh`
function. After that it calls `net_local_beacon` which causes
repeat of all process. We are rotating in this loop until end-of-memory.
|
|
|
|
|
|
|
|
|
|
| |
At the end of the mesh Key Refresh procedure when a subnet
transitions to Phase 0, local AppKeys that were updated were
not updating until the bluetooth-meshd daemon was restarted.
This patch iterates the AppKeys at the end of mesh Key Refresh
when the subnet transitions to Phase 0, setting the new state
of each updated AppKey.
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression introduced in commit c77bb848a9fb
("mesh: Refactor heartbeat pub/sub"):
Heartbeat subscription should be enabled unless either source or
destination are unassigned addresses or period log is zero.
Also, decrement ref count on group destination address if period log
is zero since the subscription is not supposed to be processed.
|
|
|
|
|
|
|
|
| |
When multiple mesh networks are active and one is detached
using Leave(), the I/O to all networks is halted.
This patch prevents that by only deregistering the I/O
if all networks have been detached.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds SPDX License Identifier and removes the license text.
-------------------------------------
License COUNT
-------------------------------------
LGPL-2.1-or-later : 48
License: LGPL-2.1-or-later
mesh/mesh-mgmt.h
mesh/mesh-mgmt.c
mesh/net-keys.c
mesh/mesh-io-api.h
mesh/mesh.h
mesh/net-keys.h
mesh/model.h
mesh/util.h
mesh/appkey.c
mesh/cfgmod.h
mesh/appkey.h
mesh/prov.h
mesh/prov-acceptor.c
mesh/net.c
mesh/dbus.h
mesh/friend.h
mesh/mesh-io-generic.c
mesh/main.c
mesh/util.c
mesh/dbus.c
mesh/error.h
mesh/mesh-config-json.c
mesh/agent.h
mesh/pb-adv.c
mesh/crypto.c
mesh/crypto.h
mesh/friend.c
mesh/pb-adv.h
mesh/provision.h
mesh/mesh-config.h
mesh/mesh-io-generic.h
mesh/agent.c
mesh/cfgmod-server.c
mesh/mesh-io.h
mesh/keyring.h
mesh/net.h
mesh/keyring.c
mesh/mesh-defs.h
mesh/mesh.c
mesh/rpl.c
mesh/manager.c
mesh/model.c
mesh/mesh-io.c
mesh/node.c
mesh/prov-initiator.c
mesh/rpl.h
mesh/node.h
mesh/manager.h
|
|
|
|
|
|
|
|
|
| |
Check whether an incoming message has an RPL entry prior to
handing it over to model layer for processing. If present in RPL
or the RPL queue is full, ignore the incoming message.
If the incoming message is processed successfully, add the message
as a new RPL entry.
|
|
|
|
|
|
|
|
| |
When either a new node is created or an existing node is loaded from
storage, initialize RPL storage directory.
Additionally, when an existing node configguration is read from storage,
load saved RPL entries into the corresponding RPL lists.
|
|
|
|
|
|
| |
This adds previously missing retransmit count and interval values
specific to model publications. The values are configured by Config CLient
and may be different to each model.
|
|
|
|
|
|
| |
This moves the check for incoming messages addressed to fixed addresses,
e.g. RELAY, PROXY, FRIEND. If the corresponding feature is not enabled,
the message is not processed.
|
|
|
|
|
|
|
|
|
|
| |
Move heartbeat publication/subscription timers and housekeeping
to net.c since this is where the trigger events and control messages
are handled. Configuration server (cfgmod-server.c) stays
responsible for parsing the set pub/sub message parameters and
assemblying the pub/sub status messages.
Also, make sure that the correct message status is reported.
|
|
|
|
|
|
|
|
|
| |
This modification allows using a single point for sending out
the composed status messages by the Config Server.
Also, this checks for the correct relationship between KR transition
and KR phase values. Correct error codes are sent on unsuccessful
requests and malformed requests are ignored.
|
|
|
|
|
| |
When deleting a non-existing key, first check that it doesn't exist (and
return success), then verify it's not the last key we have.
|
|
|
|
|
|
| |
This adds emitting of PropertiesChanged signal whenever the
mesh IV index is updated to indicate that the vlaues of "IvIndex"
property has been modified.
|
|
|
|
|
| |
This deletes unused functions and structures in net.c & net.h.
Plus, some style cleanup.
|
|
|
|
|
|
|
|
|
| |
Before the clean-up we were making a useless check of an otherwise
unused boolean (net->provisioner) to determine if we should decode with
device keys (which was incorrect). This was replaced by a check the
node type (node->provisioner). However, the check was incorrect in the
first place, and prevents provisioner nodes from decrypting non device
key messages.
|
|
|
|
|
| |
This removes mesh_net_provisioner_mode_set (unused) and
mesh_net_provisioner_mode_get (duplicates node_is_provisioner)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The folllowing functionsa are not being used anywhere in the code and
have been removed:
mesh_net_flush()
mesh_net_prov_caps_get()
mesh_net_priv_key_get()
mesh_net_priv_key_set()
mesh_net_prov_rand()
mesh_net_prov_uni()
mesh_net_id_uuid_set()
mesh_net_test_addr()
mesh_net_test_mode()
mesh_net_uni_range_set()
mesh_net_uni_range_get()
mesh_net_set_window_accuracy()
|
| |
|
|
|
|
|
|
| |
This removes callback for sending every single access layer packet
since the callback does nothing but print debug satement. This
functionality is mature enough not to require such heavy debugging.
|
|
|
|
|
| |
This changes l_info() to l_debug() for recurring cases and
removes some excessive debug output.
|
|
|
|
|
| |
These warnings are caused by not completely freeing memory allocations
at shutdown, and are not serious, but they make valgrind output cleaner.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When daemon receives beacon with IV=n+1, IVU=False it will
start sending messages with new IV and set sequence to 0.
However if daemon receives another beacon with IV=n+1, IVU=True it
will go back to sending messages with old IV=n (IVU set to True).
Because sequence number has been reset those messages will be dropped
by replay protection and node will lose communication.
Once IV is updated daemon should not go back to using the old value.
This patch adds beacon rejection if IV has already been updated.
|
|
|
|
|
| |
This patch adds net key index to struct mesh_sar. This fixes problem with
using invalid network key to encrypt application messages.
|
|
|
|
| |
'mesh_net_sub_list_del'
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
There was a bug identified in the RPL storage, such that the real-time
queue was being filled by incorrect unicast addresses. (Thx ccsanden).
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Re-arranged for efficiency. Replay Protection was set up as an atomic
check-and-add operation. Now we check the message early so we can
discard it without taking further action, and only add it to the RPL
once fully verified that it was authorized and addressed to us.
|
|
|
|
|
|
|
|
|
| |
Mesh specification requires that Replay Protection be preserved
across node restarts. This adds that storage in
<node_uuid>/rpl/<iv_index>/<src>
Realtime access remains in an l_queue structure, and stored as
messages are processed.
|
|
|
|
|
|
| |
Scrub of Sequence Number handling of OB messages to account for in-node
delivery of segmented messages, so that each discrete message has a
unique sequence number for the RPL.
|