[Openvpn-devel] [PATCH applied] Re: Bugfix: dangling pointer passed to pkcs11-helper

2023-05-10 Thread Gert Doering
Acked-by: Gert Doering The patch itself looks trivial ("just move the structure to the outer scope"). The interesting bit is "why" :-) - "set_pss_params()" is harmless (it just fills the data in the structure), but then mech.pParameter is set to &pss_params, and *this* is passed to pkcs11h_certi

[Openvpn-devel] [PATCH 1/3] Various fixes for -Wconversion errors

2023-05-10 Thread Frank Lichtenheld
These are all fixes I considered "safe". They either - Have sufficient checks/shifts for a cast to be safe - Fix the type of a variable without requiring code changes - Are in non-critical unittest code Change-Id: I6818b153bdeb1eed65870af99b0531e95807fe0f Signed-off-by: Frank Lichtenheld --- sr

[Openvpn-devel] [PATCH 3/3] mss/mtu: make all size calculations use size_t

2023-05-10 Thread Frank Lichtenheld
Half of them used unsigned int, the other half size_t. Standardize on one. Could've also standardized on the other, both are much too big for the expected numbers anyway. Add a new utility function clamp_size_to_int for cases we need to change from size_t to int (there are a lot of those all over

[Openvpn-devel] [PATCH 2/3] Change type of frame.mss_fix to uint16_t

2023-05-10 Thread Frank Lichtenheld
Since in the end this always ends up as an uint16_t anyway, just make the conversion much earlier. Cleans up the code and removes some -Wconversion warnings. Change-Id: Id8321dfbb8ad8d79f4bb2a9da61f8cd6b6c6ee26 Signed-off-by: Frank Lichtenheld --- src/openvpn/mss.c | 21 +++--

[Openvpn-devel] [PATCH 0/3] Some misc -Wconversion fixes

2023-05-10 Thread Frank Lichtenheld
In the context of the CMake patchset Lev and I discussed lowering the warning level for the MSVC builds since there are so many conversion warnings they drown out everything else. So I actually tried what happens when you build with -Wconversion on Linux and whether it would be possible to resolve

Re: [Openvpn-devel] [PATCH 2/3] Change type of frame.mss_fix to uint16_t

2023-05-10 Thread Gert Doering
Hi, On Wed, May 10, 2023 at 01:22:35PM +0200, Frank Lichtenheld wrote: > } > -mssval = (opt[2]<<8)+opt[3]; > +mssval = opt[2] << 8; > +mssval += opt[3]; Is this an intentional change, or just a side effect of "something intermediate

Re: [Openvpn-devel] [PATCH 2/3] Change type of frame.mss_fix to uint16_t

2023-05-10 Thread Frank Lichtenheld
On Wed, May 10, 2023 at 01:57:00PM +0200, Gert Doering wrote: > Hi, > > On Wed, May 10, 2023 at 01:22:35PM +0200, Frank Lichtenheld wrote: > > } > > -mssval = (opt[2]<<8)+opt[3]; > > +mssval = opt[2] << 8; > > +mssval += opt[3]; > >