mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-07 22:27:01 -04:00

Exporting an asymmetric key only worked if the target buffer had exactly the right size, because psa_export_key uses mbedtls_pk_write_key_der or mbedtls_pk_write_pubkey_der and these functions write to the end of the buffer, which psa_export_key did not correct for. Fix this by moving the data to the beginning of the buffer if necessary. Add non-regression tests.