Skip to content

fix: support Mbed TLS 2.28 alongside 3.x - #30

Open
tutan0558 wants to merge 1 commit into
Metrohan:mainfrom
tutan0558:fix/mbedtls-2.28-compat
Open

tutan0558 wants to merge 1 commit into
Metrohan:mainfrom
tutan0558:fix/mbedtls-2.28-compat

Conversation

@tutan0558

Copy link
Copy Markdown

Summary

  • Select the SHA-256/SHA-512 APIs with MBEDTLS_VERSION_NUMBER: use the _ret functions on Mbed TLS 2.x and preserve the existing functions on 3.x.
  • Keep the existing min_tls_version/max_tls_version calls on 3.x and use the corresponding 2.x API only on older versions.
  • Enlarge the SHA-512 digest buffer to 64 bytes.
  • Try MbedTLSConfig.cmake first. Add the pkg-config-based FindMbedTLS.cmake only as a fallback for distributions such as Deepin 25.3 that provide pkg-config metadata but no CMake package config.
  • Apply the same compatibility changes to the userspace and libfprint copies of the GXFP sources.

Testing

Tested locally on Deepin 25.3.0 with Mbed TLS 2.28.8:

  • cmake -S userspace -B build/userspace -DCMAKE_BUILD_TYPE=Release
  • cmake --build build/userspace -j2
  • ctest --test-dir build/userspace --output-on-failure — 1/1 passed
  • GXFP-only libfprint Meson build — succeeded
  • meson test -C build/libfprint --print-errorlogs — 5 passed, 20 skipped by the existing build configuration
  • A separate configure with a test MbedTLSConfig.cmake confirmed that the config package is selected before the pkg-config fallback.

I could only test Mbed TLS 2.28 locally. The 3.x path is intentionally unchanged and should be covered by the existing Arch CI build.

Related: #26

Select the SHA and TLS version APIs using MBEDTLS_VERSION_NUMBER so the existing 3.x path remains unchanged. Try the upstream CMake config first and fall back to pkg-config only when it is unavailable. Apply the same changes to both GXFP source copies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant