Skip to contentSkip to conversation

Support for username-only auth file.

PATCH New Michal Ludvig 3 participants 4 messages Jul 15, 2013 – Nov 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Support for username-only auth file.

Make OpenVPN read the username from the auth file parameter of --auth-user-pass and prompt for a password if it's not in the file.

Rationale: Prior to this change OpenVPN either required both username and password present in the auth file or prompted for both on the console. Unlike passwords usernames usually don't change and can therefore be "hardcoded" in the config.

---
 doc/openvpn.8         |   3 +-
 src/openvpn/misc.c    | 110 ++++++++++++++++++++++++++------------------------
 src/openvpn/options.c |   3 +-
 3 files changed, 62 insertions(+), 54 deletions(-)
doc/openvpn.8 +2 -1
index f74fe81..7ea204d 100644
@@ -3601,7 +3601,8 @@ over the client's routing table.
 .B \-\-auth-user-pass [up]
 Authenticate with server using username/password.
 .B up
-is a file containing username/password on 2 lines (Note: OpenVPN
+is a file containing username/password on 2 lines. If the
+password line is missing OpenVPN will prompt for one. (Note: OpenVPN
 will only read passwords from a file if it has been built
 with the \-\-enable-password-save configure option, or on Windows
 by defining ENABLE_PASSWORD_SAVE in win/settings.in).
src/openvpn/misc.c +58 -52

149 lines not on this page · raw message

src/openvpn/options.c +2 -1
index 2191916..dc445dd 100644
@@ -495,7 +495,8 @@ static const char usage_message[] =
   "--client         : Helper option to easily configure client mode.\n"
   "--auth-user-pass [up] : Authenticate with server using username/password.\n"
   "                  up is a file containing username/password on 2 lines,\n"
-  "                  or omit to prompt from console.\n"
+  "                  or provide only username on one line and be prompted\n"
+  "                  for password or omit to prompt for both from console.\n"
   "--pull           : Accept certain config file options from the peer as if they\n"
   "                  were part of the local config file.  Must be specified\n"
   "                  when connecting to a '--mode server' remote host.\n"
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 Support for username-only auth file.

Make OpenVPN read the username from the auth file parameter of --auth-user-pass and prompt for a password if it's not in the file.

Rationale: Prior to this change OpenVPN either required both username and password present in the auth file or prompted for both on the console. Unlike passwords usernames usually don't change and can therefore be "hardcoded" in the config.

Reviewed and updated to current master.

---
 doc/openvpn.8         |   3 +-
 src/openvpn/misc.c    | 110 ++++++++++++++++++++++++++------------------------
 src/openvpn/options.c |   6 ++-
 3 files changed, 64 insertions(+), 55 deletions(-)
doc/openvpn.8 +2 -1
index 422b426..1b7606c 100644
@@ -3754,7 +3754,8 @@ over the client's routing table.
 .B \-\-auth\-user\-pass [up]
 Authenticate with server using username/password.
 .B up
-is a file containing username/password on 2 lines (Note: OpenVPN
+is a file containing username/password on 2 lines. If the
+password line is missing, OpenVPN will prompt for one. (Note: OpenVPN
 will only read passwords from a file if it has been built
 with the \-\-enable\-password\-save configure option, or on Windows
 by defining ENABLE_PASSWORD_SAVE in win/settings.in).
src/openvpn/misc.c +58 -52

149 lines not on this page · raw message

src/openvpn/options.c +4 -2
index 86b7a83..d7e1edf 100644
@@ -479,8 +479,10 @@ static const char usage_message[] =
   "Client options (when connecting to a multi-client server):\n"
   "--client         : Helper option to easily configure client mode.\n"
   "--auth-user-pass [up] : Authenticate with server using username/password.\n"
-  "                  up is a file containing username/password on 2 lines,\n"
-  "                  or omit to prompt from console.\n"
+  "                  up is a file containing the username on the first line,\n"
+  "                  and a password on the second. If either the password or both\n"
+  "                  the username and the password are omitted OpenVPN will prompt\n"
+  "                  for them from console.\n"
   "--pull           : Accept certain config file options from the peer as if they\n"
   "                  were part of the local config file.  Must be specified\n"
   "                  when connecting to a '--mode server' remote host.\n"
Signature · 1 line
2.1.4
#2 lore raw

Hi,

Quoted 3 lines · Adriaan de Jong

Make OpenVPN read the username from the auth file
parameter of --auth-user-pass and prompt for a
password if it's not in the file.

ACK, applied and merged to master.

commit 6e9373c84639382c16d9eb8f1f78f60079bb89df

Author: Michal Ludvig <[email protected]...>
Date:   Sun Oct 11 10:44:20 2015 +0200
    Support for username-only auth file.

    Signed-off-by: Michal Ludvig <[email protected]...>
    
    Reviewed and updated to current master.
    
    Signed-off-by: Adriaan de Jong <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>
    Message-Id: <[email protected]...>
    URL: http://article.gmane.org/gmane.network.openvpn.devel/10255

(I have changed --author to point to Michal, as he's the original author, even if the rebased patch from Adriaan says "From: Adriaan de Jong"
- contributor's history is clear enough from the commit message, I think)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#3 lore raw

Hi,

Quoted 10 lines · Gert Doering
Quoted 3 lines · Adriaan de Jong

Make OpenVPN read the username from the auth file
parameter of --auth-user-pass and prompt for a
password if it's not in the file.

ACK, applied and merged to master.

commit 6e9373c84639382c16d9eb8f1f78f60079bb89df

Author: Michal Ludvig <[email protected]...>
Date:   Sun Oct 11 10:44:20 2015 +0200

... and cherry-picked to release/2.3 - useful feature, fairly non-intrusive patch.

commit 76b82f0e9d272a703624b102bd2e2b38d9947afb

Author: Michal Ludvig <[email protected]...>
Date:   Sun Oct 11 10:44:20 2015 +0200

Support for username-only auth file.

(as discussed in the IRC meeting just now)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...