cron2 has uploaded a new patch set (#2) to the change originally created by MaxF. ( http://gerrit.openvpn.net/c/openvpn/+/1701?usp=email )
The following approvals got outdated and were removed: Code-Review+2 by cron2, Code-Review+2 by plaisthos Change subject: Null-terminate tls-crypt client keys when testing ...................................................................... Null-terminate tls-crypt client keys when testing After generating a tls-crypt-v2 client key, OpenVPN will try to load the generated key to verify that it was generated correctly. If the client key is not written to disk but printed out on the command line, the PEM encoded key is stored in memory and read_pem_key_file is called with key_file_inline = true. However, this key is not a null-terminated string, so we end up calling strlen on a buffer that isn't null-terminated. This commit adds a null-byte at the end of the key. Change-Id: I2ca8bf90a796f2b757c2fde0ae24468ef3abc3b5 Signed-off-by: Max Fillinger <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1701 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg37116.html Signed-off-by: Gert Doering <[email protected]> --- M src/openvpn/tls_crypt.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/01/1701/2 diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c index e91f80c..8c3d722 100644 --- a/src/openvpn/tls_crypt.c +++ b/src/openvpn/tls_crypt.c @@ -758,9 +758,10 @@ if (!filename || streq(filename, "")) { - printf("%.*s\n", BLEN(&client_key_pem), BPTR(&client_key_pem)); + buf_null_terminate(&client_key_pem); client_file = (const char *)BPTR(&client_key_pem); client_inline = true; + printf("%s\n", client_file); } else if (!buffer_write_file(filename, &client_key_pem)) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1701?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I2ca8bf90a796f2b757c2fde0ae24468ef3abc3b5 Gerrit-Change-Number: 1701 Gerrit-PatchSet: 2 Gerrit-Owner: MaxF <[email protected]> Gerrit-Reviewer: cron2 <[email protected]> Gerrit-Reviewer: plaisthos <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
