mbedtls/scripts
Gaurav Aggarwal a9f64006ea Add support for const error description strings
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>
2020-04-09 01:44:52 -07:00
..
data_files Add support for const error description strings 2020-04-09 01:44:52 -07:00
abi_check.py Change worktree_rev to HEAD for rev-parse 2019-07-25 14:33:33 +01:00
apidoc_full.sh Invoke config.py instead of config.pl 2019-11-13 14:33:33 +00:00
assemble_changelog.py Clarify extract_top_version when creating a new section 2020-03-30 11:37:26 +02:00
bump_version.sh Revert "Only build libmbedcrypto" 2020-03-19 14:07:55 +01:00
config.pl If python3 fails, make it clear that this isn't fatal 2019-11-26 13:30:16 +01:00
config.py Merge mbed-crypto into mbedtls: the merge commit 2020-03-23 17:54:46 +01:00
ecc-heap.sh Invoke config.py instead of config.pl 2019-11-13 14:33:33 +00:00
find-mem-leak.cocci Remove malloc references in mbedtls/scripts 2017-07-06 10:34:12 +01:00
footprint.sh Revert "config: Remove TLS and NET options" 2020-03-19 13:55:04 +01:00
generate_errors.pl Add support for const error description strings 2020-04-09 01:44:52 -07:00
generate_features.pl revert changes to generate_features.pl and generate_query_config.pl 2019-04-12 09:43:04 -04:00
generate_psa_constants.py Change key types to a 16-bit encoding 2020-01-31 10:24:21 +01:00
generate_query_config.pl query_config: Move to programs/test 2020-02-11 19:26:27 +01:00
generate_visualc_files.pl Tweak spacing in Visual Studio files 2020-02-26 14:37:17 +01:00
massif_max.pl Use "#!/usr/bin/env perl" as shebang line. 2018-04-04 21:44:29 +00:00
memory.sh Invoke config.py instead of config.pl in reverted content 2020-03-19 14:23:45 +01:00
output_env.sh Revert "Remove tests that depend on TLS or X.509" 2020-03-19 14:17:54 +01:00
rename.pl Use "#!/usr/bin/env perl" as shebang line. 2018-04-04 21:44:29 +00:00
rm-calloc-cast.cocci Remove malloc references in mbedtls/scripts 2017-07-06 10:34:12 +01:00
tmp_ignore_makefiles.sh Ability to ignore changes to Makefiles due to CMake usage 2014-06-24 11:09:25 +02:00