Skip to content

xtest: add test for ECDH with invalid points - #818

Merged
jenswikl merged 1 commit into
OP-TEE:masterfrom
jenswikl:wycheproof
Jun 15, 2026
Merged

xtest: add test for ECDH with invalid points#818
jenswikl merged 1 commit into
OP-TEE:masterfrom
jenswikl:wycheproof

Conversation

@jenswikl

@jenswikl jenswikl commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Adds four subtests checking that ECDH fails when the public key is a point that is not on the correct curve, which need to be rejected to avoid invalid curve attacks. Since TEE_DeriveKey() doesn't allow returning errors the TA will panic in the correct case.

The tests use four test vectors from Wycheproof, selected in an attempt to avoid failures due to other checks that are independent of the curve check.

[JW: fixup to use ta_crypt_cmd_derive_key()]

@jenswikl

jenswikl commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Based on the attached xtest patch in GHSA-g6qf-hwf7-mg9h

@jforissier

Copy link
Copy Markdown
Contributor

Acked-by: Jerome Forissier <jerome.forissier@arm.com>

Adds four subtests checking that ECDH fails when the public key is a
point that is not on the correct curve, which need to be rejected to
avoid invalid curve attacks. Since TEE_DeriveKey() doesn't allow
returning errors the TA will panic in the correct case.

The tests use four test vectors from Wycheproof, selected in an attempt
to avoid failures due to other checks that are independent of the curve
check.

Signed-off-by: Martin Nyhus <martin@nyhus.dev>
[JW: small fixups]
Signed-off-by: Jens Wiklander <jenswi@kernel.org>
Acked-by: Jerome Forissier <jerome.forissier@arm.com>
@jenswikl

Copy link
Copy Markdown
Contributor Author

Squashed and tag applied.

@jenswikl
jenswikl merged commit 4c45ac9 into OP-TEE:master Jun 15, 2026
2 checks passed
@jenswikl
jenswikl deleted the wycheproof branch June 15, 2026 15:40
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

Successfully merging this pull request may close these issues.

3 participants