Commit graph

21541 commits

Author SHA1 Message Date
Jukka Rissanen
5746f61d4c net: dns: Check recursive pointers for CNAME handling
Make sure that the CNAME handling checks recursive name pointers
and fails the response if recursion is detected.
See RFC 9267 ch. 2 for details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-31 22:00:36 +02:00
Mirai SHINJO
93b59a2314 sd: correct mismatched comment for CONFIG_SDMMC_STACK
The closing comment for CONFIG_SDMMC_STACK #ifdef directive was
incorrectly labeled as CONFIG_SDIO_STACK. This commit corrects the
comment to reflect the correct configuration macro and improve code
clarity.

Signed-off-by: Mirai SHINJO <oss@mshinjo.com>
2025-03-31 21:59:40 +02:00
Lyle Zhu
3bf18870f9 Bluetooth: Classic: SMP: Store derived LK if SMP_FLAG_BOND is set
When deriving the new LK, remove the old LK if it exists.

Store the derived LK if the flag `SMP_FLAG_BOND` of LE SMP is set.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 14:35:50 +02:00
Lyle Zhu
001397653b Bluetooth: Classic: SMP: Set BT_LINK_KEY_SC only if BT_KEYS_SC is set
The flag `BT_LINK_KEY_SC` of LK will also be set when derive LK from
LTK.
It is a incorrect behavior.

The flag `BT_LINK_KEY_SC` should only be set if the flag `BT_KEYS_SC`
of LTK has been set.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 14:35:50 +02:00
Lyle Zhu
2695d2228b Bluetooth: Classic: SMP: Avoid stronger LK be overwrote by weaker LTK
Add the function `ltk_derive_link_key_allowed()` to check whether the
LK can be overwrote by the LTK.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 14:35:50 +02:00
Kapil Bhatt
6f9dbbd54f wifi: utils: Fix crash for scan
The check for index out of bound is missing, It turns into a crash
for input channel more than WIFI_MGMT_SCAN_CHAN_MAX_MANUAL.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-03-31 14:33:22 +02:00
Lyle Zhu
f25fe59805 Bluetooth: Classic: SMP: Recovery flag SMP_FLAG_BR_CONNECTED
The flag `SMP_FLAG_BR_CONNECTED` is cleared by the function
`smp_br_reset()` and `smp_br_init`. But the flag
`SMP_FLAG_BR_CONNECTED` should not be cleared at this time.

Recovery the flag `SMP_FLAG_BR_CONNECTED` after the all flags of SMP
cleared.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 11:29:49 +02:00
Lyle Zhu
b59bc363ea Bluetooth: Classic: SMP: Set secure connection for derived LTK
If the encrypt value of classic connection is
`BT_HCI_ENCRYPTION_ON_BR_AES_CCM`, set the flag `BT_KEYS_SC` for
the derived LTK.

Or, clear the flag `BT_KEYS_SC` for the derived LTK.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 11:29:49 +02:00
Lyle Zhu
58f6ca80ca Bluetooth: Classic: SMP: Remove old LE keys before upgrading keys
Remove the old LE keys from resolving list and NVM before upgrading
the keys.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 11:29:49 +02:00
Lyle Zhu
3712b96738 Bluetooth: Classic: SMP: Avoid derived LE keys be added multiple times
In current implementation, the flag `local_dist` will be cleared when
the distributed key frame is performed if the local is the SMP
initiator. After the distributed key is sent out, the function
`smp_pairing_br_complete()` will be called if all bits of `local_dist`
are cleared.

It causes the function `smp_pairing_br_complete()` will be called
multiple times.

Add a flag `local_distributed` to flag the all sent keys. Add only the
flag `local_distributed` is not set, preform the key distribution
frame.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 11:29:49 +02:00
Lyle Zhu
8bb67c5824 Bluetooth: Classic: SMP: Derived LE keys are not handled correctly
The derived LE keys are not saved to NVM. And the IRK is not added to
controller resolving list. It causes two issues,
Issue 1, the LE connection connection cannot be established if the adv
address of peer is RPA.
Issue 2, the LE keys are missing after the power reset.

For issue 1, add a function `smp_br_id_add_replace` to add LE keys.
For issue 2, check the BR bondable flag `BT_CONN_BR_NOBOND` instead of
`SMP_FLAG_BOND`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-31 11:29:49 +02:00
Tomasz Bursztyka
b4f9242a6a shell: kernel: Add a panic command
For testing purposes only. Testing the fatal error handler or
a coredump backend. Or just out of curiosity.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Tomasz Bursztyka
6ad72847e9 coredump: Add an in-memory backend
Only meant to be used on platforms that would not wipe the RAM on reboot.
This won't work if the platform is halted and restarted as RAM is
volatile, obviously. A relevant fatal error handler needs to be provided
to reboot.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Tomasz Bursztyka
9bab18d5c8 coredump: Have a dedicated log module for coredump
To enable/disable any coredump logging while debugging the kernel.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Tomasz Bursztyka
13abd7fe73 coredump: Generalize the shell module
This might come in handy for other coredump backends too, not only flash
one. Obviously: changing the logic to use the coredump generic API instead
of the flash backend's internal functions.

Adding a better output, following how the coredump is actually created:
parsing and printing headers, and their respective content.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Vinayak Kariappa Chettimada
dd1c3948ca fixup! Bluetooth: Controller: Fix incorrect CIS payload count at CIS Estab
Fix incorrect payload count at CIS Establish due to existing
CIG event overlapping the ACL event at the instant when the
CIS gets the active flag set.

The overlapping CIG event picked up the new CIS that had its
active flag set in the current CIG event instead of at the
actual CIS offset which is in the next CIG event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Vinayak Kariappa Chettimada
fcca236e42 Bluetooth: Controller: Fix CIS offset for dissimilar ACL & CIG interval
Fix CIS offset calculation due to use of decremented ACL
event counter, where as the CIS offset is inquired in the
next ACL event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Vinayak Kariappa Chettimada
4ab805b389 Bluetooth: Controller: Fix incorrect CIS offset accepting peer instant
Fix incorrect CIS offset in use if instant is picked from
the peer sent CIS RSP PDU. Instead, keep the instant that
was sent in the CIS REQ PDU as the instant to send in the
CIS IND PDU.

This fixes CIS failed to be established when dissimilar
ACL and ISO intervals are in use.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Vinayak Kariappa Chettimada
f2c020f53e Bluetooth: Controller: Fix incorrect CIS payload count at CIS Estab
Fix incorrect payload count at CIS Establish due to existing
CIG event overlapping the ACL event at the instant when the
CIS gets the active flag set.

The overlapping CIG event picked up the new CIS that had its
active flag set in the current CIG event instead of at the
actual CIS offset which is in the next CIG event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Vinayak Kariappa Chettimada
81dd7595f0 Bluetooth: Controller: Fix Peripheral CIS sorted by CIG
Fix Peripheral CIS sorted by CIG implemenation to use CIS
offset stored in LLL context which is the correct offset
from the CIG anchor point. CIS offset in the ULL context
is the offset from the ACL anchor point at the time of
the CIS establishment.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Vinayak Kariappa Chettimada
26eedaaf45 Bluetooth: Controller: Fix CIS event_count_prepare use
Fix CIS event_count_prepare use missed as part of fixes
related to commit be91cfedfb ("Bluetooth: Controller: Fix
incorrect event_count when CIG overlaps").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Tim Gibson
1f754ac009 settings: fix settings shell subcommand helper
The settings shell returned an unhelpful message when provided
the incorrect arguments. This changes the returned message to
provide the correct usage message.

Signed-off-by: Tim Gibson <timmaxgibson@gmail.com>
2025-03-29 06:31:39 +01:00
Krzysztof Chruściński
0b866648e1 debug: cpu_load: Fix CPU_LOAD_USE_COUNTER config
dt_chosen_enabled argument was incorrect and it was always returning
n so option could not be used.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-28 21:52:30 +01:00
Jukka Rissanen
8e908176c7 net: shell: iface: Print VPN public key
If the interface is a VPN interface, then print
the public key of the interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:57 +01:00
Jukka Rissanen
4eac955305 net: if: Add special handling for IPv4/6 address check for VPN
This is a hack that is used until we have proper IP routing
in place. The code has now special check that makes sure that
we only route IP packets to VPN interface when the packet is
destined to that subnet. So if destination IP address does
not belong to VPN interface subnet, it is not routed there.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:57 +01:00
Jukka Rissanen
663867dbb0 net: if: Add helper to get src interface and address from dst address
Instead of calling various network interface API functions to get
the network interface and related source IP address, have a single
function that can return both data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:57 +01:00
Jukka Rissanen
525b8e58a2 net: l2: virtual: Add support for VPN public/private key set/get
Add support for getting public address and setting private
key for the virtual interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:57 +01:00
Jukka Rissanen
c073a01b39 net: shell: events: Print VPN event information
Add VPN events information printouts to event monitor.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:57 +01:00
Jukka Rissanen
d95d391968 net: stats: Add VPN statistics support
Enable collection of VPN statistics and allow user to fetch it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@gmail.com>
2025-03-28 21:51:57 +01:00
Jukka Rissanen
b7dec6c195 net: Add option for VPN enablement
Add support for setting up VPN enablers in the network stack.
These are to be used by the VPN implementation like Wireguard.

Signed-off-by: Jukka Rissanen <jukka.rissanen@gmail.com>
2025-03-28 21:51:57 +01:00
Jukka Rissanen
0a8bad7e28 net: dhcpv4: Add parsing of received domain name
Currently we ignore the received domain name but make sure we
print it in order to avoid unknown option prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:33 +01:00
Jukka Rissanen
22f15de7a6 net: dhcpv4: Add parsing of received host name
Currently we ignore the received host name but make sure we
print it in order to avoid unknown option prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:33 +01:00
Jukka Rissanen
8ec4fba67c net: dhcpv4: Add parsing of broadcast address
Currently we ignore the broadcast address but make sure we
print it in order to avoid unknown option prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:33 +01:00
Aleksandr Khromykh
bf22fa697b Bluetooth: Mesh: remove device key candidate
Commit removes device key candidate if provisionee failed
during device key refresh procedure or mesh reset has been
called in between. Otherwise, device key candidate gets
stuck in the internal trusted storage of crypto library.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-03-28 16:11:39 +01:00
Cla Mattia Galliard
eb029b9ee1 net: http: server: Avoid compiler warnings for zero-length-arrays
Avoid compiler warnings for zero-length-arrays in the http-server. By using
memcpy instead of strcpy.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-03-28 16:11:27 +01:00
Triveni Danda
589333e4d9 wifi: shell: Add support for EAP-TLS method
Add support to read identity and private key password if
configured in Enterprise mode.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-03-28 16:10:36 +01:00
Triveni Danda
7b6f2572e5 net: lib: wifi_credentials: Use getopt API for adding network options
Use getopt API to process arguments for `cred add` command.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-03-28 16:10:36 +01:00
Zihao Gao
a0efdb2112 Bluetooth: AVRCP: Move the handling of transaction labels to the App.
According to AVCTP v1.4: On the controller and the target side,
handling of transaction labels is dependent on the application.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
7822bf7628 Bluetooth: AVRCP: Remove AVRCP timeout.
Remove the transaction label mechanism because:
1. Not necessary at stack, typically an application can handle the
timeout mechanism if required (very rarely).
2. It is a burden on memory size to record all pending commands.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
3f747839c5 Bluetooth: AVRCP: expose macros to upper layer.
This patch expose BT_AVRCP_COMPANY_ID_SIZE to applications.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
a4790aeab8 Bluetooth: AVRCP: use spec defined structures on APIs.
This patch replaced the structures defined by zephyr APIs
by those defined by AVRCP Spec.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
6fe6326bea Bluetooth: AVRCP: implementation of Get Capabilities command.
This patch allows the upper layer to acquire the remote AVRCP
capabilities. These capabilities can be further used in register
notifications.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Radosław Koppel
26e3e82e60 ipc_service: ipc_icbmsg: Update backend API return values
Update release_rx_buffer return value to match API documentation.
Cleanup register_ept workflow - remove unused variable.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2025-03-28 12:21:30 +01:00
Emil Gydesen
c6e7420d52 Bluetooth: TBS: Client: Fix sizeof('\0')
sizeof('\0') is misleading as it will return 4 instead of 1,
since it will evaluate to sizeof(0), which returns the size
of the `int` type. Modify the expression to use sizeof(char)
with a comment.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-28 12:20:10 +01:00
Daniel Mangum
87d7fcf6c2 bluetooth: host: fix GATT writable Kconfig descriptions
Fixes typos in the BT_DEVICE_NAME_GATT_WRITABLE_SECURITY and
BT_DEVICE_APPEARANCE_GATT_WRITABLE descriptions.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2025-03-28 08:50:05 +01:00
Cla Mattia Galliard
72fcca0304 net: virtual: Fix compiler warnings related to interface name
Fix compiler warning by adjusting the number of chars copied to the
destination. Compiler does not like if the destination size of the
`strncpy`-operation is the same as the number of characters written. Even
though it is not a bug in this case. Only copying size-1 characters fixes
the warning and exhibits the same behavior.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-03-27 21:33:40 +01:00
Fin Maaß
651d6a3b58 net: dhcpv4: remove redundant dependencys
Remove ``depends on NET_DHCPV4`` on options,
that are inside a ``if NET_DHCPV4``.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-03-27 17:18:49 +01:00
Ingar Kulbrandstad
db84181c22 Bluetooth: Mesh: Fix proxy after board reboot
When the board has been provisioned and the board is rebooted
it was not possible to connect to the board through the proxy
servcie. This fixes that the Mesh Proxy servive is restarted
after the board is rebooted.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2025-03-27 14:02:12 +01:00
Tahsin Mutlugun
d4e87247f0 logging: backends: xtensa_sim: Drop SoC dependencies
Make Xtensa simulator logging backend depend on more generic
SIMULATOR_XTENSA setting instead of individual SoCs.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-03-27 09:51:17 +01:00
Daniel Mangum
36661dc9d4 mgmt: mcumgr: transport: remove dup LoRaWAN smp_reassembly_init
The LoRaWAN SMP transport uses MCUMGR_TRANSPORT_LORAWAN_REASSEMBLY to
enable reassembly. It selects MCUMGR_TRANSPORT_REASSEMBLY, which causes
smp_transport_init to call smp_reassembly_init on the passed transport.
This makes the subsequent call to smp_reassembly_init in the LoRaWAN
transport initialization redundant.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2025-03-27 09:51:08 +01:00