summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/openvpn/init.c6
-rw-r--r--src/openvpn/init.h5
-rw-r--r--src/openvpn/openvpn.c5
3 files changed, 11 insertions, 5 deletions
diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 13f5612..c24a646 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -407,8 +407,8 @@ next_connection_entry (struct context *c)
/*
* Query for private key and auth-user-pass username/passwords
*/
-static void
-init_query_passwords (struct context *c)
+void
+init_query_passwords (const struct context *c)
{
#ifdef ENABLE_CRYPTO
/* Certificate password input */
@@ -502,8 +502,6 @@ context_init_1 (struct context *c)
init_connection_list (c);
- init_query_passwords (c);
-
#if defined(ENABLE_PKCS11)
if (c->first_time) {
int i;
diff --git a/src/openvpn/init.h b/src/openvpn/init.h
index d1908ed..a819bd2 100644
--- a/src/openvpn/init.h
+++ b/src/openvpn/init.h
@@ -63,6 +63,11 @@ void init_instance_handle_signals (struct context *c, const struct env_set *env,
void init_instance (struct context *c, const struct env_set *env, const unsigned int flags);
+/**
+ * Query for private key and auth-user-pass username/passwords.
+ */
+void init_query_passwords (const struct context *c);
+
void do_route (const struct options *options,
struct route_list *route_list,
struct route_ipv6_list *route_ipv6_list,
diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c
index 00bd570..d05acde 100644
--- a/src/openvpn/openvpn.c
+++ b/src/openvpn/openvpn.c
@@ -228,7 +228,10 @@ openvpn_main (int argc, char *argv[])
/* test crypto? */
if (do_test_crypto (&c.options))
break;
-
+
+ /* Query passwords before becoming a daemon */
+ init_query_passwords (&c);
+
/* become a daemon if --daemon */
if (c.first_time)
{