Skip to contentSkip to conversation

Fix IV_PLAT_VER and UV_ variables sent without push-peer-info

PATCH Superseded Arne Schwabe 3 participants 4 messages Mar 16, 2022 – Aug 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix IV_PLAT_VER and UV_ variables sent without push-peer-info

Commit 8c72d7981 changed the push_peer_info_detail to have an additional level for P2P NCP and shifting most of the other levels with 1. The check for UV_ and IV_PLAT_VER was not changed accordingly.

---
 src/openvpn/ssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl.c +1 -1
index ca028856..87b476b2 100644
@@ -2255,7 +2255,7 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
                 {
                     if ((((strncmp(e->string, "UV_", 3) == 0
                         || strncmp(e->string, "IV_PLAT_VER=", sizeof("IV_PLAT_VER=") - 1) == 0)
-                        && session->opt->push_peer_info_detail >= 2)
+                        && session->opt->push_peer_info_detail > 2)
                         || (strncmp(e->string, "IV_GUI_VER=", sizeof("IV_GUI_VER=") - 1) == 0)
                         || (strncmp(e->string, "IV_SSO=", sizeof("IV_SSO=") - 1) == 0)
                     )
Signature · 1 line
2.33.0
#1 lore raw

PATCH v2 1/1 Fix IV_PLAT_VER and UV_ variables sent without push-peer-info

Commit 8c72d7981 changed the push_peer_info_detail to have an additional level for P2P NCP and shifting most of the other levels with 1. The check for UV_ and IV_PLAT_VER was not changed accordingly.

Fixes 8c72d7981 ("Support NCP in pure P2P VPN setups")
---
 src/openvpn/ssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl.c +1 -1
index 77f572a40..33e145b3f 100644
@@ -2036,7 +2036,7 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
                 {
                     if ((((strncmp(e->string, "UV_", 3) == 0
                            || strncmp(e->string, "IV_PLAT_VER=", sizeof("IV_PLAT_VER=") - 1) == 0)
-                          && session->opt->push_peer_info_detail >= 2)
+                          && session->opt->push_peer_info_detail > 2)
                          || (strncmp(e->string, "IV_GUI_VER=", sizeof("IV_GUI_VER=") - 1) == 0)
                          || (strncmp(e->string, "IV_SSO=", sizeof("IV_SSO=") - 1) == 0)
                          )
Signature · 1 line
2.32.1 (Apple Git-133)
Acked-by on v2 1/1
#2 lore raw

Hi,

Quoted 6 lines · Arne Schwabe

Commit 8c72d7981 changed the push_peer_info_detail to have an additional level for P2P NCP and shifting most of the other levels with 1. The check for UV_ and IV_PLAT_VER was not changed accordingly.

Fixes 8c72d7981 ("Support NCP in pure P2P VPN setups")

Same as v1, just rebased and with an extended commit message.

Tested by setting some UV_VAR and seeing it being sent only with --push-peer-info.

Quoted 17 lines
---
  src/openvpn/ssl.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl.c +1 -1
index 77f572a40..33e145b3f 100644
@@ -2036,7 +2036,7 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
                  {
                      if ((((strncmp(e->string, "UV_", 3) == 0
                             || strncmp(e->string, "IV_PLAT_VER=", sizeof("IV_PLAT_VER=") - 1) == 0)
-                          && session->opt->push_peer_info_detail >= 2)
+                          && session->opt->push_peer_info_detail > 2)
                           || (strncmp(e->string, "IV_GUI_VER=", sizeof("IV_GUI_VER=") - 1) == 0)
                           || (strncmp(e->string, "IV_SSO=", sizeof("IV_SSO=") - 1) == 0)
                           )
Signature · 1 line
Antonio Quartulli
#3 lore raw
In reply to Arne Schwabe

I have not tested this, but it's obvious enough from the changes in said commit.

Your patch has been applied to the master branch.

commit e0dbe5c4e290c0c24a26a9e5c19957ebaca09543

Author: Arne Schwabe
Date:   Wed Aug 17 15:53:48 2022 +0200
     Fix IV_PLAT_VER and UV_ variables sent without push-peer-info

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Antonio Quartulli <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24956.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering