mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 08:05:37 +01:00
557b8d663a
In order to remove large buffers from the stack, the der data is written into the same buffer that the pem is eventually written into, however although the pem data is zero terminated, there is now data left in the buffer after the zero termination, which can cause mbedtls_x509_crt_parse to fail to parse the same buffer if passed back in. Patches also applied to mbedtls_pk_write_pubkey_pem, and mbedtls_pk_write_key_pem, which use similar methods of writing der data to the same buffer, and tests modified to hopefully catch any future regression on this. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
7 lines
322 B
Plaintext
7 lines
322 B
Plaintext
Bugfix
|
|
* In PEM writing functions, fill the trailing part of the buffer with null
|
|
bytes. This guarantees that the corresponding parsing function can read
|
|
the buffer back, which was the case for mbedtls_x509write_{crt,csr}_pem
|
|
until this property was inadvertently broken in Mbed TLS 2.19.0.
|
|
Fixes #3682.
|