summaryrefslogtreecommitdiff
path: root/src/openvpn/proxy.c
diff options
context:
space:
mode:
authorBernhard Schmidt <Bernhard.Schmidt@lrz.de>2018-03-04 22:55:51 +0100
committerBernhard Schmidt <Bernhard.Schmidt@lrz.de>2018-03-04 22:55:51 +0100
commit4afa7ed562410a1170223a7bc06efb3708af6a36 (patch)
treeb895b41b7629c9a31de5cc15e7aa7805ddac87ce /src/openvpn/proxy.c
parenta6daf938f5f616a4a67caa6580b0c99e9a8c3779 (diff)
New upstream version 2.4.5upstream/2.4.5
Diffstat (limited to 'src/openvpn/proxy.c')
-rw-r--r--src/openvpn/proxy.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c
index 2e81503..3fdec86 100644
--- a/src/openvpn/proxy.c
+++ b/src/openvpn/proxy.c
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -253,9 +253,24 @@ username_password_as_base64(const struct http_proxy_info *p,
}
static void
+clear_user_pass_http(void)
+{
+ purge_user_pass(&static_proxy_user_pass, true);
+}
+
+static void
get_user_pass_http(struct http_proxy_info *p, const bool force)
{
- if (!static_proxy_user_pass.defined || force)
+ /*
+ * in case of forced (re)load, make sure the static storage is set as
+ * undefined, otherwise get_user_pass() won't try to load any credential
+ */
+ if (force)
+ {
+ clear_user_pass_http();
+ }
+
+ if (!static_proxy_user_pass.defined)
{
unsigned int flags = GET_USER_PASS_MANAGEMENT;
if (p->queried_creds)
@@ -274,11 +289,6 @@ get_user_pass_http(struct http_proxy_info *p, const bool force)
p->up = static_proxy_user_pass;
}
}
-static void
-clear_user_pass_http(void)
-{
- purge_user_pass(&static_proxy_user_pass, true);
-}
#if 0
/* function only used in #if 0 debug statement */