diff --git a/.clang-tidy b/.clang-tidy index 415c2fa..7494ee1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -6,7 +6,6 @@ WarningsAsErrors: 'misc-const-correctness,modernize-use-default-member-init,cppc # do not match smp.hpp # all other headers are *.h HeaderFilterRegex: '.*\.h$' -AnalyzeTemporaryDtors: false FormatStyle: file CheckOptions: hicpp-move-const-arg.CheckMoveToConstRef: 'true' diff --git a/ci/build_for_pc.sh b/ci/build_for_pc.sh index 7c11987..077b803 100755 --- a/ci/build_for_pc.sh +++ b/ci/build_for_pc.sh @@ -11,6 +11,6 @@ ninja cd .. mkdir build_clang cd build_clang -CC=clang-20 CXX=clang++-20 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE +CC=clang-21 CXX=clang++-21 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE ninja cd .. diff --git a/ci/check_codestyle.sh b/ci/check_codestyle.sh index 9c0038e..73e7602 100755 --- a/ci/check_codestyle.sh +++ b/ci/check_codestyle.sh @@ -4,4 +4,4 @@ set -eo pipefail -ci/run-clang-format.py --clang-format-executable clang-format-20 -r main/ components/ native/ +ci/run-clang-format.py --clang-format-executable clang-format-21 -r main/ components/ native/ diff --git a/ci/static_code_analysis.sh b/ci/static_code_analysis.sh index 42a26f6..68ed5d1 100755 --- a/ci/static_code_analysis.sh +++ b/ci/static_code_analysis.sh @@ -6,6 +6,6 @@ set -eo pipefail mkdir build_clang cd build_clang -CC=clang-20 CXX=clang++-20 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON +CC=clang-21 CXX=clang++-21 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -run-clang-tidy-20.py -clang-tidy-binary clang-tidy-20 +run-clang-tidy-21.py -clang-tidy-binary clang-tidy-21 diff --git a/components/sip_client/include/sip_client/mbedtls_md5.h b/components/sip_client/include/sip_client/mbedtls_md5.h index 7a00e27..a6d4b95 100644 --- a/components/sip_client/include/sip_client/mbedtls_md5.h +++ b/components/sip_client/include/sip_client/mbedtls_md5.h @@ -16,19 +16,17 @@ #pragma once -#include "mbedtls/md5.h" +#include "psa/crypto.h" class MbedtlsMd5 { public: - MbedtlsMd5() - { - mbedtls_md5_init(&m_ctx); - } + MbedtlsMd5() = default; ~MbedtlsMd5() { - mbedtls_md5_free(&m_ctx); + psa_status_t status = psa_hash_abort(&operation); + assert(status == PSA_SUCCESS); } MbedtlsMd5(const MbedtlsMd5&) = delete; @@ -38,19 +36,24 @@ class MbedtlsMd5 void start() { - mbedtls_md5_starts(&m_ctx); + psa_status_t status = psa_hash_setup(&operation, PSA_ALG_MD5); + assert(status == PSA_SUCCESS); } void update(const std::string& input) { - mbedtls_md5_update(&m_ctx, reinterpret_cast(input.c_str()), input.size()); + psa_status_t status = psa_hash_update(&operation, reinterpret_cast(input.c_str()), input.size()); + assert(status == PSA_SUCCESS); } void finish(std::array& hash) { - mbedtls_md5_finish(&m_ctx, hash.data()); + size_t hash_len; + psa_status_t status = psa_hash_finish(&operation, hash.data(), hash.size(), &hash_len); + assert(status == PSA_SUCCESS); + assert(hash_len == hash.size()); } private: - mbedtls_md5_context m_ctx {}; + psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT; }; diff --git a/components/web_server/CMakeLists.txt b/components/web_server/CMakeLists.txt index 6111e36..521048f 100644 --- a/components/web_server/CMakeLists.txt +++ b/components/web_server/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register(INCLUDE_DIRS "include" - REQUIRES esp_http_server json app_update + REQUIRES esp_http_server app_update PRIV_REQUIRES sip_client EMBED_FILES index.html ) diff --git a/docker/Dockerfile b/docker/Dockerfile index 14cf155..6e77cb1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM espressif/idf:release-v5.5 +FROM espressif/idf:release-v6.0 ARG DEBIAN_FRONTEND=noninteractive diff --git a/docker/run-docker.sh b/docker/run-docker.sh index b842d1f..b298ec3 100755 --- a/docker/run-docker.sh +++ b/docker/run-docker.sh @@ -22,14 +22,14 @@ apt-get update \ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - -echo deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-20 main > /etc/apt/sources.list.d/llvm.list +echo deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-21 main > /etc/apt/sources.list.d/llvm.list wget https://github.com/chriskohlhoff/asio/archive/asio-1-32-0.tar.gz -O /tmp/asio-1-32-0.tar.gz tar -C /usr/include --strip-components=3 -x -f /tmp/asio-1-32-0.tar.gz asio-asio-1-32-0/asio/include/ apt-get update \ - && apt-get install -y clang-20 \ - clang-format-20 \ - clang-tidy-20 \ + && apt-get install -y clang-21 \ + clang-format-21 \ + clang-tidy-21 \ && rm -rf /var/lib/apt/lists/* diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index b32c1ee..e2450d7 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,9 +1,8 @@ idf_component_register(SRCS ./main.cpp REQUIRES driver esp_netif esp_wifi mbedtls - nvs_flash sip_client web_server) - + nvs_flash sip_client web_server #INCLUDE_DIRS include # Edit following two lines to set component requirements (see docs) # REQUIRES ) -# PRIV_REQUIRES ) + PRIV_REQUIRES esp_driver_gpio) target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++17) diff --git a/main/idf_component.yml b/main/idf_component.yml index 8645619..da94156 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,9 +1,9 @@ ## IDF Component Manager Manifest File dependencies: - espressif/mdns: "^1.9.1" + espressif/mdns: ^1.9.1 ## Required IDF version idf: - version: ">=5.5.2" + version: '>=6.0' # # Put list of dependencies here # # For components maintained by Espressif: # component: "~1.0.0" @@ -15,3 +15,4 @@ dependencies: # # `public` flag doesn't have an effect dependencies of the `main` component. # # All dependencies of `main` are public by default. # public: true + espressif/cjson: ^1.7.19~1