]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix loading inline tls-crypt-v2 keys with mbed TLS
authorArne Schwabe <arne@openvpn.net>
Mon, 14 Jan 2019 15:48:14 +0000 (16:48 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 16 Jan 2019 18:10:24 +0000 (19:10 +0100)
commit92a5ec31363e76e64748c4fc9aa144eefad17323
tree3a712a5840b32e679fb6b0ef50bbea8a4a9252f7
parentef4b8c972f8f4f9debf56bd1ccff7b5889b3305d
Fix loading inline tls-crypt-v2 keys with mbed TLS

Using a tls-crypt-v2 key with mbed TLS inline results in

PEM decode error: source buffer not null-terminated

This is because the mbed TLS decode PEM function excepts the last byte
in the buffer to be 0x00. When constructing the buffer we only made as
big as strlen, which does not include the 0x00 byte of a string. Add an
extra byte to ensure also the null byte is included in the buffer.
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20190114154819.6064-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18091.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tls_crypt.c