Skip to content

Mishandling of native EC key when using ECDH algorithms #137

@BrianSipos

Description

@BrianSipos

Within ECDH_ComputeSecret() the use of ECKey_From() happens after the first switch block, which means that switch logic referenced below assumes that the provided key is from a CBOR decoding and not a native mbedtls key. If the key is infact a native mbedtls key the cn_cbor_mapget_int() will fail and the function will exit early even though the key is present.

p = cn_cbor_mapget_int(pKeyPublic->m_cborKey, COSE_Key_EC_Curve);

Instead of switching on the CBOR content, the ECKey_From() should happen first (as is the case in other processing functions) and the switch can use the mbedtls key member useKey->grp.id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions