-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Backport 2.16: Add DER encoded test CRTs to library/certs.c #2497
Backport 2.16: Add DER encoded test CRTs to library/certs.c #2497
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a faithful backport of the base PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still a conflict in certs.c to be resolved.
b565703
to
6408fdd
Compare
@k-stachowiak Could you please re-review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a faithful backport.
@AndrzejKurek Could you please re-review this, too? |
Shouldn't we resolve the changelog conflict to let CI pass (now with the new after-merge tests)? |
6408fdd
to
cd4ea1b
Compare
@AndrzejKurek @k-stachowiak Could you please re-review the recent rebase? |
cd4ea1b
to
6e03706
Compare
@AndrzejKurek @k-stachowiak Could you please re-review? |
This allows to test PSK-based ciphersuites via ssl_client2 in builds which have MBEDTLS_X509_CRT_PARSE_C enabled but both MBEDTLS_FS_IO and MBEDTLS_CERTS_C disabled. A similar change is applied to the `crt_file` and `key_file` arguments.
This allows to test PSK-based ciphersuites via ssl_server2 in builds which have MBEDTLS_X509_CRT_PARSE_C enabled but both MBEDTLS_FS_IO and MBEDTLS_CERTS_C disabled.
All of them are copied from (former) CRT and key files in `tests/data_files`. For files which have been regenerated since they've been copied to `certs.c`, update the copy. Add declarations for DER encoded test CRTs to certs.h Add DER encoded versions of CRTs to certs.c fix comment in certs.c Don't use (signed) char for DER encoded certificates Consistently use `const char *` for test CRTs regardless of encoding Remove non-sensical and unused PW variable for DER encoded key Provide test CRTs in PEM and DER fmt, + pick suitable per config This commit modifies `certs.h` and `certs.c` to start following the following pattern for the provided test certificates and files: - Raw test data is named `NAME_ATTR1_ATTR2_..._ATTRn` For example, there are `TEST_CA_CRT_{RSA|EC}_{PEM|DER}_{SHA1|SHA256}`. - Derived test data with fewer attributes, iteratively defined as one of the raw test data instances which suits the current configuration. For example, `TEST_CA_CRT_RSA_PEM` is one of `TEST_CA_CRT_RSA_PEM_SHA1` or `TEST_CA_CRT_RSA_PEM_SHA256`, depending on whether SHA-1 and/or SHA-256 are defined in the current config. Add missing public declaration of test key password Fix signedness and naming mismatches Further improve structure of certs.h and certs.c Fix definition of mbedtls_test_cas test CRTs depending on config Remove semicolon after macro string constant in certs.c
This should allow to run ssl-opt.sh successfully in the default configuration minus MBEDTLS_PEM_PARSE_C minus MBEDTLS_FS_IO.
This allows to auto-generate them from scripts.
cd01e61
to
9582a47
Compare
@AndrzejKurek @k-stachowiak I updated the backport to reflect the current state of #2260 - could you please re-review? |
This is the backport of #2260 to Mbed TLS 2.16.