Skip to content

Provide a place for user-specific configuration and files #9869

Open
@irwir

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 alter mbedtls_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.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions