Re: [Openvpn-devel] [PATCH] Bug-fix: segfault in dco_get_peer_stats()

2023-03-27 Thread Antonio Quartulli
Hi, On 27/03/2023 22:42, Selva Nair wrote: But this may not be the time and place for a refactor. As dco is young, I think it can mature in 2.7.. I agree on all fronts. Let's get this patch in with a minimal fix that deals with what we have. We can make this better in master. Acked-by:

Re: [Openvpn-devel] [PATCH] Bug-fix: segfault in dco_get_peer_stats()

2023-03-27 Thread Selva Nair
Hi, I should have added that as written the fault is with get_dco_peer stats(). It takes a pointer to "struct context" and dereferences a couple of layers below it. The caller has no idea what it wants to see set in c. So, until that is changed on all platforms (right now windows and linux), too

Re: [Openvpn-devel] [PATCH] Bug-fix: segfault in dco_get_peer_stats()

2023-03-27 Thread Selva Nair
On Mon, Mar 27, 2023 at 4:30 PM Antonio Quartulli wrote: > Hi, > > On 27/03/2023 19:12, selva.n...@gmail.com wrote: > > From: Selva Nair > > > >We persist peer-stats when restarting, but an early restart > >before open_tun results in a segfault in dco_get_peer_stats(). > >To

Re: [Openvpn-devel] [PATCH] Bug-fix: segfault in dco_get_peer_stats()

2023-03-27 Thread Antonio Quartulli
Hi, On 27/03/2023 19:12, selva.n...@gmail.com wrote: From: Selva Nair We persist peer-stats when restarting, but an early restart before open_tun results in a segfault in dco_get_peer_stats(). To reproduce, trigger a TLS handshake error due to lack of common protocols, for

Re: [Openvpn-devel] [PATCH] Make cert_data.h and test_cryptoapi/pkcs11.c MSVC compliant

2023-03-27 Thread Matthias Andree
Am 27.03.23 um 16:45 schrieb Selva Nair: Hi, On Mon, Mar 27, 2023 at 9:59 AM Matthias Andree wrote: Am 27.03.23 um 13:49 schrieb selva.n...@gmail.com: > From: Selva Nair > > - Do not use non-literal initializers for static objects > - Replace empty initializer {} by {0}

Re: [Openvpn-devel] [PATCH] Bug-fix: segfault in dco_get_peer_stats()

2023-03-27 Thread Gert Doering
Hi, On Mon, Mar 27, 2023 at 01:12:36PM -0400, selva.n...@gmail.com wrote: > From: Selva Nair > > We persist peer-stats when restarting, but an early restart > before open_tun results in a segfault in dco_get_peer_stats(). > To reproduce, trigger a TLS handshake error due to lack of common

[Openvpn-devel] [PATCH] Bug-fix: segfault in dco_get_peer_stats()

2023-03-27 Thread selva . nair
From: Selva Nair We persist peer-stats when restarting, but an early restart before open_tun results in a segfault in dco_get_peer_stats(). To reproduce, trigger a TLS handshake error due to lack of common protocols, for example. Fix by checking that tuntap is defined before

Re: [Openvpn-devel] [PATCH] Make cert_data.h and test_cryptoapi/pkcs11.c MSVC compliant

2023-03-27 Thread Selva Nair
Hi, On Mon, Mar 27, 2023 at 9:59 AM Matthias Andree wrote: > Am 27.03.23 um 13:49 schrieb selva.n...@gmail.com: > > From: Selva Nair > > > > - Do not use non-literal initializers for static objects > > - Replace empty initializer {} by {0} > > Should we go to a revision, I would suggest to not

Re: [Openvpn-devel] [PATCH] Make cert_data.h and test_cryptoapi/pkcs11.c MSVC compliant

2023-03-27 Thread Matthias Andree
Am 27.03.23 um 13:49 schrieb selva.n...@gmail.com: From: Selva Nair - Do not use non-literal initializers for static objects - Replace empty initializer {} by {0} Should we go to a revision, I would suggest to not make something compliant to a compiler because that is assigning it way too

Re: [Openvpn-devel] [PATCH] Make cert_data.h and test_cryptoapi/pkcs11.c MSVC compliant

2023-03-27 Thread Selva Nair
On Mon, Mar 27, 2023 at 8:09 AM Frank Lichtenheld wrote: > On Mon, Mar 27, 2023 at 07:49:37AM -0400, selva.n...@gmail.com wrote: > > From: Selva Nair > > > > - Do not use non-literal initializers for static objects > > - Replace empty initializer {} by {0} > > > > Signed-off-by: Selva Nair >

Re: [Openvpn-devel] [PATCH] Make cert_data.h and test_cryptoapi/pkcs11.c MSVC compliant

2023-03-27 Thread Frank Lichtenheld
On Mon, Mar 27, 2023 at 07:49:37AM -0400, selva.n...@gmail.com wrote: > From: Selva Nair > > - Do not use non-literal initializers for static objects > - Replace empty initializer {} by {0} > > Signed-off-by: Selva Nair > --- > To be applied after the test-pkcs11 patch set Tested MSVC build

[Openvpn-devel] [PATCH] Make cert_data.h and test_cryptoapi/pkcs11.c MSVC compliant

2023-03-27 Thread selva . nair
From: Selva Nair - Do not use non-literal initializers for static objects - Replace empty initializer {} by {0} Signed-off-by: Selva Nair --- To be applied after the test-pkcs11 patch set tests/unit_tests/openvpn/cert_data.h | 6 ++--- tests/unit_tests/openvpn/test_cryptoapi.c | 24

Re: [Openvpn-devel] [PATCH] unit_tests: make cert_data.h compile with MSVC

2023-03-27 Thread Selva Nair
On Mon, Mar 27, 2023 at 4:49 AM Frank Lichtenheld wrote: > On Fri, Mar 24, 2023 at 01:13:22PM -0400, Selva Nair wrote: > > Would the attached small patch be acceptable instead? It covers only > > test_cryptoapi --- if this will do, I can incorporate similar changes for > > test_pkcs11 into a v2

Re: [Openvpn-devel] [PATCH] unit_tests: make cert_data.h compile with MSVC

2023-03-27 Thread Frank Lichtenheld
On Fri, Mar 24, 2023 at 01:13:22PM -0400, Selva Nair wrote: > Would the attached small patch be acceptable instead? It covers only > test_cryptoapi --- if this will do, I can incorporate similar changes for > test_pkcs11 into a v2 of the relevant patch as those have not been > ACK-ed yet.

Re: [Openvpn-devel] [PATCH] unit_tests: make cert_data.h compile with MSVC

2023-03-27 Thread Frank Lichtenheld
On Fri, Mar 24, 2023 at 07:30:51PM +0100, Matthias Andree wrote: > Am 23.03.23 um 15:31 schrieb Frank Lichtenheld: > > Currently this is not obvious since we never build the > > UTs with MSVC, but it doesn't like the initializers with > > "const" variables. They cause > > error C2099: initializer

Re: [Openvpn-devel] [PATCH] unit_tests: make cert_data.h compile with MSVC

2023-03-27 Thread Frank Lichtenheld
On Fri, Mar 24, 2023 at 01:13:22PM -0400, Selva Nair wrote: > Hi, > [...] > I would like to avoid such long preprocessor #defines with continuation > lines. > > Would the attached small patch be acceptable instead? It covers only > test_cryptoapi --- if this will do, I can incorporate similar