ASN.1 tests without x509 #75
No reviewers
Labels
No labels
api-spec
bug
CLA requested
CLA valid
compliance
DO NOT MERGE
duplicate
enhancement
feature branch
good first issue
HEADER FORMATTING ISSUE
help wanted
Information
invalid
Jira status: AWAITING REVIEW
Jira status: CLOSED
Jira status: DONE
Jira status: IN PROGRESS
Jira status: IN REVIEW
Jira status: OPEN
Jira status: REOPENED
Jira status: RESOLVED
mirrored
mirror internally
needs: backports
needs: ci
needs: design review
needs: preceding PR
needs: review
needs: work
notabug
open for community contribution
Product Backlog
question
ready for merge
security
stale
type: bug
type: enhancement
type: question
web pages
wontfix
writing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-ARMmbed/mbed-crypto!75
Loading…
Reference in a new issue
No description provided.
Delete branch "asn1-tests-without-x509"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add ASN.1 unit tests. Cover all functions from the asn1 parse and write modules. Fix #76.
Fix a couple of minor bugs and improve the documentation.
This PR breaks mbedtls because two test cases in
test_suite_x509_parsemake assumptions about bugs in the ASN.1 module which this PR fixes. This PR must land in mbedtls only once https://github.com/ARMmbed/mbedtls/pull/2488 is merged there.Once this PR is merged, a commented-out test case that https://github.com/ARMmbed/mbedtls/pull/2488 adds to
test_suite_x509_parse.datacan be uncommented.Backports:
Needs rebase to resolve conflicts
In general the changes look good. If I'm not mistaken some test cases are applied with incorrect arguments (see comments), plus, I've managed to notice some typos. Otherwise looks good.
@ -176,119 +176,203 @@ mbedtls_asn1_named_data;* \brief Get the length of an ASN.1 element.Typo: "lengtth"
Preexisting: Shouldn't this be "Updates to the ..."? Also, there's no period at the end of the previous line.
@ -212,2 +226,2 @@* \param end End of data* \param val The variable that will receive the value* \param p On entry, \c *p points to the start of the ASN.1 element.* On successful completion, \c *p points to the first byteI wonder if we can at least guarantee
*pto remain in the <begin, end> range. If so, the API user can e.g. dump <*p, end> for debugging purposes.@ -0,0 +1,438 @@Empty lengthAll the three
free_named_data_list()are given an argument0@ -0,0 +1,438 @@Empty lengthHaving the intended test data revealed a bug in the test code.
@ -212,2 +226,2 @@* \param end End of data* \param val The variable that will receive the value* \param p On entry, \c *p points to the start of the ASN.1 element.* On successful completion, \c *p points to the first byteWe can, but how useful is that?
*pmay be beyond the location of the error. I don't want to guarantee anything about where*pis in relation to the error. And “location of the error” may not be meaningful anyway.For debugging purposes, looking around
*pmay be helpful, but then you can see in your debugger that*ppoints somewhere inside the buffer. For logging, I don't think this is useful. So I'd rather keep it simple and flexible: it's undefined (for example, one day we may want to set*p = NULLto avoid accidentally using some misparsed data).@ -176,119 +176,203 @@ mbedtls_asn1_named_data;* \brief Get the length of an ASN.1 element.This typo is still present and should be fixed.
https://github.com/ARMmbed/mbedtls/pull/2488 has been merged, so this PR is safe to merge.
@ -176,119 +176,203 @@ mbedtls_asn1_named_data;* \brief Get the length of an ASN.1 element.Oh, I hadn't spotted it was present twice. I amended the typo-fixing commit to also fix this one.
LGTM
CI failure is only TLS's check generated files test. The generated files will be fixed when TLS updates to the new version of the Crypto submodule.