Provide a place for user-specific configuration and files #9869
Description
Suggested enhancement
Add a directory (at the library root) for user-specific settings and files - for example, mbedtls_alt
.
Include paths in the library get additional "../.." in the project(s).
The directory contains a number of empty files as placeholders. There should be:
mbedtls_alt/mbedtls_user_config.h
,
mbedtls_alt/crypto_user_config.h
,
mbedtls_alt/threading_alt.h
... all other files corresponding to '_ALT' macros.
Justification
Users should not edit mbedtls_config.h
; all settings go to mbedtls_alt/mbedtls_user_config.h
as #define
/ #undef
directives.
The same applies to crypto_config.h
Of course, both mbedtls_alt/*_user_config.h
have to be included unconditionally (could be the last line of the corresponding *_config.h
).
Mbed TLS needs this because
library code could be treated as "read-only", user-alterable files have a separate and predefined location.
"Include" paths in projects need no modifications; just put #include
directive into the provided placeholder files.
This should simplify merging, updates and maintenance.
Currently,
MBEDTLS_USER_CONFIG_FILE
is commented out (points to null device), therefore users have to altermbedtls_config.h
;- "*_alt.h" have no specific path, hence either project has to be edited, or library and user files would make a mess in the same folders.