Skip to content

Commit e11c47b

Browse files
committed
Anjay 3.11.0
BREAKING CHANGES: - Default value of maximal holdoff time during Bootstrap limited from 120 sec. to 20 sec. The limit can still be changed using ANJAY_MAX_HOLDOFF_TIME define. - If the Server certificate is missing from the Data Model, Anjay falls back to PKIX verification, provided that a Trust Store is available, even when the certificate usage is set to DANE-TA or DANE-EE. - avs_commons 5.5.0 that is used by Anjay 3.11.0 stoped passing the trust store to Mbed TLS backend for Certificate Usage 2 or 3. For details on how Anjay handles Certificate Usage resource refer to Anjay Specification -> Advanced Topics -> Certificate Usage. Bugfixes: - Updated avs_commons to a version without a PSK-mode vulnerability in the Mbed TLS backend where a client configured for PSK could connect to a server that did not know the PSK, due to advertising non-PSK key exchange and skipping certificate verification. This issue affected only TLS 1.3 connections with Mbed TLS versions ≥ 3.6.1. For details, see: https://github.com/AVSystem/avs_commons/releases/tag/5.5.0 Features: - (commercial version only) Added support for configuring OSCORE Object for each Security Object in Anjay Demo.
1 parent c7df239 commit e11c47b

File tree

89 files changed

+1384
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1384
-287
lines changed

.github/workflows/anjay-tests.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on: [push]
1010
jobs:
1111
ubuntu2004-compilers-test:
1212
runs-on: ubuntu-latest
13-
container: avsystemembedded/anjay-travis:ubuntu-20.04-2.1
13+
container: avsystemembedded/anjay-travis:ubuntu-20.04-2.2
1414
env:
1515
CC: ${{ matrix.CC }}
1616
CXX: ${{ matrix.CXX }}
@@ -41,7 +41,7 @@ jobs:
4141

4242
ubuntu2204-compilers-test:
4343
runs-on: ubuntu-latest
44-
container: avsystemembedded/anjay-travis:ubuntu-22.04-2.1
44+
container: avsystemembedded/anjay-travis:ubuntu-22.04-2.2
4545
env:
4646
CC: ${{ matrix.CC }}
4747
CXX: ${{ matrix.CXX }}
@@ -83,7 +83,7 @@ jobs:
8383

8484
rockylinux9-compilers-test:
8585
runs-on: ubuntu-latest
86-
container: avsystemembedded/anjay-travis:rockylinux-9-2.1
86+
container: avsystemembedded/anjay-travis:rockylinux-9-2.2
8787
env:
8888
CC: ${{ matrix.CC }}
8989
CXX: ${{ matrix.CXX }}
@@ -128,7 +128,16 @@ jobs:
128128
# NOTE: Some tests don't pass on mbedTLS 3.6.2 now, so we need to install an older version
129129
# Homebrew only specifiers major version of mbedTLS, so let's pin the version to 3.6.0 manually
130130
- run: curl -f https://raw.githubusercontent.com/Homebrew/homebrew-core/219dabf6cab172fb8b62b4d8598e016e190c3c20/Formula/m/mbedtls.rb > /tmp/mbedtls.rb
131-
- run: brew install --formula /tmp/mbedtls.rb
131+
# HACK: New version of homebrew requires us to install a formulae from a tap, create a tap for our mbedTLS.
132+
# The change in homebrew is intentional and won't be fixed, for more details see: https://github.com/orgs/Homebrew/discussions/6351
133+
- run: brew tap-new embedded/mbedtls
134+
- run: |
135+
TAP_DIR="$(brew --repo embedded/mbedtls)"
136+
mkdir -p "${TAP_DIR}/Formula"
137+
cp /tmp/mbedtls.rb "${TAP_DIR}/Formula/mbedtls.rb"
138+
git -C "${TAP_DIR}" add Formula/mbedtls.rb
139+
git -C "${TAP_DIR}" -c user.name="CI" -c user.email="[email protected]" commit -m "Add custom mbedtls formula"
140+
- run: brew install embedded/mbedtls/mbedtls
132141
- run: brew pin mbedtls
133142
# NOTE: The above command may have installed a new version of Python, that's why we launch it weirdly
134143
- run: /usr/bin/env python3 -m pip install -r requirements.txt --break-system-packages
@@ -139,14 +148,15 @@ jobs:
139148
fail-fast: false
140149
matrix:
141150
include:
142-
- CC: /opt/homebrew/opt/gcc/bin/gcc-14
143-
CXX: /opt/homebrew/opt/gcc/bin/g++-14
151+
- CC: /opt/homebrew/opt/gcc@14/bin/gcc-14
152+
CXX: /opt/homebrew/opt/gcc@14/bin/g++-14
144153
COMPILER_VERSION: gcc@14
145154
MEM_CHECK_TOOL: --without-memcheck
146-
- CC: /opt/homebrew/opt/llvm/bin/clang
147-
CXX: /opt/homebrew/opt/llvm/bin/clang++
148-
COMPILER_VERSION: llvm
149-
MEM_CHECK_TOOL: --with-asan
155+
# NOTE: llvm is temporarily disabled due to problem with header search paths
156+
# - CC: /opt/homebrew/opt/llvm@20/bin/clang
157+
# CXX: /opt/homebrew/opt/llvm@20/bin/clang++
158+
# COMPILER_VERSION: llvm@20
159+
# MEM_CHECK_TOOL: --with-asan
150160
- CC: cc
151161
CXX: c++
152162
MEM_CHECK_TOOL: --with-asan

.github/workflows/coverity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
coverity:
1414
runs-on: ubuntu-latest
15-
container: avsystemembedded/anjay-travis:ubuntu-22.04-1.1
15+
container: avsystemembedded/anjay-travis:ubuntu-22.04-2.2
1616
env:
1717
# NOTE: These need to be configured in GitHub Actions GUI
1818
COVERITY_EMAIL: ${{ secrets.COVERITY_EMAIL }}

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## 3.11.0 (September 26th, 2025)
4+
5+
### BREAKING CHANGES
6+
7+
- Default value of maximal holdoff time during Bootstrap limited from 120 sec.
8+
to 20 sec. The limit can still be changed using ANJAY_MAX_HOLDOFF_TIME define.
9+
- If the Server certificate is missing from the Data Model, Anjay falls back to
10+
PKIX verification, provided that a Trust Store is available, even when the
11+
certificate usage is set to DANE-TA or DANE-EE.
12+
- avs_commons 5.5.0 that is used by Anjay 3.11.0 stoped passing the trust store
13+
to Mbed TLS backend for Certificate Usage 2 or 3. For details on how Anjay
14+
handles Certificate Usage resource refer to
15+
Anjay Specification -> Advanced Topics -> Certificate Usage.
16+
17+
### Bugfixes
18+
19+
- Updated avs_commons to a version without a PSK-mode vulnerability in the Mbed
20+
TLS backend where a client configured for PSK could connect to a server that
21+
did not know the PSK, due to advertising non-PSK key exchange and skipping
22+
certificate verification. This issue affected only TLS 1.3 connections with
23+
Mbed TLS versions ≥ 3.6.1.
24+
For details, see: https://github.com/AVSystem/avs_commons/releases/tag/5.5.0
25+
26+
### Features
27+
- (commercial version only) Added support for configuring OSCORE Object for each
28+
Security Object in Anjay Demo.
29+
330
## 3.10.0 (May 28th, 2025)
431

532
### Features

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
cmake_minimum_required(VERSION 3.16)
99

1010
project(anjay C)
11-
set(ANJAY_VERSION "3.10.0" CACHE STRING "Anjay library version")
11+
set(ANJAY_VERSION "3.11.0" CACHE STRING "Anjay library version")
1212
set(ANJAY_BINARY_VERSION 1.0.0)
1313

1414
set(ANJAY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
@@ -94,6 +94,9 @@ set(MAX_OBSERVATION_SERVERS_REPORTED_NUMBER 0 CACHE STRING
9494
set(ANJAY_DEFAULT_SEND_FORMAT AVS_COAP_FORMAT_NONE CACHE STRING
9595
"Default value of Content-Format used in Send messages. Value AVS_COAP_FORMAT_NONE(65535) means no default value.")
9696

97+
set(MAX_HOLDOFF_TIME 20 CACHE STRING
98+
"Upper limit for the Hold Off Time for the Bootstrap connection.")
99+
97100
################# FEATURES THAT REQUIRE LIBRARY CONFIGURATION ##################
98101

99102
option(WITH_AVS_PERSISTENCE "Enable support for persisting objects data" ON)

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,17 @@ More details about OMA LwM2M: [Brief introduction to LwM2M](https://AVSystem.git
151151

152152
## Embedded operating systems ports
153153

154-
If you want to use Anjay on Zephyr OS, FreeRTOS, Azure RTOS, ESP-IDF or RPI Pico W check our demo
154+
If you want to use Anjay on Zephyr OS, FreeRTOS, Azure RTOS, or RPI Pico W check our demo
155155
applications available in other repositories:
156156
- [Anjay-zephyr-client](https://github.com/AVSystem/Anjay-zephyr-client) (uses [Anjay-zephyr](https://github.com/AVSystem/Anjay-zephyr) integration layer)
157157
- [Anjay-freertos-client](https://github.com/AVSystem/Anjay-freertos-client)
158-
- [Anjay-stm32-azurertos-client](https://github.com/AVSystem/Anjay-stm32-azurertos-client)
159-
- [Anjay-esp32-client](https://github.com/AVSystem/Anjay-esp32-client) (uses [Anjay-esp-idf](https://github.com/AVSystem/Anjay-esp-idf) integration layer)
160158
- [Anjay-pico-client](https://github.com/AVSystem/Anjay-pico-client) (uses FreeRTOS Kernel)
161159

160+
There are also archived, not actively maintained Anjay demos and integrations:
161+
- [Anjay-esp32-client](https://github.com/AVSystem/Anjay-esp32-client) (uses [Anjay-esp-idf](https://github.com/AVSystem/Anjay-esp-idf) integration layer)
162+
- [Anjay-mbedos-client](https://github.com/AVSystem/Anjay-mbedos-client) (uses [Anjay-mbedos](https://github.com/AVSystem/Anjay-mbedos) integration layer)
163+
- [Anjay-stm32-azurertos-client](https://github.com/AVSystem/Anjay-stm32-azurertos-client)
164+
162165
## Quickstart guide
163166

164167
### Dependencies

demo/demo.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
# define MAX_PATH_STRING_SIZE MAX_PATH_STRING_SIZE_WO_PREFIX
8080
#endif // ANJAY_WITH_LWM2M_GATEWAY
8181

82+
#ifdef AVS_COMMONS_NET_WITH_MBEDTLS_SSLKEYLOG
83+
# define SSLKEYLOGFILE "/tmp/sslkey.log"
84+
#endif // AVS_COMMONS_NET_WITH_MBEDTLS_SSLKEYLOG
85+
8286
static int security_object_reload(anjay_demo_t *demo) {
8387
#ifdef WITH_DEMO_USE_STANDALONE_OBJECTS
8488
standalone_security_object_purge(demo->security_obj_ptr);
@@ -154,6 +158,8 @@ static int security_object_reload(anjay_demo_t *demo) {
154158
instance.server_public_key_size = args->server_public_key_size;
155159
#ifdef ANJAY_WITH_LWM2M11
156160
instance.server_name_indication = server->sni;
161+
instance.certificate_usage =
162+
(const uint8_t *) &server->certificate_usage;
157163
#endif // ANJAY_WITH_LWM2M11
158164

159165
anjay_iid_t iid = server->security_iid;
@@ -1060,7 +1066,11 @@ int main(int argc, char *argv[]) {
10601066
close(fd);
10611067
}
10621068
#endif // WIN32
1063-
1069+
#ifdef AVS_COMMONS_NET_WITH_MBEDTLS_SSLKEYLOG
1070+
avs_stream_t *ssl_key_log_file =
1071+
avs_stream_file_create(SSLKEYLOGFILE, AVS_STREAM_FILE_WRITE);
1072+
avs_mbedtls_set_sslkeylog_stream(ssl_key_log_file);
1073+
#endif // AVS_COMMONS_NET_WITH_MBEDTLS_SSLKEYLOG
10641074
/*
10651075
* If, as a result of a single poll() more than a single line is read into
10661076
* stdin buffer, we will end up handling just a single command and then
@@ -1156,5 +1166,8 @@ int main(int argc, char *argv[]) {
11561166
demo_delete(demo);
11571167
cmdline_args_cleanup(&cmdline_args);
11581168
avs_log_reset();
1169+
#ifdef AVS_COMMONS_NET_WITH_MBEDTLS_SSLKEYLOG
1170+
avs_stream_cleanup(&ssl_key_log_file);
1171+
#endif // AVS_COMMONS_NET_WITH_MBEDTLS_SSLKEYLOG
11591172
return 0;
11601173
}

demo/demo_args.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static const cmdline_args_t DEFAULT_CMDLINE_ARGS = {
4343
.retry_timer = 0,
4444
.sequence_retry_count = 1,
4545
.sequence_delay_timer = 0,
46+
.certificate_usage = AVS_NET_SOCKET_DANE_DOMAIN_ISSUED_CERTIFICATE,
4647
#endif // ANJAY_WITH_LWM2M11
4748
},
4849
#ifdef ANJAY_WITH_BOOTSTRAP
@@ -606,8 +607,12 @@ static void print_help(const struct option *options) {
606607
#ifdef ANJAY_WITH_DOWNLOADER
607608
{ 349, "RETRY COUNT", NULL, "Number of CoAP downloader retry" },
608609
{ 350, "RETRY DELAY", NULL,
609-
"Delay (in seconds) between CoAP downloader retry" }
610+
"Delay (in seconds) between CoAP downloader retry" },
610611
#endif // ANJAY_WITH_DOWNLOADER
612+
#ifdef ANJAY_WITH_LWM2M11
613+
{ 351, "CERTIFICATE USAGE", "3",
614+
"Certificate usage to set for the last configured server" },
615+
#endif // ANJAY_WITH_LWM2M11
611616
};
612617

613618
const size_t screen_width = get_screen_width();
@@ -1016,6 +1021,9 @@ int demo_parse_argv(cmdline_args_t *parsed_args, int argc, char *argv[]) {
10161021
{"coap-downloader-retry-count", required_argument, 0, 349},
10171022
{"coap-downloader-retry-delay", required_argument, 0, 350},
10181023
#endif // ANJAY_WITH_DOWNLOADER
1024+
#ifdef ANJAY_WITH_LWM2M11
1025+
{"certificate-usage", required_argument, 0, 351},
1026+
#endif // ANJAY_WITH_LWM2M11
10191027
{ 0, 0, 0, 0 }
10201028
// clang-format on
10211029
};
@@ -2052,6 +2060,21 @@ int demo_parse_argv(cmdline_args_t *parsed_args, int argc, char *argv[]) {
20522060
break;
20532061
}
20542062
#endif // ANJAY_WITH_DOWNLOADER
2063+
#ifdef ANJAY_WITH_LWM2M11
2064+
case 351: {
2065+
if (num_servers == 0) {
2066+
demo_log(ERROR, "Undefined server. Use --server-uri/-u first");
2067+
goto finish;
2068+
}
2069+
int idx = num_servers - 1;
2070+
if (parse_u16(optarg,
2071+
&parsed_args->connection_args.servers[idx]
2072+
.certificate_usage)) {
2073+
goto finish;
2074+
}
2075+
break;
2076+
}
2077+
#endif // ANJAY_WITH_LWM2M11
20552078
case 0:
20562079
goto process;
20572080
}

demo/objects.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ typedef struct {
6868
uint32_t retry_timer;
6969
uint32_t sequence_retry_count;
7070
uint32_t sequence_delay_timer;
71+
uint16_t certificate_usage;
7172
#endif // ANJAY_WITH_LWM2M11
7273
} server_entry_t;
7374

devconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ while [ $# -gt 0 ]; do
9898
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="-DMAX_DOUBLE_STRING_SIZE=64"
9999
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="-DMAX_URI_SEGMENT_SIZE=64"
100100
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="-DMAX_URI_QUERY_SEGMENT_SIZE=64"
101+
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="-DMAX_HOLDOFF_TIME=20"
101102
;;
102103
-DDTLS_BACKEND=*)
103104
DTLS_BACKEND="${1#-DDTLS_BACKEND=}"

0 commit comments

Comments
 (0)