MbedTLS compatibility issue with v<2.28
Following merge of #1130 (closed) there are 2 incompatibilities with FreeRTOS build:
- PRIu32 is not compatible with enums. (
pki_stack.c
) - in v < 2.28 of MBEDTLS, there are no implementation for
mbedtls_x509_parse_subject_alt_name
. When using FreeRTOS, the MbedTLS version is not configurable and on STMCube IDE v1.10 (e.g.), the version is fixed to v2.16
Moreover, some code should be reworked (pki_stack.c):
- In
check_host_name
pHostName is not checked after call toSOPC_Helper_URI_SplitUri
- In
check_host_name
: Malloc and copy in loop are useless and particularly inefficient. Directly useSOPC_strncmp_ignore_case
and use"%.*s"
in formatted log to get a dynamic-length string output.
Edited by Jérémie Chabod