Description
Is your enhancement proposal related to a problem? Please describe.
The configuration option CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT
is misleading as it claims to enable support for PEM format. In reality, it only enables support for parsing PEM files but leaves PEM writing disabled.
Describe the solution you'd like
A simple solution would be to enable PEM writing with the same option.
This could be done by adding the #define MBEDTLS_PEM_WRITE_C
line in the config-tls-generic.h
file together with the already present #define MBEDTLS_PEM_PARSE_C
.
zephyr/modules/mbedtls/configs/config-tls-generic.h
Lines 378 to 382 in 0d0c5af
Describe alternatives you've considered
Otherwise, CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT
could be changed to a more meaningful name, such as
CONFIG_MBEDTLS_PEM_PARSE_C
. Then a separate option could be added to write the PEM format. Something like CONFIG_MBEDTLS_PEM_WRITE_C
.
Those names could be more explicative as CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT
implies support for a certificate format, while PEM files can also be keys or certificate signing requests.