naynajain / mbedtls-1

An open source, portable, easy to use, readable and flexible SSL library
https://tls.mbed.org
Apache License 2.0
1 stars 2 forks source link

Increase PKCS7 Coverage #15

Closed nick-child-ibm closed 1 year ago

nick-child-ibm commented 1 year ago

Addresses issue #6745 .

Increase coverage of the pkcs7.c file: %lines %branches
before 85.7 68.5
now 93.5 86.5

In this pull request, I have included a script which I have used to auto generate more tests in test_suite_pkcs7.data. For every asn1 tag it adds tests to modify the length of the content and the tag type. When parsing this modified PKCS7 data buffer, it is expected to fail.

In some cases, the PKCS7 parsing functions did not pick up on the malformed asn1 data. I addressed these issues in the last commit of this pull request.

nick-child-ibm commented 1 year ago

Whoops sorry Nayna. I meant to open this on Mbedtls upstream repo.