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

2.28 only: tests/test_suite_ecp: Fix ECP group compare test #7907

Merged

Conversation

gowthamsk-arm
Copy link
Contributor

@gowthamsk-arm gowthamsk-arm commented Jul 11, 2023

Description

ECP group compare function should not check the value of T. We only need to assert the value of T after the ECP group copy function is called.

Relates to #6707.

PR checklist

Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")

  • changelog: Not needed as this is a test data
  • backport: This applies only to mbedtls-2.28
  • tests: Provided

Notes for the submitter

Please refer to the contributing guidelines, especially the
checklist for PR contributors.

@gowthamsk-arm gowthamsk-arm self-assigned this Jul 11, 2023
@gowthamsk-arm gowthamsk-arm added priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) labels Jul 11, 2023
mpg
mpg previously approved these changes Jul 11, 2023
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@tgonzalezorlandoarm tgonzalezorlandoarm self-requested a review July 11, 2023 09:29
Copy link
Contributor

@tgonzalezorlandoarm tgonzalezorlandoarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@gowthamsk-arm gowthamsk-arm marked this pull request as ready for review July 11, 2023 13:10
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this still doesn't look right.

@@ -64,9 +64,6 @@ inline static int mbedtls_ecp_group_cmp(mbedtls_ecp_group *grp1,
if (grp1->T_size != grp2->T_size) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we comparing T_size but not T? Doesn't T_size also depend on the state of the group structure? (AFAICT from reading ecp.c, it does.)

On a related note, please add a comment explaining why we are not comparing T here.

Copy link
Contributor Author

@gowthamsk-arm gowthamsk-arm Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does. I missed T_size here. Will update it and add a comment. :)

ECP group compare function should not check the value of T. We only need
to assert the value of T after the ECP group copy function is called.

Signed-off-by: Gowtham Suresh Kumar <[email protected]>
@gowthamsk-arm gowthamsk-arm force-pushed the fix_ecp_group_compare branch from 24a1b36 to 21f2b7a Compare July 12, 2023 12:59
@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members, and removed needs-work labels Jul 12, 2023
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@tgonzalezorlandoarm tgonzalezorlandoarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gowthamsk-arm gowthamsk-arm added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members, labels Jul 12, 2023
@gilles-peskine-arm gilles-peskine-arm changed the title tests/test_suite_ecp: Fix ECP group compare test 2.28 only: tests/test_suite_ecp: Fix ECP group compare test Jul 13, 2023
@gilles-peskine-arm
Copy link
Contributor

The task requires both a PR to development and a PR to 2.28, but they're going to be very different, so there's no reason to wait until development is ready, we can merge the 2.28 PR independently.

@gilles-peskine-arm gilles-peskine-arm merged commit 4e73afe into Mbed-TLS:mbedtls-2.28 Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants