[Openvpn-devel] [S] Change in openvpn[master]: GHA: clean up libressl builds with newer libressl

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#2) to the change originally created by 
flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/461?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos


Change subject: GHA: clean up libressl builds with newer libressl
..

GHA: clean up libressl builds with newer libressl

- Update to latest stable release
- Work-around patches not required anymore
- Official URL of repo has changed

Change-Id: I9b8e69f2b9838cea4cb9001f4e8960b8a39724ef
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20231201123649.18127-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27635.html
Signed-off-by: Gert Doering 
---
M .github/workflows/build.yaml
1 file changed, 2 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/461/2

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index cd72f3d..4393f5c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -323,22 +323,11 @@
 uses: actions/checkout@v3
 with:
   path: libressl
-  repository: libressl-portable/portable
-  ref: v3.7.0
-  # LibreSSL has master in the OPENBSD_BRANCH by default even in the 
tagged releases
-  # Manually use the OpenBSD branch that is more appropiate and remove git 
pull that
-  # breaks when checking out a tag instead of branch
-  - name: "libressl: fix build"
-run: |
-   echo libressl-v3.7.0 > OPENBSD_BRANCH
-   sed -i -e 's/ git pull --rebase//' update.sh
-working-directory: libressl
+  repository: libressl/portable
+  ref: v3.8.2
   - name: "libressl: autogen.sh"
 run: ./autogen.sh
 working-directory: libressl
-  - name: "libressl: autoconf"
-run: autoreconf -fvi
-working-directory: libressl
   - name: "libressl: configure"
 run: ./configure
 working-directory: libressl

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/461?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9b8e69f2b9838cea4cb9001f4e8960b8a39724ef
Gerrit-Change-Number: 461
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: GHA: clean up libressl builds with newer libressl

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/461?usp=email )

Change subject: GHA: clean up libressl builds with newer libressl
..

GHA: clean up libressl builds with newer libressl

- Update to latest stable release
- Work-around patches not required anymore
- Official URL of repo has changed

Change-Id: I9b8e69f2b9838cea4cb9001f4e8960b8a39724ef
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20231201123649.18127-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27635.html
Signed-off-by: Gert Doering 
---
M .github/workflows/build.yaml
1 file changed, 2 insertions(+), 13 deletions(-)




diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index cd72f3d..4393f5c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -323,22 +323,11 @@
 uses: actions/checkout@v3
 with:
   path: libressl
-  repository: libressl-portable/portable
-  ref: v3.7.0
-  # LibreSSL has master in the OPENBSD_BRANCH by default even in the 
tagged releases
-  # Manually use the OpenBSD branch that is more appropiate and remove git 
pull that
-  # breaks when checking out a tag instead of branch
-  - name: "libressl: fix build"
-run: |
-   echo libressl-v3.7.0 > OPENBSD_BRANCH
-   sed -i -e 's/ git pull --rebase//' update.sh
-working-directory: libressl
+  repository: libressl/portable
+  ref: v3.8.2
   - name: "libressl: autogen.sh"
 run: ./autogen.sh
 working-directory: libressl
-  - name: "libressl: autoconf"
-run: autoreconf -fvi
-working-directory: libressl
   - name: "libressl: configure"
 run: ./configure
 working-directory: libressl

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/461?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9b8e69f2b9838cea4cb9001f4e8960b8a39724ef
Gerrit-Change-Number: 461
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: GHA: clean up libressl builds with newer libressl

2023-12-02 Thread Gert Doering
Your patch has been applied to the master and release/2.6 branch.

Tested in my local GH repo, and only the expected failures (ASAN) were
seen.

commit 664dde85be91a5432efe52c90089fcf2bf5d6a3c (master)
commit 1a6aef37781975ea9cc18dde6083ebb2683e6251 (release/2.6)
Author: Frank Lichtenheld
Date:   Fri Dec 1 13:36:49 2023 +0100

 GHA: clean up libressl builds with newer libressl

 Signed-off-by: Frank Lichtenheld 
 Acked-by: Arne Schwabe 
 Message-Id: <20231201123649.18127-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27635.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Remove unused/unneeded/add missing defines from configure/cmake

2023-12-02 Thread Gert Doering
Removing all that autoconf cruft that we do not really care about is
welcome :-) - a slightly more verbose commit message would have been
nice ("remove readv/writev/vsnprintf check because we do not test for
the result anyway, add getrlimit to cmake")...

Your patch has been applied to the master branch.

commit 28871fec80d143b5c3c7a4083384c33f60b927e8
Author: Arne Schwabe
Date:   Fri Dec 1 13:32:11 2023 +0100

 Remove unused/unneeded/add missing defines from configure/cmake

 Signed-off-by: Arne Schwabe 
 Acked-by: Frank Lichtenheld 
 Message-Id: <20231201123211.17619-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27634.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: Remove unused/unneeded/add missing defines from configure/cmake

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#6) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/443?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Remove unused/unneeded/add missing defines from configure/cmake
..

Remove unused/unneeded/add missing defines from configure/cmake

Change-Id: Ifd0376b36d4050dc22bc93b8fcf7ed29faef0021
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231201123211.17619-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27634.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
M configure.ac
3 files changed, 3 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/443/6

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d21c9bd..4aa9793 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,6 +167,7 @@
 check_symbol_exists(getgrnam grp.h HAVE_GETGRNAM)
 check_symbol_exists(getpwnam pwd.h HAVE_GETPWNAM)
 check_symbol_exists(getsockname sys/socket.h HAVE_GETSOCKNAME)
+check_symbol_exists(getrlimit "sys/time.h;sys/resource.h" HAVE_GETRLIMIT)

 # Some OS (e.g. FreeBSD) need some basic headers to allow
 # including network headers
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 19b79bc..848c505 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -140,7 +140,7 @@
 #cmakedefine HAVE_GETPWNAM

 /* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
+#cmakedefine HAVE_GETRLIMIT

 /* Define to 1 if you have the `getsockname' function. */
 #cmakedefine HAVE_GETSOCKNAME
@@ -235,8 +235,6 @@
 /* Define to 1 if you have the  header file. */
 #cmakedefine HAVE_PWD_H

-/* Define to 1 if you have the `readv' function. */
-#undef HAVE_READV

 /* Define to 1 if you have the `recvmsg' function. */
 #cmakedefine HAVE_RECVMSG
@@ -383,9 +381,6 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_VFORK_H

-/* Define to 1 if you have the `vsnprintf' function. */
-#undef HAVE_VSNPRINTF
-
 /* we always assume a recent mbed TLS version */
 #define HAVE_MBEDTLS_PSA_CRYPTO_H 1
 #define HAVE_MBEDTLS_SSL_TLS_PRF 1
diff --git a/configure.ac b/configure.ac
index 84eaad6..141acc6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -655,7 +655,7 @@
 AC_CHECK_FUNCS([ \
daemon chroot getpwnam setuid nice system dup dup2 \
syslog openlog mlockall getrlimit getgrnam setgid \
-   setgroups flock readv writev time gettimeofday \
+   setgroups flock time gettimeofday \
setsid chdir \
chsize ftruncate execve getpeereid basename dirname access \
epoll_create strsep \

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/443?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifd0376b36d4050dc22bc93b8fcf7ed29faef0021
Gerrit-Change-Number: 443
Gerrit-PatchSet: 6
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: Remove unused/unneeded/add missing defines from configure/cmake

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/443?usp=email )

Change subject: Remove unused/unneeded/add missing defines from configure/cmake
..

Remove unused/unneeded/add missing defines from configure/cmake

Change-Id: Ifd0376b36d4050dc22bc93b8fcf7ed29faef0021
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231201123211.17619-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27634.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
M configure.ac
3 files changed, 3 insertions(+), 7 deletions(-)




diff --git a/CMakeLists.txt b/CMakeLists.txt
index d21c9bd..4aa9793 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,6 +167,7 @@
 check_symbol_exists(getgrnam grp.h HAVE_GETGRNAM)
 check_symbol_exists(getpwnam pwd.h HAVE_GETPWNAM)
 check_symbol_exists(getsockname sys/socket.h HAVE_GETSOCKNAME)
+check_symbol_exists(getrlimit "sys/time.h;sys/resource.h" HAVE_GETRLIMIT)

 # Some OS (e.g. FreeBSD) need some basic headers to allow
 # including network headers
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 19b79bc..848c505 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -140,7 +140,7 @@
 #cmakedefine HAVE_GETPWNAM

 /* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
+#cmakedefine HAVE_GETRLIMIT

 /* Define to 1 if you have the `getsockname' function. */
 #cmakedefine HAVE_GETSOCKNAME
@@ -235,8 +235,6 @@
 /* Define to 1 if you have the  header file. */
 #cmakedefine HAVE_PWD_H

-/* Define to 1 if you have the `readv' function. */
-#undef HAVE_READV

 /* Define to 1 if you have the `recvmsg' function. */
 #cmakedefine HAVE_RECVMSG
@@ -383,9 +381,6 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_VFORK_H

-/* Define to 1 if you have the `vsnprintf' function. */
-#undef HAVE_VSNPRINTF
-
 /* we always assume a recent mbed TLS version */
 #define HAVE_MBEDTLS_PSA_CRYPTO_H 1
 #define HAVE_MBEDTLS_SSL_TLS_PRF 1
diff --git a/configure.ac b/configure.ac
index 84eaad6..141acc6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -655,7 +655,7 @@
 AC_CHECK_FUNCS([ \
daemon chroot getpwnam setuid nice system dup dup2 \
syslog openlog mlockall getrlimit getgrnam setgid \
-   setgroups flock readv writev time gettimeofday \
+   setgroups flock time gettimeofday \
setsid chdir \
chsize ftruncate execve getpeereid basename dirname access \
epoll_create strsep \

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/443?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifd0376b36d4050dc22bc93b8fcf7ed29faef0021
Gerrit-Change-Number: 443
Gerrit-PatchSet: 6
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Document tls-exit option mainly as test option

2023-12-02 Thread Gert Doering
Straight and to the point :-)

Your patch has been applied to the master and release/2.6 branch.

commit ee6417e9d602d7d2db018739f07724b4660bf980 (master)
commit 350bdd85431548a7043085e475d6c8c611e2239f (release/2.6)
Author: Arne Schwabe
Date:   Fri Dec 1 12:19:37 2023 +0100

 Document tls-exit option mainly as test option

 Signed-off-by: Arne Schwabe 
 Acked-by: Frank Lichtenheld 
 Message-Id: <2023120937.15214-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27626.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Document tls-exit option mainly as test option

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#4) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/447?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Document tls-exit option mainly as test option
..

Document tls-exit option mainly as test option

Change-Id: I93afff2372c4150d6bddc8c07fd4ebc8bfb0cc3e
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <2023120937.15214-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27626.html
Signed-off-by: Gert Doering 
---
M doc/man-sections/tls-options.rst
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/47/447/4

diff --git a/doc/man-sections/tls-options.rst b/doc/man-sections/tls-options.rst
index 908a42a..ad8ca72 100644
--- a/doc/man-sections/tls-options.rst
+++ b/doc/man-sections/tls-options.rst
@@ -553,7 +553,9 @@
   code.

 --tls-exit
-  Exit on TLS negotiation failure.
+  Exit on TLS negotiation failure. This option can be useful when you only
+  want to make one attempt at connecting, e.g. in a test or monitoring script.
+  (OpenVPN's own test suite uses it this way.)

 --tls-export-cert directory
   Store the certificates the clients use upon connection to this

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/447?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I93afff2372c4150d6bddc8c07fd4ebc8bfb0cc3e
Gerrit-Change-Number: 447
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Document tls-exit option mainly as test option

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/447?usp=email )

Change subject: Document tls-exit option mainly as test option
..

Document tls-exit option mainly as test option

Change-Id: I93afff2372c4150d6bddc8c07fd4ebc8bfb0cc3e
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <2023120937.15214-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27626.html
Signed-off-by: Gert Doering 
---
M doc/man-sections/tls-options.rst
1 file changed, 3 insertions(+), 1 deletion(-)




diff --git a/doc/man-sections/tls-options.rst b/doc/man-sections/tls-options.rst
index 908a42a..ad8ca72 100644
--- a/doc/man-sections/tls-options.rst
+++ b/doc/man-sections/tls-options.rst
@@ -553,7 +553,9 @@
   code.

 --tls-exit
-  Exit on TLS negotiation failure.
+  Exit on TLS negotiation failure. This option can be useful when you only
+  want to make one attempt at connecting, e.g. in a test or monitoring script.
+  (OpenVPN's own test suite uses it this way.)

 --tls-export-cert directory
   Store the certificates the clients use upon connection to this

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/447?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I93afff2372c4150d6bddc8c07fd4ebc8bfb0cc3e
Gerrit-Change-Number: 447
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Remove dead remains of extract_x509_field_test

2023-12-02 Thread Gert Doering
Obviously so :-) - haven't tested anything, as all removed code is
insides #ifdef that are never defined (and the function body itself 
is long gone).

Your patch has been applied to the master branch.

commit 5ce74caa39cf6335bb4b5b394e1ac4da3c9b9a3f
Author: Arne Schwabe
Date:   Fri Dec 1 12:18:46 2023 +0100

 Remove dead remains of extract_x509_field_test

 Signed-off-by: Arne Schwabe 
 Acked-by: Frank Lichtenheld 
 Message-Id: <2023120846.15097-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27625.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Replace character_class_debug with proper unit test

2023-12-02 Thread Gert Doering
This is definitely more useful than having conditional tests that
nobody ever runs... done a quick test on FreeBSD, passes...

[ RUN  ] test_character_class
[   OK ] test_character_class
[==] 14 test(s) run.
[  PASSED  ] 14 test(s).
PASS: buffer_testdriver

Your patch has been applied to the master branch.

commit 0a27c98a61ae103d29065610abe1e4e0b61f3375
Author: Arne Schwabe
Date:   Fri Dec 1 12:22:43 2023 +0100

 Replace character_class_debug with proper unit test

 Signed-off-by: Arne Schwabe 
 Acked-by: Frank Lichtenheld 
 Message-Id: <20231201112243.15541-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27628.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [M] Change in openvpn[master]: Replace character_class_debug with proper unit test

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#2) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/464?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Replace character_class_debug with proper unit test
..

Replace character_class_debug with proper unit test

Change-Id: Ib2aa85b9c34d0a0b8b1dfb9f477f56c9a6b705d0
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231201112243.15541-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27628.html
Signed-off-by: Gert Doering 
---
M src/openvpn/buffer.c
M src/openvpn/buffer.h
M src/openvpn/init.c
M tests/unit_tests/openvpn/test_buffer.c
4 files changed, 25 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/464/2

diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c
index 24f1ef2..0b94a52 100644
--- a/src/openvpn/buffer.c
+++ b/src/openvpn/buffer.c
@@ -1150,26 +1150,6 @@
 }
 }

-#ifdef CHARACTER_CLASS_DEBUG
-
-#define CC_INCLUDE(CC_PRINT)
-#define CC_EXCLUDE(0)
-#define CC_REPLACE('.')
-
-void
-character_class_debug(void)
-{
-char buf[256];
-
-while (fgets(buf, sizeof(buf), stdin) != NULL)
-{
-string_mod(buf, CC_INCLUDE, CC_EXCLUDE, CC_REPLACE);
-printf("%s", buf);
-}
-}
-
-#endif
-
 #ifdef VERIFY_ALIGNMENT
 void
 valign4(const struct buffer *buf, const char *file, const int line)
diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h
index 4cc7950..0456b27 100644
--- a/src/openvpn/buffer.h
+++ b/src/openvpn/buffer.h
@@ -896,8 +896,6 @@
  */
 const char *np(const char *str);

-/*#define CHARACTER_CLASS_DEBUG*/
-
 /* character classes */

 #define CC_ANY(1<<0)
@@ -961,11 +959,6 @@
 }


-#ifdef CHARACTER_CLASS_DEBUG
-void character_class_debug(void);
-
-#endif
-
 /*
  * Verify that a pointer is correctly aligned
  */
diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index abba748..ca42c92 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -875,11 +875,6 @@
 return false;
 #endif

-#ifdef CHARACTER_CLASS_DEBUG
-character_class_debug();
-return false;
-#endif
-
 #ifdef TIME_TEST
 time_test();
 return false;
diff --git a/tests/unit_tests/openvpn/test_buffer.c 
b/tests/unit_tests/openvpn/test_buffer.c
index 8232f92..f994812 100644
--- a/tests/unit_tests/openvpn/test_buffer.c
+++ b/tests/unit_tests/openvpn/test_buffer.c
@@ -319,6 +319,30 @@
 gc_free(&gc);
 }

+static void
+test_character_class(void **state)
+{
+char buf[256];
+strcpy(buf, "There is \x01 a nice 1234 year old tr\x7f ee!");
+string_mod(buf, CC_PRINT, 0, '@');
+assert_string_equal(buf, "There is @ a nice 1234 year old tr@ ee!");
+
+strcpy(buf, "There is \x01 a nice 1234 year old tr\x7f ee!");
+string_mod(buf, CC_PRINT, CC_DIGIT, '@');
+assert_string_equal(buf, "There is @ a nice  year old tr@ ee!");
+
+strcpy(buf, "There is \x01 a nice 1234 year old tr\x7f ee!");
+string_mod(buf, CC_ALPHA, CC_DIGIT, '.');
+assert_string_equal(buf, "There.is...a.nice..year.old.tr..ee.");
+
+strcpy(buf, "There is \x01 a 'nice' \"1234\"\n year old \ntr\x7f ee!");
+string_mod(buf, CC_ALPHA|CC_DIGIT|CC_NEWLINE|CC_SINGLE_QUOTE, 
CC_DOUBLE_QUOTE|CC_BLANK, '.');
+assert_string_equal(buf, 
"There.is...a.'nice'..1234.\n.year.old.\ntr..ee.");
+
+strcpy(buf, "There is a \\'nice\\' \"1234\" [*] year old \ntree!");
+string_mod(buf, CC_PRINT, CC_BACKSLASH|CC_ASTERISK, '.');
+assert_string_equal(buf, "There is a .'nice.' \"1234\" [.] year old 
.tree!");
+}

 int
 main(void)
@@ -351,6 +375,7 @@
 cmocka_unit_test(test_buffer_free_gc_one),
 cmocka_unit_test(test_buffer_free_gc_two),
 cmocka_unit_test(test_buffer_gc_realloc),
+cmocka_unit_test(test_character_class),
 };

 return cmocka_run_group_tests_name("buffer", tests, NULL, NULL);

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/464?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib2aa85b9c34d0a0b8b1dfb9f477f56c9a6b705d0
Gerrit-Change-Number: 464
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Remove dead remains of extract_x509_field_test

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#2) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/462?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Remove dead remains of extract_x509_field_test
..

Remove dead remains of extract_x509_field_test

This removes some leftover references to extract_x509_field_test that
was removed 15 years ago in commit 564cbab5f.

Change-Id: Ie511a586cf022afcab9d67891ff80676ac7d47b9
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <2023120846.15097-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27625.html
Signed-off-by: Gert Doering 
---
M src/openvpn/init.c
M src/openvpn/ssl.h
2 files changed, 0 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/62/462/2

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 8c707a4..abba748 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -880,11 +880,6 @@
 return false;
 #endif

-#ifdef EXTRACT_X509_FIELD_TEST
-extract_x509_field_test();
-return false;
-#endif
-
 #ifdef TIME_TEST
 time_test();
 return false;
diff --git a/src/openvpn/ssl.h b/src/openvpn/ssl.h
index e842746..6ba6ff8 100644
--- a/src/openvpn/ssl.h
+++ b/src/openvpn/ssl.h
@@ -540,9 +540,6 @@

 #endif

-/*#define EXTRACT_X509_FIELD_TEST*/
-void extract_x509_field_test(void);
-
 /**
  * Given a key_method, return true if opcode represents the one of the
  * hard_reset op codes for key-method 2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/462?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie511a586cf022afcab9d67891ff80676ac7d47b9
Gerrit-Change-Number: 462
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [M] Change in openvpn[master]: Replace character_class_debug with proper unit test

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/464?usp=email )

Change subject: Replace character_class_debug with proper unit test
..

Replace character_class_debug with proper unit test

Change-Id: Ib2aa85b9c34d0a0b8b1dfb9f477f56c9a6b705d0
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231201112243.15541-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27628.html
Signed-off-by: Gert Doering 
---
M src/openvpn/buffer.c
M src/openvpn/buffer.h
M src/openvpn/init.c
M tests/unit_tests/openvpn/test_buffer.c
4 files changed, 25 insertions(+), 32 deletions(-)




diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c
index 24f1ef2..0b94a52 100644
--- a/src/openvpn/buffer.c
+++ b/src/openvpn/buffer.c
@@ -1150,26 +1150,6 @@
 }
 }

-#ifdef CHARACTER_CLASS_DEBUG
-
-#define CC_INCLUDE(CC_PRINT)
-#define CC_EXCLUDE(0)
-#define CC_REPLACE('.')
-
-void
-character_class_debug(void)
-{
-char buf[256];
-
-while (fgets(buf, sizeof(buf), stdin) != NULL)
-{
-string_mod(buf, CC_INCLUDE, CC_EXCLUDE, CC_REPLACE);
-printf("%s", buf);
-}
-}
-
-#endif
-
 #ifdef VERIFY_ALIGNMENT
 void
 valign4(const struct buffer *buf, const char *file, const int line)
diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h
index 4cc7950..0456b27 100644
--- a/src/openvpn/buffer.h
+++ b/src/openvpn/buffer.h
@@ -896,8 +896,6 @@
  */
 const char *np(const char *str);

-/*#define CHARACTER_CLASS_DEBUG*/
-
 /* character classes */

 #define CC_ANY(1<<0)
@@ -961,11 +959,6 @@
 }


-#ifdef CHARACTER_CLASS_DEBUG
-void character_class_debug(void);
-
-#endif
-
 /*
  * Verify that a pointer is correctly aligned
  */
diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index abba748..ca42c92 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -875,11 +875,6 @@
 return false;
 #endif

-#ifdef CHARACTER_CLASS_DEBUG
-character_class_debug();
-return false;
-#endif
-
 #ifdef TIME_TEST
 time_test();
 return false;
diff --git a/tests/unit_tests/openvpn/test_buffer.c 
b/tests/unit_tests/openvpn/test_buffer.c
index 8232f92..f994812 100644
--- a/tests/unit_tests/openvpn/test_buffer.c
+++ b/tests/unit_tests/openvpn/test_buffer.c
@@ -319,6 +319,30 @@
 gc_free(&gc);
 }

+static void
+test_character_class(void **state)
+{
+char buf[256];
+strcpy(buf, "There is \x01 a nice 1234 year old tr\x7f ee!");
+string_mod(buf, CC_PRINT, 0, '@');
+assert_string_equal(buf, "There is @ a nice 1234 year old tr@ ee!");
+
+strcpy(buf, "There is \x01 a nice 1234 year old tr\x7f ee!");
+string_mod(buf, CC_PRINT, CC_DIGIT, '@');
+assert_string_equal(buf, "There is @ a nice  year old tr@ ee!");
+
+strcpy(buf, "There is \x01 a nice 1234 year old tr\x7f ee!");
+string_mod(buf, CC_ALPHA, CC_DIGIT, '.');
+assert_string_equal(buf, "There.is...a.nice..year.old.tr..ee.");
+
+strcpy(buf, "There is \x01 a 'nice' \"1234\"\n year old \ntr\x7f ee!");
+string_mod(buf, CC_ALPHA|CC_DIGIT|CC_NEWLINE|CC_SINGLE_QUOTE, 
CC_DOUBLE_QUOTE|CC_BLANK, '.');
+assert_string_equal(buf, 
"There.is...a.'nice'..1234.\n.year.old.\ntr..ee.");
+
+strcpy(buf, "There is a \\'nice\\' \"1234\" [*] year old \ntree!");
+string_mod(buf, CC_PRINT, CC_BACKSLASH|CC_ASTERISK, '.');
+assert_string_equal(buf, "There is a .'nice.' \"1234\" [.] year old 
.tree!");
+}

 int
 main(void)
@@ -351,6 +375,7 @@
 cmocka_unit_test(test_buffer_free_gc_one),
 cmocka_unit_test(test_buffer_free_gc_two),
 cmocka_unit_test(test_buffer_gc_realloc),
+cmocka_unit_test(test_character_class),
 };

 return cmocka_run_group_tests_name("buffer", tests, NULL, NULL);

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/464?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib2aa85b9c34d0a0b8b1dfb9f477f56c9a6b705d0
Gerrit-Change-Number: 464
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Remove dead remains of extract_x509_field_test

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/462?usp=email )

Change subject: Remove dead remains of extract_x509_field_test
..

Remove dead remains of extract_x509_field_test

This removes some leftover references to extract_x509_field_test that
was removed 15 years ago in commit 564cbab5f.

Change-Id: Ie511a586cf022afcab9d67891ff80676ac7d47b9
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <2023120846.15097-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27625.html
Signed-off-by: Gert Doering 
---
M src/openvpn/init.c
M src/openvpn/ssl.h
2 files changed, 0 insertions(+), 8 deletions(-)




diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 8c707a4..abba748 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -880,11 +880,6 @@
 return false;
 #endif

-#ifdef EXTRACT_X509_FIELD_TEST
-extract_x509_field_test();
-return false;
-#endif
-
 #ifdef TIME_TEST
 time_test();
 return false;
diff --git a/src/openvpn/ssl.h b/src/openvpn/ssl.h
index e842746..6ba6ff8 100644
--- a/src/openvpn/ssl.h
+++ b/src/openvpn/ssl.h
@@ -540,9 +540,6 @@

 #endif

-/*#define EXTRACT_X509_FIELD_TEST*/
-void extract_x509_field_test(void);
-
 /**
  * Given a key_method, return true if opcode represents the one of the
  * hard_reset op codes for key-method 2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/462?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie511a586cf022afcab9d67891ff80676ac7d47b9
Gerrit-Change-Number: 462
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway

2023-12-02 Thread Gert Doering
Wasn't even aware we had a TEST_... for this - and indeed, why, if we
have a run-time-argument.  But interestingly enough, seems I even added
IPv6 default gateway handling to that dead function... thorough me.

Your patch has been applied to the master and release/2.6 branch.

commit 6158228f16836f56a564d4533e7b513dc6170854 (master)
commit 3168e1af929d7061e0ec2be049f6beea73c49a5a (release/2.6)
Author: Arne Schwabe
Date:   Fri Dec 1 12:17:17 2023 +0100

 Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway

 Signed-off-by: Arne Schwabe 
 Acked-by: Frank Lichtenheld 
 Message-Id: <2023120717.14940-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27624.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#2) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/463?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway
..

Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway

This debug code is not very useful as it is outdated and the same
functionality is provided by --show-gateway

Change-Id: Ie7fd59cc84e2eb024086c28c2ec2a5606a2b2e7c
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <2023120717.14940-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27624.html
Signed-off-by: Gert Doering 
---
M src/openvpn/init.c
1 file changed, 0 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/63/463/2

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index ca42c92..9972ed7 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -880,17 +880,6 @@
 return false;
 #endif
 
-#ifdef TEST_GET_DEFAULT_GATEWAY
-{
-struct route_gateway_info rgi;
-struct route_ipv6_gateway_info rgi6;
-get_default_gateway(&rgi);
-get_default_gateway_ipv6(&rgi6, NULL);
-print_default_gateway(M_INFO, &rgi, &rgi6);
-return false;
-}
-#endif
-
 #ifdef GEN_PATH_TEST
 {
 struct gc_arena gc = gc_new();

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/463?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie7fd59cc84e2eb024086c28c2ec2a5606a2b2e7c
Gerrit-Change-Number: 463
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/463?usp=email )

Change subject: Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway
..

Remove TEST_GET_DEFAULT_GATEWAY as it duplicates --show-gateway

This debug code is not very useful as it is outdated and the same
functionality is provided by --show-gateway

Change-Id: Ie7fd59cc84e2eb024086c28c2ec2a5606a2b2e7c
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <2023120717.14940-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27624.html
Signed-off-by: Gert Doering 
---
M src/openvpn/init.c
1 file changed, 0 insertions(+), 11 deletions(-)




diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index ca42c92..9972ed7 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -880,17 +880,6 @@
 return false;
 #endif

-#ifdef TEST_GET_DEFAULT_GATEWAY
-{
-struct route_gateway_info rgi;
-struct route_ipv6_gateway_info rgi6;
-get_default_gateway(&rgi);
-get_default_gateway_ipv6(&rgi6, NULL);
-print_default_gateway(M_INFO, &rgi, &rgi6);
-return false;
-}
-#endif
-
 #ifdef GEN_PATH_TEST
 {
 struct gc_arena gc = gc_new();

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/463?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie7fd59cc84e2eb024086c28c2ec2a5606a2b2e7c
Gerrit-Change-Number: 463
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Fix check_session_buf_not_used using wrong index

2023-12-02 Thread Gert Doering
Indeed, that function seems to be slightly cursed... and this is the
right fix.  For this bug.

Tested more thoroughly :-) (full server test runs + GHA).

Your patch has been applied to the master and release/2.6 branch.

commit 59551b93cdb55397d63b2fe58ad99612821c0faf (master)
commit 5def8d935335619b16452b56b332d06f4d621d75 (release/2.6)
Author: Arne Schwabe
Date:   Tue Nov 28 11:43:59 2023 +0100

 Fix check_session_buf_not_used using wrong index

 Signed-off-by: Arne Schwabe 
 Acked-by: Frank Lichtenheld 
 Message-Id: <20231128104359.62967-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27576.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Fix check_session_buf_not_used using wrong index

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/459?usp=email )

Change subject: Fix check_session_buf_not_used using wrong index
..

Fix check_session_buf_not_used using wrong index

The inner loop used i instead of j when iterating through the buffers.

Since i is always between 0 and 2 and ks->send_reliable->size is
(when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not
cause an index of out bounds.  So while the check was not doing anything
really useful with i instead of j, at least it was not crashing or
anything similar.

Noticed-By: Jon Williams (braindead-bf) on Github issue #449
Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231128104359.62967-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27576.html
Signed-off-by: Gert Doering 
---
M src/openvpn/ssl.c
1 file changed, 1 insertion(+), 1 deletion(-)




diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index 400230c..b5d24b5 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -3207,7 +3207,7 @@

 for (int j = 0; j < ks->send_reliable->size; j++)
 {
-if (ks->send_reliable->array[i].buf.data == dataptr)
+if (ks->send_reliable->array[j].buf.data == dataptr)
 {
 msg(M_INFO, "Warning buffer of freed TLS session is still in"
 " use (session->key[%d].send_reliable->array[%d])",

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/459?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Gerrit-Change-Number: 459
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Fix check_session_buf_not_used using wrong index

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#2) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/459?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Fix check_session_buf_not_used using wrong index
..

Fix check_session_buf_not_used using wrong index

The inner loop used i instead of j when iterating through the buffers.

Since i is always between 0 and 2 and ks->send_reliable->size is
(when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not
cause an index of out bounds.  So while the check was not doing anything
really useful with i instead of j, at least it was not crashing or
anything similar.

Noticed-By: Jon Williams (braindead-bf) on Github issue #449
Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231128104359.62967-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27576.html
Signed-off-by: Gert Doering 
---
M src/openvpn/ssl.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/459/2

diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index 400230c..b5d24b5 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -3207,7 +3207,7 @@

 for (int j = 0; j < ks->send_reliable->size; j++)
 {
-if (ks->send_reliable->array[i].buf.data == dataptr)
+if (ks->send_reliable->array[j].buf.data == dataptr)
 {
 msg(M_INFO, "Warning buffer of freed TLS session is still in"
 " use (session->key[%d].send_reliable->array[%d])",

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/459?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d
Gerrit-Change-Number: 459
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Add missing check for nl_socket_alloc failure

2023-12-02 Thread Gert Doering
Took us long enough for such a simple fix... :-)

I have no easy way to trigger this, so only compile tested.

Your patch has been applied to the master and release/2.6 branch.

commit d1c31e428120bb0fc9488c62c1691c92a37d94c3 (master)
commit aa19a6a90f7ef24df12eed205663f3cfbb7d8174 (release/2.6)
Author: Arne Schwabe
Date:   Tue Nov 21 18:06:03 2023 +0100

 Add missing check for nl_socket_alloc failure

 Signed-off-by: Arne Schwabe 
 Acked-by: Antonio Quartulli 
 Message-Id: <20231121170603.886801-1-a...@rfc2549.org>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27541.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: configure.ac: Remove unused AC_TYPE_SIGNAL macro

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/453?usp=email )

Change subject: configure.ac: Remove unused AC_TYPE_SIGNAL macro
..

configure.ac: Remove unused AC_TYPE_SIGNAL macro

Recent autoconf warns:
configure.ac:448: warning: The macro `AC_TYPE_SIGNAL' is obsolete.

And it turns out that we do not actually use RETSIGTYPE.
Additionally, there is no reason to do so since as the
autoconf documentation says:
"These days, it is portable to assume C89, and that signal
handlers return void, without needing to use this macro or
RETSIGTYPE."

Change-Id: I7da7c2d7d34c7e5efd52d448646b4398a1005e77
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20231128103740.61160-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27572.html
Signed-off-by: Gert Doering 
---
M configure.ac
1 file changed, 0 insertions(+), 1 deletion(-)




diff --git a/configure.ac b/configure.ac
index 141acc6..0f667dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -445,7 +445,6 @@
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_UID_T
-AC_TYPE_SIGNAL
 AX_TYPE_SOCKLEN_T
 AC_CHECK_SIZEOF([unsigned int])
 AC_CHECK_SIZEOF([unsigned long])

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/453?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7da7c2d7d34c7e5efd52d448646b4398a1005e77
Gerrit-Change-Number: 453
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: configure.ac: Remove unused AC_TYPE_SIGNAL macro

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#2) to the change originally created by 
flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/453?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by plaisthos


Change subject: configure.ac: Remove unused AC_TYPE_SIGNAL macro
..

configure.ac: Remove unused AC_TYPE_SIGNAL macro

Recent autoconf warns:
configure.ac:448: warning: The macro `AC_TYPE_SIGNAL' is obsolete.

And it turns out that we do not actually use RETSIGTYPE.
Additionally, there is no reason to do so since as the
autoconf documentation says:
"These days, it is portable to assume C89, and that signal
handlers return void, without needing to use this macro or
RETSIGTYPE."

Change-Id: I7da7c2d7d34c7e5efd52d448646b4398a1005e77
Signed-off-by: Frank Lichtenheld 
Acked-by: Arne Schwabe 
Message-Id: <20231128103740.61160-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27572.html
Signed-off-by: Gert Doering 
---
M configure.ac
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/53/453/2

diff --git a/configure.ac b/configure.ac
index 141acc6..0f667dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -445,7 +445,6 @@
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_UID_T
-AC_TYPE_SIGNAL
 AX_TYPE_SOCKLEN_T
 AC_CHECK_SIZEOF([unsigned int])
 AC_CHECK_SIZEOF([unsigned long])

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/453?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7da7c2d7d34c7e5efd52d448646b4398a1005e77
Gerrit-Change-Number: 453
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: configure.ac: Remove unused AC_TYPE_SIGNAL macro

2023-12-02 Thread Gert Doering
"makes sense" :-) - removing cruft from autoconf, and so on.

Your patch has been applied to the master branch and release/2.6
(long-term compat).

commit be05b590e8d5edebd8e35d97af34b0ba7e5350e6 (master)
commit 64703e72df371dabecc8ab83a19621fd9f27c56b (release/2.6)
Author: Frank Lichtenheld
Date:   Tue Nov 28 11:37:40 2023 +0100

 configure.ac: Remove unused AC_TYPE_SIGNAL macro

 Signed-off-by: Frank Lichtenheld 
 Acked-by: Arne Schwabe 
 Message-Id: <20231128103740.61160-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27572.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Add check for nice in cmake config

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#4) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/444?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Add check for nice in cmake config
..

Add check for nice in cmake config

Change-Id: I2cc8f9b82079acca250db5871ffd9fad2997d1a8
Acked-by: Frank Lichtenheld 
Signed-off-by: Arne Schwabe 
Message-Id: <20231128104129.62761-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27574.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/444/4

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4aa9793..db9966b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,6 +144,7 @@
 check_symbol_exists(fork unistd.h HAVE_FORK)
 check_symbol_exists(execve unistd.h HAVE_EXECVE)
 check_symbol_exists(ftruncate unistd.h HAVE_FTRUNCATE)
+check_symbol_exists(nice unistd.h HAVE_NICE)
 check_symbol_exists(setgid unistd.h HAVE_SETGID)
 check_symbol_exists(setuid unistd.h HAVE_SETUID)
 check_symbol_exists(setsid unistd.h HAVE_SETSID)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 848c505..0ef8fe3 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -215,7 +215,7 @@
 #cmakedefine HAVE_NET_TUN_IF_TUN_H

 /* Define to 1 if you have the `nice' function. */
-#undef HAVE_NICE
+#cmakedefine HAVE_NICE

 /* Define to 1 if you have the `openlog' function. */
 #cmakedefine HAVE_OPENLOG

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/444?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2cc8f9b82079acca250db5871ffd9fad2997d1a8
Gerrit-Change-Number: 444
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Add check for nice in cmake config

2023-12-02 Thread Gert Doering
Indeed, having that check would be nice :-)

Your patch has been applied to the master and releae/2.6 branch (bugfix).

commit 4d8ee61ce2c2a8b387773d33b4dd01bc2e147941 (master)
commit cc81f014bcbcfb248fdae91dc3527565c5889ff4 (release/2.6)
Author: Arne Schwabe
Date:   Tue Nov 28 11:41:29 2023 +0100

 Add check for nice in cmake config

 Acked-by: Frank Lichtenheld 
 Signed-off-by: Arne Schwabe 
 Message-Id: <20231128104129.62761-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27574.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: Add check for nice in cmake config

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/444?usp=email )

Change subject: Add check for nice in cmake config
..

Add check for nice in cmake config

Change-Id: I2cc8f9b82079acca250db5871ffd9fad2997d1a8
Acked-by: Frank Lichtenheld 
Signed-off-by: Arne Schwabe 
Message-Id: <20231128104129.62761-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27574.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
2 files changed, 2 insertions(+), 1 deletion(-)




diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4aa9793..db9966b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,6 +144,7 @@
 check_symbol_exists(fork unistd.h HAVE_FORK)
 check_symbol_exists(execve unistd.h HAVE_EXECVE)
 check_symbol_exists(ftruncate unistd.h HAVE_FTRUNCATE)
+check_symbol_exists(nice unistd.h HAVE_NICE)
 check_symbol_exists(setgid unistd.h HAVE_SETGID)
 check_symbol_exists(setuid unistd.h HAVE_SETUID)
 check_symbol_exists(setsid unistd.h HAVE_SETSID)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 848c505..0ef8fe3 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -215,7 +215,7 @@
 #cmakedefine HAVE_NET_TUN_IF_TUN_H

 /* Define to 1 if you have the `nice' function. */
-#undef HAVE_NICE
+#cmakedefine HAVE_NICE

 /* Define to 1 if you have the `openlog' function. */
 #cmakedefine HAVE_OPENLOG

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/444?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2cc8f9b82079acca250db5871ffd9fad2997d1a8
Gerrit-Change-Number: 444
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH applied] Re: Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror

2023-12-02 Thread Gert Doering
As this also affects TARGET_LINUX, compile-tested there and on GHA.

Your patch has been applied to the master branch.

commit efbedf213f659c48cfd55765360fdab7a6488dad (master)
Author: Arne Schwabe
Date:   Tue Nov 28 12:14:47 2023 +0100

 Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror

 Signed-off-by: Arne Schwabe 
 Acked-by: Frank Lichtenheld 
 Message-Id: <20231128111447.64445-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27581.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#2) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/458?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Minimal Solaris/OpenIndiana support to Cmake and clean up 
-Werror
..

Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror

Change-Id: I66e3dd7b7166459526824fe5ae81a449b375b8db
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231128111447.64445-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27581.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
M src/openvpn/route.c
M src/openvpn/tun.c
4 files changed, 18 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/58/458/2

diff --git a/CMakeLists.txt b/CMakeLists.txt
index db9966b..e4de309 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,11 +121,17 @@
 set(TARGET_FREEBSD YES)
 set(ENABLE_DCO YES)
 link_libraries(-lnv)
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
+set(TARGET_SOLARIS YES)
+set(HAVE_SYS_SOCKIO_H 1)
+link_libraries(-lnsl -lsocket -lresolv)
 elseif (WIN32)
 set(ENABLE_DCO YES)
 elseif (APPLE)
 set(TARGET_DARWIN YES)
 set(HAVE_NET_IF_UTUN_H YES)
+else()
+message(FATAL_ERROR "Unknown system name: \"${CMAKE_SYSTEM_NAME}\"")
 endif ()

 if (UNIX)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 0ef8fe3..2af3810 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -334,7 +334,7 @@
 #cmakedefine HAVE_SYS_SOCKET_H

 /* Define to 1 if you have the  header file. */
-#undef HAVE_SYS_SOCKIO_H
+#cmakedefine HAVE_SYS_SOCKIO_H

 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_STAT_H 1
@@ -438,6 +438,9 @@
 /* Are we running on Linux? */
 #cmakedefine TARGET_LINUX

+/* Are we running on Solaris/OpenIndiana? */
+#cmakedefine TARGET_SOLARIS
+
 /* Are we running WIN32? */
 #cmakedefine TARGET_WIN32

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index ff64938..6cc112c 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -2342,12 +2342,11 @@
 return;
 }

-#ifndef _WIN32
+#if !defined(_WIN32)
 #if !defined(TARGET_LINUX)
 const char *gateway;
-#else
-int metric;
 #endif
+#if !defined(TARGET_SOLARIS)
 bool gateway_needed = false;
 const char *device = tt->actual_name;
 if (r6->iface != NULL)  /* vpn server special route */
@@ -2365,6 +2364,7 @@
 gateway_needed = true;
 }
 #endif
+#endif

 struct gc_arena gc = gc_new();
 struct argv argv = argv_new();
@@ -2395,7 +2395,7 @@
 msg( M_INFO, "delete_route_ipv6(%s/%d)", network, r6->netbits );

 #if defined(TARGET_LINUX)
-metric = -1;
+int metric = -1;
 if ((r6->flags & RT_METRIC_DEFINED) && (r6->metric > 0))
 {
 metric = r6->metric;
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 82ab6c0..f1b8699 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -1900,7 +1900,7 @@
 #endif


-#if !(defined(_WIN32) || defined(TARGET_LINUX))
+#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS))
 static void
 open_tun_generic(const char *dev, const char *dev_type, const char *dev_node,
  struct tuntap *tt)
@@ -2061,7 +2061,7 @@
 }
 #endif /* TARGET_LINUX || TARGET_FREEBSD*/

-#if !defined(_WIN32)
+#if !(defined(_WIN32) || defined(TARGET_SOLARIS))
 static void
 close_tun_generic(struct tuntap *tt)
 {
@@ -2398,13 +2398,12 @@
 open_tun(const char *dev, const char *dev_type, const char *dev_node, struct 
tuntap *tt,
  openvpn_net_ctx_t *ctx)
 {
-int if_fd, ip_muxid, arp_muxid, arp_fd, ppa = -1;
+int if_fd = -1, ip_muxid = -1, arp_muxid = -1, arp_fd = -1, ppa = -1;
 struct lifreq ifr;
 const char *ptr;
-const char *ip_node, *arp_node;
+const char *ip_node = NULL, *arp_node = NULL;
 const char *dev_tuntap_type;
 int link_type;
-bool is_tun;
 struct strioctl strioc_if, strioc_ppa;

 /* improved generic TUN/TAP driver from
@@ -2428,7 +2427,6 @@
 }
 dev_tuntap_type = "tun";
 link_type = I_PLINK;
-is_tun = true;
 }
 else if (tt->type == DEV_TYPE_TAP)
 {
@@ -2440,7 +2438,6 @@
 arp_node = dev_node;
 dev_tuntap_type = "tap";
 link_type = I_PLINK; /* was: I_LINK */
-is_tun = false;
 }
 else
 {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/458?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I66e3dd7b7166459526824fe5ae81a449b375b8db
Gerrit-Change-Number: 458
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset

[Openvpn-devel] [S] Change in openvpn[master]: Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/458?usp=email )

Change subject: Minimal Solaris/OpenIndiana support to Cmake and clean up 
-Werror
..

Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror

Change-Id: I66e3dd7b7166459526824fe5ae81a449b375b8db
Signed-off-by: Arne Schwabe 
Acked-by: Frank Lichtenheld 
Message-Id: <20231128111447.64445-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27581.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
M src/openvpn/route.c
M src/openvpn/tun.c
4 files changed, 18 insertions(+), 12 deletions(-)




diff --git a/CMakeLists.txt b/CMakeLists.txt
index db9966b..e4de309 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,11 +121,17 @@
 set(TARGET_FREEBSD YES)
 set(ENABLE_DCO YES)
 link_libraries(-lnv)
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
+set(TARGET_SOLARIS YES)
+set(HAVE_SYS_SOCKIO_H 1)
+link_libraries(-lnsl -lsocket -lresolv)
 elseif (WIN32)
 set(ENABLE_DCO YES)
 elseif (APPLE)
 set(TARGET_DARWIN YES)
 set(HAVE_NET_IF_UTUN_H YES)
+else()
+message(FATAL_ERROR "Unknown system name: \"${CMAKE_SYSTEM_NAME}\"")
 endif ()

 if (UNIX)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 0ef8fe3..2af3810 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -334,7 +334,7 @@
 #cmakedefine HAVE_SYS_SOCKET_H

 /* Define to 1 if you have the  header file. */
-#undef HAVE_SYS_SOCKIO_H
+#cmakedefine HAVE_SYS_SOCKIO_H

 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_STAT_H 1
@@ -438,6 +438,9 @@
 /* Are we running on Linux? */
 #cmakedefine TARGET_LINUX

+/* Are we running on Solaris/OpenIndiana? */
+#cmakedefine TARGET_SOLARIS
+
 /* Are we running WIN32? */
 #cmakedefine TARGET_WIN32

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index ff64938..6cc112c 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -2342,12 +2342,11 @@
 return;
 }

-#ifndef _WIN32
+#if !defined(_WIN32)
 #if !defined(TARGET_LINUX)
 const char *gateway;
-#else
-int metric;
 #endif
+#if !defined(TARGET_SOLARIS)
 bool gateway_needed = false;
 const char *device = tt->actual_name;
 if (r6->iface != NULL)  /* vpn server special route */
@@ -2365,6 +2364,7 @@
 gateway_needed = true;
 }
 #endif
+#endif

 struct gc_arena gc = gc_new();
 struct argv argv = argv_new();
@@ -2395,7 +2395,7 @@
 msg( M_INFO, "delete_route_ipv6(%s/%d)", network, r6->netbits );

 #if defined(TARGET_LINUX)
-metric = -1;
+int metric = -1;
 if ((r6->flags & RT_METRIC_DEFINED) && (r6->metric > 0))
 {
 metric = r6->metric;
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 82ab6c0..f1b8699 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -1900,7 +1900,7 @@
 #endif


-#if !(defined(_WIN32) || defined(TARGET_LINUX))
+#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS))
 static void
 open_tun_generic(const char *dev, const char *dev_type, const char *dev_node,
  struct tuntap *tt)
@@ -2061,7 +2061,7 @@
 }
 #endif /* TARGET_LINUX || TARGET_FREEBSD*/

-#if !defined(_WIN32)
+#if !(defined(_WIN32) || defined(TARGET_SOLARIS))
 static void
 close_tun_generic(struct tuntap *tt)
 {
@@ -2398,13 +2398,12 @@
 open_tun(const char *dev, const char *dev_type, const char *dev_node, struct 
tuntap *tt,
  openvpn_net_ctx_t *ctx)
 {
-int if_fd, ip_muxid, arp_muxid, arp_fd, ppa = -1;
+int if_fd = -1, ip_muxid = -1, arp_muxid = -1, arp_fd = -1, ppa = -1;
 struct lifreq ifr;
 const char *ptr;
-const char *ip_node, *arp_node;
+const char *ip_node = NULL, *arp_node = NULL;
 const char *dev_tuntap_type;
 int link_type;
-bool is_tun;
 struct strioctl strioc_if, strioc_ppa;

 /* improved generic TUN/TAP driver from
@@ -2428,7 +2427,6 @@
 }
 dev_tuntap_type = "tun";
 link_type = I_PLINK;
-is_tun = true;
 }
 else if (tt->type == DEV_TYPE_TAP)
 {
@@ -2440,7 +2438,6 @@
 arp_node = dev_node;
 dev_tuntap_type = "tap";
 link_type = I_PLINK; /* was: I_LINK */
-is_tun = false;
 }
 else
 {

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/458?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I66e3dd7b7166459526824fe5ae81a449b375b8db
Gerrit-Change-Number: 458
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos 
Gerrit-Reviewer: flichtenheld 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [M] Change in openvpn[master]: Remove compat versionhelpers.h and remove cmake/configure check for it

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/445?usp=email )

Change subject: Remove compat versionhelpers.h and remove cmake/configure check 
for it
..

Remove compat versionhelpers.h and remove cmake/configure check for it

The cmake file defined that file to be never present in contrast to the
old msvc-config.h that always had it present.
Remove also the compat implementation taken from mingw. All our current
build environments already have that header in place.

Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a
Acked-by: Frank Lichtenheld 
Signed-off-by: Arne Schwabe 
Message-Id: <20231128103950.62407-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27573.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
M configure.ac
M src/compat/Makefile.am
D src/compat/compat-versionhelpers.h
M src/openvpn/win32.c
M src/openvpnserv/interactive.c
7 files changed, 1 insertion(+), 131 deletions(-)




diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4de309..577bc5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -316,7 +316,6 @@
 src/compat/compat-dirname.c
 src/compat/compat-gettimeofday.c
 src/compat/compat-strsep.c
-src/compat/compat-versionhelpers.h
 src/openvpn/argv.c
 src/openvpn/argv.h
 src/openvpn/base64.c
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 2af3810..baf9556 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -372,9 +372,6 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_VALGRIND_MEMCHECK_H

-/* Define to 1 if you have the  header file. */
-#undef HAVE_VERSIONHELPERS_H
-
 /* Define to 1 if you have the `vfork' function. */
 #undef HAVE_VFORK

diff --git a/configure.ac b/configure.ac
index 0f667dc..54f79ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -454,7 +454,6 @@
unistd.h dlfcn.h \
netinet/in.h \
netinet/tcp.h arpa/inet.h netdb.h \
-   versionhelpers.h \
 ])
 AC_CHECK_HEADERS([ \
sys/time.h sys/ioctl.h sys/stat.h \
diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am
index f5de451..5298dd8 100644
--- a/src/compat/Makefile.am
+++ b/src/compat/Makefile.am
@@ -20,5 +20,4 @@
compat-basename.c \
compat-gettimeofday.c \
compat-daemon.c \
-   compat-strsep.c \
-   compat-versionhelpers.h
+   compat-strsep.c
\ No newline at end of file
diff --git a/src/compat/compat-versionhelpers.h 
b/src/compat/compat-versionhelpers.h
deleted file mode 100644
index b071602..000
--- a/src/compat/compat-versionhelpers.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * This file is part of the mingw-w64 runtime package.
- * No warranty is given; refer to the file DISCLAIMER within this package.
- */
-
-#ifndef _INC_VERSIONHELPERS
-#define _INC_VERSIONHELPERS
-
-#include 
-
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__)
-
-#ifdef __cplusplus
-#define VERSIONHELPERAPI inline bool
-#else
-#define VERSIONHELPERAPI FORCEINLINE BOOL
-#endif
-
-#define _WIN32_WINNT_WINBLUE0x0603
-
-#ifndef _WIN32_WINNT_WINTHRESHOLD
-#define _WIN32_WINNT_WINTHRESHOLD0x0A00 /* Windows 10 */
-#endif
-
-VERSIONHELPERAPI
-IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack)
-{
-OSVERSIONINFOEXW vi = {sizeof(vi), major, minor, 0, 0, {0}, servpack};
-return VerifyVersionInfoW(&vi, 
VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
-  
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
-   
   VER_MAJORVERSION, VER_GREATER_EQUAL),
-  
VER_MINORVERSION, VER_GREATER_EQUAL),
-  VER_SERVICEPACKMAJOR, 
VER_GREATER_EQUAL));
-}
-
-VERSIONHELPERAPI
-IsWindowsXPOrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 0);
-}
-
-VERSIONHELPERAPI
-IsWindowsXPSP1OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 1);
-}
-
-VERSIONHELPERAPI
-IsWindowsXPSP2OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 2);
-}
-
-VERSIONHELPERAPI
-IsWindowsXPSP3OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 3);
-}
-
-VERSIONHELPERAPI
-IsWindowsVistaOrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), 
LOBYTE(_WIN32_WINNT_VISTA), 0);
-}
-
-VERSIONHELPERAPI
-IsWindowsVistaSP1OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), 
LOBYTE(_WIN32_WINNT_VISTA), 1);
-}
-
-VERSIONHELPERAPI
-IsWindowsVistaSP2OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_

[Openvpn-devel] [PATCH applied] Re: Remove compat versionhelpers.h and remove cmake/configure check for it

2023-12-02 Thread Gert Doering
Since this is sort of an extention to "The Cmake Patch" that is in
release/2.6, I've also applied this patch there.  Tested via GHA builds
and local MinGW build.

Your patch has been applied to the master and release/2.6 branch.

commit a68595a582b2c6c220b4f4502753d5f4154000d8 (master)
commit 19bfb7021430ecac9946fa5eab2da03cff4718c1 (release/2.6)
Author: Arne Schwabe
Date:   Tue Nov 28 11:39:50 2023 +0100

 Remove compat versionhelpers.h and remove cmake/configure check for it

 Acked-by: Frank Lichtenheld 
 Signed-off-by: Arne Schwabe 
 Message-Id: <20231128103950.62407-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27573.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [M] Change in openvpn[master]: Remove compat versionhelpers.h and remove cmake/configure check for it

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#3) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/445?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Remove compat versionhelpers.h and remove cmake/configure check 
for it
..

Remove compat versionhelpers.h and remove cmake/configure check for it

The cmake file defined that file to be never present in contrast to the
old msvc-config.h that always had it present.
Remove also the compat implementation taken from mingw. All our current
build environments already have that header in place.

Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a
Acked-by: Frank Lichtenheld 
Signed-off-by: Arne Schwabe 
Message-Id: <20231128103950.62407-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27573.html
Signed-off-by: Gert Doering 
---
M CMakeLists.txt
M config.h.cmake.in
M configure.ac
M src/compat/Makefile.am
D src/compat/compat-versionhelpers.h
M src/openvpn/win32.c
M src/openvpnserv/interactive.c
7 files changed, 1 insertion(+), 131 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/445/3

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4de309..577bc5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -316,7 +316,6 @@
 src/compat/compat-dirname.c
 src/compat/compat-gettimeofday.c
 src/compat/compat-strsep.c
-src/compat/compat-versionhelpers.h
 src/openvpn/argv.c
 src/openvpn/argv.h
 src/openvpn/base64.c
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 2af3810..baf9556 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -372,9 +372,6 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_VALGRIND_MEMCHECK_H

-/* Define to 1 if you have the  header file. */
-#undef HAVE_VERSIONHELPERS_H
-
 /* Define to 1 if you have the `vfork' function. */
 #undef HAVE_VFORK

diff --git a/configure.ac b/configure.ac
index 0f667dc..54f79ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -454,7 +454,6 @@
unistd.h dlfcn.h \
netinet/in.h \
netinet/tcp.h arpa/inet.h netdb.h \
-   versionhelpers.h \
 ])
 AC_CHECK_HEADERS([ \
sys/time.h sys/ioctl.h sys/stat.h \
diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am
index f5de451..5298dd8 100644
--- a/src/compat/Makefile.am
+++ b/src/compat/Makefile.am
@@ -20,5 +20,4 @@
compat-basename.c \
compat-gettimeofday.c \
compat-daemon.c \
-   compat-strsep.c \
-   compat-versionhelpers.h
+   compat-strsep.c
\ No newline at end of file
diff --git a/src/compat/compat-versionhelpers.h 
b/src/compat/compat-versionhelpers.h
deleted file mode 100644
index b071602..000
--- a/src/compat/compat-versionhelpers.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * This file is part of the mingw-w64 runtime package.
- * No warranty is given; refer to the file DISCLAIMER within this package.
- */
-
-#ifndef _INC_VERSIONHELPERS
-#define _INC_VERSIONHELPERS
-
-#include 
-
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__)
-
-#ifdef __cplusplus
-#define VERSIONHELPERAPI inline bool
-#else
-#define VERSIONHELPERAPI FORCEINLINE BOOL
-#endif
-
-#define _WIN32_WINNT_WINBLUE0x0603
-
-#ifndef _WIN32_WINNT_WINTHRESHOLD
-#define _WIN32_WINNT_WINTHRESHOLD0x0A00 /* Windows 10 */
-#endif
-
-VERSIONHELPERAPI
-IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack)
-{
-OSVERSIONINFOEXW vi = {sizeof(vi), major, minor, 0, 0, {0}, servpack};
-return VerifyVersionInfoW(&vi, 
VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
-  
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
-   
   VER_MAJORVERSION, VER_GREATER_EQUAL),
-  
VER_MINORVERSION, VER_GREATER_EQUAL),
-  VER_SERVICEPACKMAJOR, 
VER_GREATER_EQUAL));
-}
-
-VERSIONHELPERAPI
-IsWindowsXPOrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 0);
-}
-
-VERSIONHELPERAPI
-IsWindowsXPSP1OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 1);
-}
-
-VERSIONHELPERAPI
-IsWindowsXPSP2OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 2);
-}
-
-VERSIONHELPERAPI
-IsWindowsXPSP3OrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
LOBYTE(_WIN32_WINNT_WINXP), 3);
-}
-
-VERSIONHELPERAPI
-IsWindowsVistaOrGreater(void)
-{
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), 
LOBYTE(_WIN32_WINNT_VISTA), 0);
-}
-
-VERSIONHELPERAPI
-IsWindowsVistaSP1OrGreater(vo

Re: [Openvpn-devel] [M] Change in openvpn[master]: Remove compat versionhelpers.h and remove cmake/configure check for it

2023-12-02 Thread Juan Cervantes
Make is original and don't change anything to make it affect please

On Mon, Nov 20, 2023, 2:52 AM plaisthos (Code Review) 
wrote:

> Attention is currently required from: flichtenheld.
>
> plaisthos would like flichtenheld to *review* this change.
>
> View Change 
>
> Remove compat versionhelpers.h and remove cmake/configure check for it
>
> The cmake file defined that file to be never present in contrast to the
> old msvc-config.h that always had it present. Also interactive.c includes
> versionhelpers.h without the check, so we always assume it to be present
> anyway. Remove also the comapt implementation taken from mingw
>
> Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a
> ---
> M CMakeLists.txt
> M config.h.cmake.in
> M configure.ac
> M src/compat/Makefile.am
> D src/compat/compat-versionhelpers.h
> M src/openvpn/win32.c
> M src/openvpnserv/interactive.c
> 7 files changed, 1 insertion(+), 131 deletions(-)
>
> git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/445/1
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index d21c9bd..fa6d623 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -308,7 +308,6 @@
>  src/compat/compat-dirname.c
>  src/compat/compat-gettimeofday.c
>  src/compat/compat-strsep.c
> -src/compat/compat-versionhelpers.h
>  src/openvpn/argv.c
>  src/openvpn/argv.h
>  src/openvpn/base64.c
> diff --git a/config.h.cmake.in b/config.h.cmake.in
> index 19b79bc..8edaff4 100644
> --- a/config.h.cmake.in
> +++ b/config.h.cmake.in
> @@ -374,9 +374,6 @@
>  /* Define to 1 if you have the  header file. */
>  #undef HAVE_VALGRIND_MEMCHECK_H
>
> -/* Define to 1 if you have the  header file. */
> -#undef HAVE_VERSIONHELPERS_H
> -
>  /* Define to 1 if you have the `vfork' function. */
>  #undef HAVE_VFORK
>
> diff --git a/configure.ac b/configure.ac
> index 84eaad6..94c6654 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -455,7 +455,6 @@
>   unistd.h dlfcn.h \
>   netinet/in.h \
>   netinet/tcp.h arpa/inet.h netdb.h \
> - versionhelpers.h \
>  ])
>  AC_CHECK_HEADERS([ \
>   sys/time.h sys/ioctl.h sys/stat.h \
> diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am
> index f5de451..5298dd8 100644
> --- a/src/compat/Makefile.am
> +++ b/src/compat/Makefile.am
> @@ -20,5 +20,4 @@
>   compat-basename.c \
>   compat-gettimeofday.c \
>   compat-daemon.c \
> - compat-strsep.c \
> - compat-versionhelpers.h
> + compat-strsep.c
> \ No newline at end of file
> diff --git a/src/compat/compat-versionhelpers.h 
> b/src/compat/compat-versionhelpers.h
> deleted file mode 100644
> index b071602..000
> --- a/src/compat/compat-versionhelpers.h
> +++ /dev/null
> @@ -1,116 +0,0 @@
> -/**
> - * This file is part of the mingw-w64 runtime package.
> - * No warranty is given; refer to the file DISCLAIMER within this package.
> - */
> -
> -#ifndef _INC_VERSIONHELPERS
> -#define _INC_VERSIONHELPERS
> -
> -#include 
> -
> -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__)
> -
> -#ifdef __cplusplus
> -#define VERSIONHELPERAPI inline bool
> -#else
> -#define VERSIONHELPERAPI FORCEINLINE BOOL
> -#endif
> -
> -#define _WIN32_WINNT_WINBLUE0x0603
> -
> -#ifndef _WIN32_WINNT_WINTHRESHOLD
> -#define _WIN32_WINNT_WINTHRESHOLD0x0A00 /* Windows 10 */
> -#endif
> -
> -VERSIONHELPERAPI
> -IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack)
> -{
> -OSVERSIONINFOEXW vi = {sizeof(vi), major, minor, 0, 0, {0}, servpack};
> -return VerifyVersionInfoW(&vi, 
> VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
> -  
> VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
> - 
>  VER_MAJORVERSION, VER_GREATER_EQUAL),
> -  
> VER_MINORVERSION, VER_GREATER_EQUAL),
> -  VER_SERVICEPACKMAJOR, 
> VER_GREATER_EQUAL));
> -}
> -
> -VERSIONHELPERAPI
> -IsWindowsXPOrGreater(void)
> -{
> -return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
> LOBYTE(_WIN32_WINNT_WINXP), 0);
> -}
> -
> -VERSIONHELPERAPI
> -IsWindowsXPSP1OrGreater(void)
> -{
> -return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
> LOBYTE(_WIN32_WINNT_WINXP), 1);
> -}
> -
> -VERSIONHELPERAPI
> -IsWindowsXPSP2OrGreater(void)
> -{
> -return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
> LOBYTE(_WIN32_WINNT_WINXP), 2);
> -}
> -
> -VERSIONHELPERAPI
> -IsWindowsXPSP3OrGreater(void)
> -{
> -return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), 
> LOBYTE(_WIN32_WINNT_WINXP), 3);
> -}
> -
> -VERSIONHELPERAPI
> -IsWindowsVistaOrGreater(void)
> -{
> -return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), 
> LOBYTE(_WIN32_WINNT_VISTA), 0);
> -}
> -
> -VERSIONHELPERAPI
> -IsWindowsVistaSP

[Openvpn-devel] [PATCH applied] Re: Rename state_change to continue_tls_process

2023-12-02 Thread Gert Doering
This is really straightforward rename + added comments.  Gave it a
full test nonetheless :-)

One could argue that the debug print with "tls_process: chg=%d" could
use an adjustment as well ("cont=%d"?).

Your patch has been applied to the master branch.

commit 8ba03f91388970754f3536866f9687759b07a63c (master)
Author: Arne Schwabe
Date:   Tue Nov 28 11:37:04 2023 +0100

 Rename state_change to continue_tls_process

 Acked-by: Frank Lichtenheld 
 Signed-off-by: Arne Schwabe 
 Message-Id: <20231128103704.61046-1-fr...@lichtenheld.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27571.html
 Signed-off-by: Gert Doering 


--
kind regards,

Gert Doering



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [M] Change in openvpn[master]: Rename state_change to continue_tls_process

2023-12-02 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#4) to the change originally created by 
plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/452?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld


Change subject: Rename state_change to continue_tls_process
..

Rename state_change to continue_tls_process

The name state_change is more confusing than helpful as it not really
indicates if there was a state change but rather if processing should
be continued. There even some states that are definitively state changes
(setting to_link buffer) that require continue_tls_process to be set
to false.

Change-Id: Ib6d713f2eb08a4c39d97de3e1a4a832cedc09585
Acked-by: Frank Lichtenheld 
Signed-off-by: Arne Schwabe 
Message-Id: <20231128103704.61046-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27571.html
Signed-off-by: Gert Doering 
---
M src/openvpn/ssl.c
1 file changed, 28 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/52/452/4

diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index b5d24b5..3e3696c 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -2694,7 +2694,7 @@
  */
 static bool
 read_incoming_tls_ciphertext(struct buffer *buf, struct key_state *ks,
- bool *state_change)
+ bool *continue_tls_process)
 {
 int status = 0;
 if (buf->len)
@@ -2714,7 +2714,7 @@
 if (status == 1)
 {
 reliable_mark_deleted(ks->rec_reliable, buf);
-*state_change = true;
+*continue_tls_process = true;
 dmsg(D_TLS_DEBUG, "Incoming Ciphertext -> TLS");
 }
 return true;
@@ -2730,7 +2730,7 @@

 static bool
 read_incoming_tls_plaintext(struct key_state *ks, struct buffer *buf,
-interval_t *wakeup, bool *state_change)
+interval_t *wakeup, bool *continue_tls_process)
 {
 ASSERT(buf_init(buf, 0));

@@ -2744,7 +2744,7 @@
 }
 if (status == 1)
 {
-*state_change = true;
+*continue_tls_process = true;
 dmsg(D_TLS_DEBUG, "TLS -> Incoming Plaintext");

 /* More data may be available, wake up again asap to check. */
@@ -2754,7 +2754,7 @@
 }

 static bool
-write_outgoing_tls_ciphertext(struct tls_session *session, bool *state_change)
+write_outgoing_tls_ciphertext(struct tls_session *session, bool 
*continue_tls_process)
 {
 struct key_state *ks = &session->key[KS_PRIMARY];

@@ -2830,7 +2830,7 @@

 reliable_mark_active_outgoing(ks->send_reliable, buf, opcode);
 INCR_GENERATED;
-*state_change = true;
+*continue_tls_process = true;
 }
 dmsg(D_TLS_DEBUG, "Outgoing Ciphertext -> Reliable");
 }
@@ -2839,7 +2839,6 @@
 return true;
 }

-
 static bool
 tls_process_state(struct tls_multi *multi,
   struct tls_session *session,
@@ -2848,13 +2847,19 @@
   struct link_socket_info *to_link_socket_info,
   interval_t *wakeup)
 {
-bool state_change = false;
+/* This variable indicates if we should call this method
+ * again to process more incoming/outgoing TLS state/data
+ * We want to repeat this until we either determined that there
+ * is nothing more to process or that further processing
+ * should only be done after the outer loop (sending packets etc.)
+ * has run once more */
+bool continue_tls_process = false;
 struct key_state *ks = &session->key[KS_PRIMARY];  /* primary key */

 /* Initial handshake */
 if (ks->state == S_INITIAL)
 {
-state_change = session_move_pre_start(session, ks, false);
+continue_tls_process = session_move_pre_start(session, ks, false);
 }

 /* Are we timed out on receive? */
@@ -2872,7 +2877,7 @@
 if (ks->state == S_PRE_START && reliable_empty(ks->send_reliable))
 {
 ks->state = S_START;
-state_change = true;
+continue_tls_process = true;

 /* New connection, remove any old X509 env variables */
 tls_x509_clear_env(session->opt->es);
@@ -2885,7 +2890,7 @@
 && reliable_empty(ks->send_reliable))
 {
 session_move_active(multi, session, to_link_socket_info, ks);
-state_change = true;
+continue_tls_process = true;
 }

 /* Reliable buffer to outgoing TCP/UDP (send up to CONTROL_SEND_ACK_MAX 
ACKs
@@ -2927,7 +2932,7 @@
 }
 else
 {
-if (!read_incoming_tls_ciphertext(&entry->buf, ks, &state_change))
+if (!read_incoming_tls_ciphertext(&entry->buf, ks, 
&continue_tls_process))
 {
 goto error;
 }
@@ -2938,7 +2943,7 @@
 struct buffer *buf = &ks->plaintext_read_buf;
 if (!buf->len)
 {
-if (!read_incoming_tls_plaintext(ks, buf, wakeup,

[Openvpn-devel] [M] Change in openvpn[master]: Rename state_change to continue_tls_process

2023-12-02 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/452?usp=email )

Change subject: Rename state_change to continue_tls_process
..

Rename state_change to continue_tls_process

The name state_change is more confusing than helpful as it not really
indicates if there was a state change but rather if processing should
be continued. There even some states that are definitively state changes
(setting to_link buffer) that require continue_tls_process to be set
to false.

Change-Id: Ib6d713f2eb08a4c39d97de3e1a4a832cedc09585
Acked-by: Frank Lichtenheld 
Signed-off-by: Arne Schwabe 
Message-Id: <20231128103704.61046-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27571.html
Signed-off-by: Gert Doering 
---
M src/openvpn/ssl.c
1 file changed, 28 insertions(+), 23 deletions(-)




diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index b5d24b5..3e3696c 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -2694,7 +2694,7 @@
  */
 static bool
 read_incoming_tls_ciphertext(struct buffer *buf, struct key_state *ks,
- bool *state_change)
+ bool *continue_tls_process)
 {
 int status = 0;
 if (buf->len)
@@ -2714,7 +2714,7 @@
 if (status == 1)
 {
 reliable_mark_deleted(ks->rec_reliable, buf);
-*state_change = true;
+*continue_tls_process = true;
 dmsg(D_TLS_DEBUG, "Incoming Ciphertext -> TLS");
 }
 return true;
@@ -2730,7 +2730,7 @@

 static bool
 read_incoming_tls_plaintext(struct key_state *ks, struct buffer *buf,
-interval_t *wakeup, bool *state_change)
+interval_t *wakeup, bool *continue_tls_process)
 {
 ASSERT(buf_init(buf, 0));

@@ -2744,7 +2744,7 @@
 }
 if (status == 1)
 {
-*state_change = true;
+*continue_tls_process = true;
 dmsg(D_TLS_DEBUG, "TLS -> Incoming Plaintext");

 /* More data may be available, wake up again asap to check. */
@@ -2754,7 +2754,7 @@
 }

 static bool
-write_outgoing_tls_ciphertext(struct tls_session *session, bool *state_change)
+write_outgoing_tls_ciphertext(struct tls_session *session, bool 
*continue_tls_process)
 {
 struct key_state *ks = &session->key[KS_PRIMARY];

@@ -2830,7 +2830,7 @@

 reliable_mark_active_outgoing(ks->send_reliable, buf, opcode);
 INCR_GENERATED;
-*state_change = true;
+*continue_tls_process = true;
 }
 dmsg(D_TLS_DEBUG, "Outgoing Ciphertext -> Reliable");
 }
@@ -2839,7 +2839,6 @@
 return true;
 }

-
 static bool
 tls_process_state(struct tls_multi *multi,
   struct tls_session *session,
@@ -2848,13 +2847,19 @@
   struct link_socket_info *to_link_socket_info,
   interval_t *wakeup)
 {
-bool state_change = false;
+/* This variable indicates if we should call this method
+ * again to process more incoming/outgoing TLS state/data
+ * We want to repeat this until we either determined that there
+ * is nothing more to process or that further processing
+ * should only be done after the outer loop (sending packets etc.)
+ * has run once more */
+bool continue_tls_process = false;
 struct key_state *ks = &session->key[KS_PRIMARY];  /* primary key */

 /* Initial handshake */
 if (ks->state == S_INITIAL)
 {
-state_change = session_move_pre_start(session, ks, false);
+continue_tls_process = session_move_pre_start(session, ks, false);
 }

 /* Are we timed out on receive? */
@@ -2872,7 +2877,7 @@
 if (ks->state == S_PRE_START && reliable_empty(ks->send_reliable))
 {
 ks->state = S_START;
-state_change = true;
+continue_tls_process = true;

 /* New connection, remove any old X509 env variables */
 tls_x509_clear_env(session->opt->es);
@@ -2885,7 +2890,7 @@
 && reliable_empty(ks->send_reliable))
 {
 session_move_active(multi, session, to_link_socket_info, ks);
-state_change = true;
+continue_tls_process = true;
 }
 
 /* Reliable buffer to outgoing TCP/UDP (send up to CONTROL_SEND_ACK_MAX 
ACKs
@@ -2927,7 +2932,7 @@
 }
 else
 {
-if (!read_incoming_tls_ciphertext(&entry->buf, ks, &state_change))
+if (!read_incoming_tls_ciphertext(&entry->buf, ks, 
&continue_tls_process))
 {
 goto error;
 }
@@ -2938,7 +2943,7 @@
 struct buffer *buf = &ks->plaintext_read_buf;
 if (!buf->len)
 {
-if (!read_incoming_tls_plaintext(ks, buf, wakeup, &state_change))
+if (!read_incoming_tls_plaintext(ks, buf, wakeup, 
&continue_tls_process))
 {
 goto error;
 }
@@ -2954,7 +2959,7 @@
 goto error;
 }

-