Skip to content

Some error codes unhandled in mbedtls_strerror #10768

Description

@maxgerhardt-phy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcomponent-platformPortability layer and build scriptssize-xsEstimated task size: extra small (a few hours at most)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status
    Status
    Triage in

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions