mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-28 00:56:22 +08:00

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 uses the same flow in x509_csr_check() and x509_csr_check_opaque(). Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>