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

More test coverage #126

Merged
merged 4 commits into from Oct 10, 2019
Merged

More test coverage #126

merged 4 commits into from Oct 10, 2019

Conversation

tomato42
Copy link
Member

@tomato42 tomato42 commented Oct 6, 2019

Uplift the test coverage from #124 to master
deprecate some unused methods
clean-up raised exceptions

@tomato42 tomato42 added the maintenance issues related to making the project usable or testable label Oct 6, 2019
@coveralls
Copy link

coveralls commented Oct 6, 2019

Coverage Status

Coverage increased (+3.6%) to 92.307% when pulling 83dab29 on tomato42:more-test-coverage into 3365968 on warner:master.

leftover after compressed points implementation
since MalformedPointError and UnexpectedDER are user-visible (thrown
by methods that users are expected to use), export them in the root
of the module hierarchy
as assert will be optimised out if the module is compiled with
optimisations on, we can't use them for checking user-provided data

use an exception that inherits from it, so that existing code will
behave as expected
There are few pure-maths methods that are unused by the library code,
mark them deprecated so that we can remove them in the future
@tomato42
Copy link
Member Author

@ueno: please review

Copy link

@ueno ueno left a comment

Choose a reason for hiding this comment

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

Looks good to me.

assert len(xs) == curve.baselen, (len(xs), curve.baselen)
assert len(ys) == curve.baselen, (len(ys), curve.baselen)
if len(xs) != curve.baselen:
raise MalformedPointError("Unexpected length of encoded x")
Copy link

Choose a reason for hiding this comment

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

wouldn't it be a bit friendly that the actual length is embedded in the message?

Copy link
Member Author

@tomato42 tomato42 Oct 10, 2019

Choose a reason for hiding this comment

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

the problem is that we support 3 different lengths: for raw encoding, uncompressed X9.62 and compressed X9.62 so the message would be very confusing if we provided so much data.

And those two checks will get triggered only when the Curve we use is misconstructed, so they are more asserts than real checks

@tomato42 tomato42 merged commit 1db6b3c into tlsfuzzer:master Oct 10, 2019
@tomato42 tomato42 deleted the more-test-coverage branch October 10, 2019 16:33
@tomato42 tomato42 added this to the v0.14 milestone Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance issues related to making the project usable or testable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants