a9f64006ea
Problem ------- mbedtls_strerror is a utility function which converts an mbedTLS error code into a human readable string. It requires the caller to allocate a buffer every time an error code needs to be converted to a string. It is an overkill and a waste of RAM for resource constrained microcontrollers - where the most common use case is to use these strings for logging. Solution -------- The proposed commit adds two functions: * const char * mbedtls_high_level_strerr( int error_code ); * const char * mbedtls_low_level_strerr( int error_code ); The above two functions convert the high level and low level parts of an mbedTLS error code to human readable strings. They return a const pointer to an unmodifiable string which is not supposed to be modified by the caller and only to be used for logging purposes. The caller no longer needs to allocate a buffer. Backward Compatibility ---------------------- The proposed change is completely backward compatible as it does not change the existing mbedtls_strerror function and ensures that it continues to behave the same way. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> |
||
---|---|---|
.. | ||
data_files | ||
abi_check.py | ||
apidoc_full.sh | ||
assemble_changelog.py | ||
bump_version.sh | ||
config.pl | ||
config.py | ||
ecc-heap.sh | ||
find-mem-leak.cocci | ||
footprint.sh | ||
generate_errors.pl | ||
generate_features.pl | ||
generate_psa_constants.py | ||
generate_query_config.pl | ||
generate_visualc_files.pl | ||
massif_max.pl | ||
memory.sh | ||
output_env.sh | ||
rename.pl | ||
rm-calloc-cast.cocci | ||
tmp_ignore_makefiles.sh |