Commit Graph

21 Commits

Author SHA1 Message Date
Inga Stotland
ff35b1d2e9 mesh: use explicit uint32_t when bit shifting left
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'"
2022-03-31 11:21:56 -07:00
Tedd Ho-Jeong An
59545d760f mesh: Add SPDX License Identifier
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
2020-09-21 16:19:35 -07:00
Brian Gix
29d737730a mesh: Fix using uninitialized bytes
Fixes two problems found with static analysis
2020-05-22 13:54:39 -07:00
Brian Gix
ef0970a723 mesh: Fix GCC 10.0 warnings 2020-04-18 08:21:03 -07:00
Michał Lowas-Rzechonek
59aae8b1cc mesh: Remove redundant code from mesh/crypto
- Remove application_encrypt/application_decrypt
- Make mesh_crypto_privacy_counter private, add mesh_crypto_pecb
- Make *_nonce functions private and align their implementation to be
  more consistent
- Refactor network_encrypt/network_decrypt to use *_nonce functions and
  rename them to packet_encrypt/packet_decrypt
- Refactor packet_encode/packet_decode
2020-04-07 09:52:44 -07:00
Jakub Witowski
6a889a28f1 mesh: Sequence number related fixes 2020-01-16 08:45:31 -08:00
Brian Gix
f246d31a77 mesh: Friendship clean-up and rewrite
Friendship support re-written such that it can now support multiple
nodes (on multiple mesh networks) as friends to remote Low Power Nodes
(LPNs).  Validated to properly respond to Friend Requests when enabled,
and a hard coded Friend Queue size of 32 (FRND_CACHE_MAX).
2019-11-28 13:49:59 -08:00
Michał Lowas-Rzechonek
79fd24af14 mesh: Remove unused defines 2019-10-03 13:10:16 -07:00
Brian Gix
f62350b702 mesh: test AEAD at startup to check kernel support
One time test at startup to ensure either kernel version v4.9 or later,
*or* that required AES-CCM support has been back-ported. If support not
there, daemon will run without providing D-Bus service or attaching to
controllers (prevents systemd thrashing).
2019-09-01 08:34:00 -07:00
Inga Stotland
fb5c57bccb mesh: Move commonly used constants into mesh-defs.h
This consolidates definitions of commonly used constant values
into a single header file. The constant values are based on mesh
specification, plus a few internal utility constants (masks, etc.)

Also, removes redundant redefinition maximum message length.
2019-08-12 12:49:34 -04:00
Brian Gix
8f0839a1c4 mesh: Normalize Access Key AID naming convention 2019-07-18 09:49:21 -07:00
Brian Gix
2e46771050 mesh: Convert provisioning pkts to packed structs
Provisioning packets are defined in the specification
as packed big endian structures. Instead of specifying
an octet array, we now use struct matching the spec.
2019-07-14 08:32:18 -07:00
Brian Gix
dfed483946 mesh: Convert crypto to use ELL wrappers
Use ELL implementations of aead-ccm(aes), ecb(aes) and cmac(aes). These
standard encryption and hashing routines are provided by ELL.
2019-05-31 16:46:34 -07:00
Inga Stotland
6df5c5e379 mesh: Remove unnecessary includes from .c files 2019-05-17 13:14:40 -07:00
Inga Stotland
af3f7f1b09 mesh: Update copyright dates 2019-05-17 13:14:40 -07:00
Brian Gix
cca48f305b mesh: Fix Relaying for multiple nodes
Relay is now a cooperation between all the nodes on the daemon.
If any one or more nodes have relay enabled and a received packet
is addressed to a Group, or a non-present Unicast address, then the
packet's TTL is decremented and it is resent.
2019-01-22 12:39:51 -08:00
Marcel Holtmann
261948090e build: Move declaration of _GNU_SOURCE back into individual source files 2018-12-06 21:28:18 +01:00
Brian Gix
7c9a8c7176 mesh: Mesh crypto support 2018-08-20 12:48:15 -07:00
Inga Stotland
ef05f4957d tools: Move meshctl sources under tools/mesh directory
This is a temporary location until the unified mesh solution is provided
2018-07-06 13:03:33 +02:00
Marcel Holtmann
8e96790482 mesh: Fix includes to use root relative path names 2017-08-21 13:40:03 +02:00
Brian Gix
9b92507843 mesh: Baseline Mesh implementation 2017-08-21 12:40:35 +02:00