mbedtls
mbedtls copied to clipboard
Crash in test suite x509write config full no seedfile
Description
Steps to reproduce:
find . -name seedfile -exec rm {} +
scripts/config.py config full
(cd tests && make test_suite_x509write && ./test_suite_x509write)
Observed behaviour: the first few tests fail, then eventually there's a bus error and a core dump is produced. If we just add the seedfile again (dd if=/dev/urandom of=./tests/seedfile bs=64 count=1) everything passes and there is no crash.
Cause:
When USE_PSA_INIT() failed because lack of seedfile, mbedtls_x509write_csr_free()
crashed when called on an unitialized mbedtls_x509write_csr struct.
This moves mbedtls_x509write_csr_init before calling USE_PSA_INIT(),
which could probably fail, and use the same flow in x509_csr_check()
and x509_csr_check_opaque().
Resolves #6100
Gatekeeping note: I (mpg) think this should be backported to 2.28, but does not deserve a ChangeLog entry, as the bug is only in test code.
Status
READY
Requires Backporting
NO
Migrations
NO
Additional comments
N/A
Todos
- [ ] Tests
Steps to test or reproduce
test_suite_x509write must not crash without a seedfile
Aw, this now has a conflict and will need to be rebased when you come back.
Note: I think this should be backported to 2.28, but does not deserve a ChangeLog entry, as the bug is only in test code.
This one needs to be rebased.
Rebased on development to fix merge conflict
@superna9999 Please create a backport to 2.28 so that we can merge this.