Skip to content

mbedtls: TLS 1.2 premaster sized from dummy ECP_MAX_BITS when p256-m serves P-256 #10

Open

Description

@tyeth

Upstream target: zephyrproject-rtos/zephyr (mbedTLS integration) / Mbed-TLS/mbedtls

With p256-m providing P-256 and no ECP module enabled, mbedTLS sizes the TLS 1.2 ECDHE premaster buffer from a dummy ECP_MAX_BITS of 1 — sizeof(premaster) is literally 1 in the DWARF. psa_raw_key_agreement() then fails with PSA_ERROR_BUFFER_TOO_SMALL, which reaches the application as a bare OSError 138 during the handshake.

Turning p256-m off restores a 32-byte premaster and handshakes complete.

Found while making TLS work on CYW43439 boards; downstream fix in tyeth/circuitpython#21.

Filed here so it can be raised upstream; not yet submitted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions