Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mishandling of native EC key when using ECDH algorithms #137

Open
BrianSipos opened this issue Feb 12, 2024 · 0 comments
Open

Mishandling of native EC key when using ECDH algorithms #137

BrianSipos opened this issue Feb 12, 2024 · 0 comments

Comments

@BrianSipos
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant