From: "cron2 (Code Review)" Date: Mon, 22 Jan 2024 12:46:54 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="1SCq+m6abe4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: --http-proxy-user-pass: allow to specify in either order with --http-... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --1SCq+m6abe4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/499?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: --http-proxy-user-pass: allow to specify in either order wi= th --http-proxy ...................................................................... --http-proxy-user-pass: allow to specify in either order with --http-proxy Previously, when using a third argument to --http-proxy other than auto/auto-nct, order did matter between --http-proxy and --http-proxy-user-pass. Always prefer --http-proxy-user-pass when given. Change-Id: I6f402db2fb73f1206fbc1139c47d2bf4378376fa Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Message-Id: <20240122092122.8591-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28= 099.html Signed-off-by: Gert Doering --- M src/openvpn/options.c M src/openvpn/proxy.c M src/openvpn/proxy.h 3 files changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/99/499/2 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 6975cbe..2c79a1e 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1649,6 +1649,8 @@ SHOW_STR(port); SHOW_STR(auth_method_string); SHOW_STR(auth_file); + SHOW_STR(auth_file_up); + SHOW_BOOL(inline_creds); SHOW_STR(http_version); SHOW_STR(user_agent); for (i =3D 0; i < MAX_CUSTOM_HTTP_HEADER && o->custom_headers[i].name= ; i++) @@ -6833,7 +6835,7 @@ struct http_proxy_options *ho; VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_INLINE); ho =3D init_http_proxy_options_once(&options->ce.http_proxy_option= s, &options->gc); - ho->auth_file =3D p[1]; + ho->auth_file_up =3D p[1]; ho->inline_creds =3D is_inline; } else if (streq(p[0], "http-proxy-retry") || streq(p[0], "socks-proxy-r= etry")) diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c index 2e8d7a8..eeb3989 100644 --- a/src/openvpn/proxy.c +++ b/src/openvpn/proxy.c @@ -271,6 +271,11 @@ if (!static_proxy_user_pass.defined) { unsigned int flags =3D GET_USER_PASS_MANAGEMENT; + const char *auth_file =3D p->options.auth_file; + if (p->options.auth_file_up) + { + auth_file =3D p->options.auth_file_up; + } if (p->queried_creds) { flags |=3D GET_USER_PASS_PREVIOUS_CREDS_FAILED; @@ -280,7 +285,7 @@ flags |=3D GET_USER_PASS_INLINE_CREDS; } get_user_pass(&static_proxy_user_pass, - p->options.auth_file, + auth_file, UP_TYPE_PROXY, flags); p->queried_creds =3D true; diff --git a/src/openvpn/proxy.h b/src/openvpn/proxy.h index 7900244..4e78772 100644 --- a/src/openvpn/proxy.h +++ b/src/openvpn/proxy.h @@ -52,10 +52,11 @@ const char *auth_method_string; const char *auth_file; + const char *auth_file_up; /* specified with --http-proxy-user-pass */ const char *http_version; const char *user_agent; struct http_custom_header custom_headers[MAX_CUSTOM_HTTP_HEADER]; - bool inline_creds; + bool inline_creds; /* auth_file_up is inline credentials */ }; struct http_proxy_options_simple { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/499?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I6f402db2fb73f1206fbc1139c47d2bf4378376fa Gerrit-Change-Number: 499 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --1SCq+m6abe4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by cron2

--http-proxy-user-pass: allow to specify in either o=
rder with --http-proxy

Previously, when using a third argument to --= http-proxy other
than auto/auto-nct, order did matter between --http-pro= xy and
--http-proxy-user-pass. Always prefer --http-proxy-user-pass
w= hen given.

Change-Id: I6f402db2fb73f1206fbc1139c47d2bf4378376fa
S= igned-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Gert = Doering <gert@...1296...>
Message-Id: <20240122092122.8591-1-ge= rt@...1296...>
URL: https://www.mail-archive.com/openvpn-devel@...1199...= sourceforge.net/msg28099.html
Signed-off-by: Gert Doering <gert@...1711...= 96...>
---
M src/openvpn/options.c
M src/openvpn/proxy.c
M s= rc/openvpn/proxy.h
3 files changed, 11 insertions(+), 3 deletions(-)
=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/99/499/=
2
diff --git a/src/openvpn/options.c b/src/openvpn/options.c=

index 6975cbe..2c79a1e 100644
--- a/src/openvpn/o= ptions.c
+++ b/src/openvpn/options.c
@@ -16= 49,6 +1649,8 @@
SHOW_STR(port);
S= HOW_STR(auth_method_string);
SHOW_STR(auth_file);
+ SHOW_STR(auth_file_u= p);
+ SHOW_BOOL(in= line_creds);
SHOW_STR(http_version);
= SHOW_STR(user_agent);
for (i =3D 0; i < MAX_CU= STOM_HTTP_HEADER && o->custom_headers[i].name; i++)
@@ -6833,7 +6835,7 @@

struct http_proxy_option= s *ho;
VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_INLIN= E);
ho =3D init_http_proxy_options_once(&optio= ns->ce.http_proxy_options, &options->gc);
- ho->auth_file =3D p[1];+ ho->auth_file_up = =3D p[1];
ho->inline_creds =3D is_inline;
}
else if (streq(p[0], "http-prox= y-retry") || streq(p[0], "socks-proxy-retry"))
diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c

i= ndex 2e8d7a8..eeb3989 100644
--- a/src/openvpn/proxy.c
+++ b/src/openvpn/proxy.c
@@ -271,6 +271,11 @@<= /span>
if (!static_proxy_user_pass.defined)
= {
unsigned int flags =3D GET_USER_PASS_MANAGEM= ENT;
+ const c= har *auth_file =3D p->options.auth_file;
+ if (p->options.auth_file_up)
<= span style=3D"color: hsl(120, 100%, 40%);">+ {

+ auth_file =3D p->options.a= uth_file_up;
+ = }
if (p->queried_creds)
= {
flags |=3D GET_USER_PASS_PREVIOUS_CREDS_F= AILED;
@@ -280,7 +285,7 @@
fla= gs |=3D GET_USER_PASS_INLINE_CREDS;
}
get_user_pass(&static_proxy_user_pass,

- p->options.auth_= file,
+ = auth_file,
UP_TYPE_PROXY,
flags);
p->= ;queried_creds =3D true;
diff --git a/src/openvpn/proxy.h b= /src/openvpn/proxy.h
index 7900244..4e78772 100644--- a/src/openvpn/proxy.h
+++ b/src/openvpn/proxy.h=
@@ -52,10 +52,11 @@

= const char *auth_method_string;
const char *auth_file= ;
+ const char *au= th_file_up; /* specified with --http-proxy-user-pass */
= const char *http_version;
const char *user_agent;
struct http_custom_header custom_headers[MAX_CUSTOM_HTTP= _HEADER];
- bool inl= ine_creds;
+ bool = inline_creds; /* auth_file_up is inline credentials */
};<= /span>

struct http_proxy_options_simple {

To view, visit change 499. To unsubscribe, or for= help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6f402db2fb73f1206fbc1139c47= d2bf4378376fa
Gerrit-Change-Number: 499
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--1SCq+m6abe4=--