[Openvpn-devel] [PATCH 1/2 v3] buffer: use memcpy in buf_catrunc

2023-05-17 Thread Frank Lichtenheld
Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain that we use the output of strlen() for the length of strncpy which is usually a sign for bugs: error: ‘strncpy’ specified bound depends on the len

[Openvpn-devel] [PATCH 2/2 v2] test_buffer: add tests for buf_catrunc and its caller format_hex_ex

2023-05-17 Thread Frank Lichtenheld
Just some very basic tests. v2: - fix off-by-one Change-Id: I73fc893136387d1da05f4aea98cb37b02d6c3230 Signed-off-by: Frank Lichtenheld --- tests/unit_tests/openvpn/test_buffer.c | 62 ++ 1 file changed, 62 insertions(+) diff --git a/tests/unit_tests/openvpn/test_buffer

[Openvpn-devel] [PATCH 1/2] Introduce get_key_by_management_key_id helper function

2023-05-17 Thread Arne Schwabe
This function allows us to map from a management key id to a key structure and also allows this function to be reused. Signed-off-by: Arne Schwabe --- src/openvpn/ssl_common.h | 20 src/openvpn/ssl_verify.c | 17 +++-- 2 files changed, 27 insertions(+), 10 deleti

[Openvpn-devel] [PATCH 2/2] Fix CR_RESPONSE mangaement message using wrong key_id

2023-05-17 Thread Arne Schwabe
the management interface expects the management key id instead of the openvpn key id. In the past they often were the same for low ids which hid the bug quite well. Also do not pick uninitialised keystates (management key_id is not valid in these) and provide better logging when a key state is not

[Openvpn-devel] [PATCH 1/2 v4] buffer: use memcpy in buf_catrunc

2023-05-17 Thread Frank Lichtenheld
Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain that we use the output of strlen() for the length of strncpy which is usually a sign for bugs: error: ‘strncpy’ specified bound depends on the len

Re: [Openvpn-devel] OpenVPN Linking Exception - current status report

2023-05-17 Thread Arne Schwabe
Am 15.02.23 um 13:31 schrieb David Sommerseth: OpenVPN 2.x is licensed under the GNU Public License v2.0 (GPL-2.0). This license has served us well in the past and we are not trying to change that.  However, changes in licenses of our dependencies put us in an unfortunate situation. So a go

[Openvpn-devel] [PATCH applied] Re: test_buffer: add tests for buf_catrunc and its caller format_hex_ex

2023-05-17 Thread Gert Doering
Acked-by: Gert Doering Unit Tests are good, this function-under-test is a bit weird, and having the UTs in tree (and working) before the actual patch gives double assurance that it's still working in the same weird way :-) [ RUN ] test_buffer_printf_catrunc [ OK ] test_buffer_printf_c

[Openvpn-devel] [PATCH applied] Re: buffer: use memcpy in buf_catrunc

2023-05-17 Thread Gert Doering
Acked-by: Gert Doering Change looks good (less +/-1, so easier for my old brain), and our nice and shiny new unit test confirms that things still work. Your patch has been applied to the master branch. commit c89a97e449baaf60924a362555d35184f188a646 Author: Frank Lichtenheld Date: Wed May 17

[Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Ilya Shipitsin
malloc was not checked against NULL, I was able to get core dump in case of failure Signed-off-by: Ilya Shipitsin --- src/openvpn/dco_freebsd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index abeb..adbd1120 100644 --- a/src

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Kristof Provost
On 17 May 2023, at 16:01, Ilya Shipitsin wrote: > malloc was not checked against NULL, I was able > to get core dump in case of failure > > Signed-off-by: Ilya Shipitsin > --- > src/openvpn/dco_freebsd.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/src/openvpn/dco_freebsd.c b/src

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Antonio Quartulli
Hi, On 17/05/2023 22:01, Ilya Shipitsin wrote: malloc was not checked against NULL, I was able to get core dump in case of failure Signed-off-by: Ilya Shipitsin --- src/openvpn/dco_freebsd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Илья Шипицин
ср, 17 мая 2023 г. в 22:43, Kristof Provost : > On 17 May 2023, at 16:01, Ilya Shipitsin wrote: > > malloc was not checked against NULL, I was able > > to get core dump in case of failure > > > > Signed-off-by: Ilya Shipitsin > > --- > > src/openvpn/dco_freebsd.c | 5 + > > 1 file changed, 5

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Илья Шипицин
ср, 17 мая 2023 г. в 22:47, Antonio Quartulli : > Hi, > > On 17/05/2023 22:01, Ilya Shipitsin wrote: > > malloc was not checked against NULL, I was able > > to get core dump in case of failure > > > > Signed-off-by: Ilya Shipitsin > > --- > > src/openvpn/dco_freebsd.c | 5 + > > 1 file cha

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Kristof Provost
On 17 May 2023, at 16:58, Илья Шипицин wrote: > ср, 17 мая 2023 г. в 22:43, Kristof Provost : > >> On 17 May 2023, at 16:01, Ilya Shipitsin wrote: >>> malloc was not checked against NULL, I was able >>> to get core dump in case of failure >>> >>> Signed-off-by: Ilya Shipitsin >>> --- >>> src/open

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Илья Шипицин
ср, 17 мая 2023 г. в 23:04, Kristof Provost : > On 17 May 2023, at 16:58, Илья Шипицин wrote: > > ср, 17 мая 2023 г. в 22:43, Kristof Provost : > > > >> On 17 May 2023, at 16:01, Ilya Shipitsin wrote: > >>> malloc was not checked against NULL, I was able > >>> to get core dump in case of failure >

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Kristof Provost
On 17 May 2023, at 17:06, Илья Шипицин wrote: > ср, 17 мая 2023 г. в 23:04, Kristof Provost : > >> On 17 May 2023, at 16:58, Илья Шипицин wrote: >>> ср, 17 мая 2023 г. в 22:43, Kristof Provost : >>> On 17 May 2023, at 16:01, Ilya Shipitsin wrote: > malloc was not checked against NULL, I wa

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Antonio Quartulli
Hi, On 17/05/2023 23:10, Kristof Provost wrote: On 17 May 2023, at 17:06, Илья Шипицин wrote: ср, 17 мая 2023 г. в 23:04, Kristof Provost : On 17 May 2023, at 16:58, Илья Шипицин wrote: ср, 17 мая 2023 г. в 22:43, Kristof Provost : On 17 May 2023, at 16:01, Ilya Shipitsin wrote: malloc wa

Re: [Openvpn-devel] [PATCH] src/openvpn/dco_freebsd.c: handle malloc failure

2023-05-17 Thread Gert Doering
Hi, On Wed, May 17, 2023 at 04:43:01PM -0400, Kristof Provost wrote: > Fwiw: I usually don???t bother handling malloc failure in userspace, > because modern systems all overallocate anyway, so the first thing > you know about lack of memory is the out-of-memory killer terminating > you. It???s a p