Suggested enhancement
The entire set of MBEDTLS_ERR_PK_ error codes seem to go completely unhandled in mbedtls_strerror(), specifically mbedtls_high_level_strerr().
It is easy to get one though, e.g., through
int ret = mbedtls_x509_crt_parse_file(&srv_cert, config->server_cert_file);
if (ret != 0) {
char error_buf[128];
mbedtls_strerror(ret, error_buf, sizeof(error_buf));
puts(error_buf);
}
Returns MBEDTLS_ERR_PK_FILE_IO_ERROR (-0x3e00) when the file doesn't exist. Feeding that into mbedtls_strerror() returns an "error message" of
UNKNOWN ERROR CODE (3E00)
Not helpful at all.
Justification
Mbed TLS needs this because all MBEDTLS_ERR_ codes that have a numerical value should be meaningfully decoded by mbedtls_strerror(). That's even what #9925 says.
Suggested enhancement
The entire set of
MBEDTLS_ERR_PK_error codes seem to go completely unhandled inmbedtls_strerror(), specificallymbedtls_high_level_strerr().It is easy to get one though, e.g., through
Returns
MBEDTLS_ERR_PK_FILE_IO_ERROR(-0x3e00) when the file doesn't exist. Feeding that intombedtls_strerror()returns an "error message" ofNot helpful at all.
Justification
Mbed TLS needs this because all
MBEDTLS_ERR_codes that have a numerical value should be meaningfully decoded bymbedtls_strerror(). That's even what #9925 says.