Skip to content

Invasive testing strategy #3121

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

Conversation

gilles-peskine-arm
Copy link
Contributor

Documentation only. Explore potential strategies for invasive testing. Formulate some rules and guideline. Succinctly describe some solutions.

This is a proposal submitted for discussion.

I deliberately included solutions with “TODO” in them for things that we should do, but aren't doing yet. This pull request was originally submitted at ARMmbed/mbed-crypto#251; TLS will require further consideration.

I've changed headers to define macros mentioned explicitly in the strategy document so that one can start implementing parts of the strategy based on this PR. But implementing the proposed strategy is out of scope of this PR.

Evaluate possible approaches for invasive testing.

State some rules.

This commit was originally written for Mbed Crypto only.

Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
Clarify that using a header in library/ rather than include/ for
internal functions is a rule, not just a possibility.

As suggested by Manuel, state a rule for functions that need to be
static for best optimization but that we want to unit-test.

Signed-off-by: Gilles Peskine <[email protected]>
When this option is enabled, the product includes additional
interfaces that enable additional tests. This option should not be
enabled in production, but is included in the "full" build to enable
the extra tests.

Signed-off-by: Gilles Peskine <[email protected]>
Define MBEDTLS_STATIC_TESTABLE to mark code that is only exported for
test purposes. Since this is for internal library
use only, define it in a header in library/. Since there is no
suitable header, create one.

Signed-off-by: Gilles Peskine <[email protected]>
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.

I'm generally very happy with the document, and only have a few have editorial comments - though the document is already quite easy to read and well-structured, I think we can still improve on it.

In particular, I'm approving the design.

@gilles-peskine-arm
Copy link
Contributor Author

Thank you for reading this in detail! I've addressed your comments.

@gilles-peskine-arm gilles-peskine-arm requested a review from mpg May 11, 2020 21:11
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.

Thanks for addressing my comments. I'm happy with the result.

Copy link
Contributor

@yanesca yanesca left a comment

Choose a reason for hiding this comment

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

Excellent work, I like it very much!

@yanesca yanesca 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 Jun 2, 2020
@yanesca
Copy link
Contributor

yanesca commented Jun 2, 2020

CI is passing, it just did not notify github for some reason.

@yanesca
Copy link
Contributor

yanesca commented Jun 2, 2020

This is a proposal submitted for discussion.

@gilles-peskine-arm You mentioned that this might not be the case anymore and we should merge this. Am I remembering well, should we merge this?

@gilles-peskine-arm
Copy link
Contributor Author

@yanesca Since I made this PR, we've had a few internal discussions and everyone has had an opportunity to speak up, both in the 2019 and the 2020 team. So I do want to merge this, and start using common.h and MBEDTLS_TEST_HOOKS in new code. The rules are of course not immutable and anyone who disagrees is free to propose a change.

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 needs-design-approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants