Skip to contentSkip to conversation

AUTH_PENDING docs and related

PATCH In review [email protected]... 4 participants 10 messages Jun 2, 2021 – Jun 15, 2021

lore
Share & tools
lore
#0 lore raw

cover AUTH_PENDING docs and related

From: Selva Nair <[email protected]...>

I couldn't figure out the details of how to use CR_TEXT or OPEN_URL from the docs. This is an attempt to improve the documentation based on my reading of the sources and some guess-work.

I might have edited somethings wrongly. If so, please correct.

Also found a minor parsing bug that will trigger only if the client announces more than two keywords in IV_SSO.

Question: is the IV_SSO the keyword for PROXY_URL named proxy_url or proxyurl or url_proxy? I would ahve guessed "proxyurl" based on crtext and openurl but have settled for proxy_url. If there is no established convention as yet, I suggest proxyurl without the _.

Selva Nair (2):
Improve documentation of AUTH_PENDING related directives Fix parsing of IV_SSO string

 doc/man-sections/server-options.rst |   4 ++
 doc/management-notes.txt            | 101 +++++++++++++++++-----------
 src/openvpn/ssl_verify.c            |   2 +-
 3 files changed, 68 insertions(+), 39 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 Improve documentation of AUTH_PENDING related directives

From: Selva Nair <[email protected]...>

Also fix some typos.

---
 doc/man-sections/server-options.rst |   4 ++
 doc/management-notes.txt            | 101 +++++++++++++++++-----------
 2 files changed, 67 insertions(+), 38 deletions(-)
doc/man-sections/server-options.rst +4 -0
index 036323b9..047f2270 100644
@@ -460,6 +460,10 @@ fast hardware. SSL/TLS authentication must be used in this mode.
         The UI version of a UI if one is running, for example
         :code:`de.blinkt.openvpn 0.5.47` for the Android app.
 
+  :code:`IV_SSO=[crtext,][openurl,][proxy_url]`
+        Additional authentication methods supported by the client.
+        This may be set by the client UI/GUI using ``--setenv``
+
   When ``--push-peer-info`` is enabled the additional information consists
   of the following data:
 
doc/management-notes.txt +63 -38

215 lines not on this page · raw message

Signature · 1 line
2.20.1
#5 lore raw

PATCH 2/2 Fix parsing of IV_SSO string

In reply to [email protected]...

From: Selva Nair <[email protected]...>

Expect comma separated keywords

---
 src/openvpn/ssl_verify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl_verify.c +1 -1
index 0b41eea2..512b4f72 100644
@@ -913,7 +913,7 @@ check_auth_pending_method(const char *peer_info, const char *method)
             supported = true;
             break;
         }
-        client_method = strtok(NULL, ":");
+        client_method = strtok(NULL, ",");
     }
 
     gc_free(&gc);
Signature · 1 line
2.20.1
#2 lore raw

Re: [Openvpn-devel] [PATCH 1/2] Improve documentation of AUTH_PENDING related directives

In reply to [email protected]...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Him

I read through it and it looks good to me.
One tiny omission inserted: Scroll to end.

Regards
R

Sent with ProtonMail Secure Email. Which still can't handle patches.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Quoted 223 lines · On Wednesday, 2 June 2021 04:42, <[email protected]...> wrote:

From: Selva Nair [email protected]...

Also fix some typos.

doc/man-sections/server-options.rst | 4 ++ doc/management-notes.txt | 101 +++++++++++++++++-----------

2 files changed, 67 insertions(+), 38 deletions(-)
doc/man-sections/server-options.rst +0 -0
index 036323b9..047f2270 100644
@@ -460,6 +460,10 @@ fast hardware. SSL/TLS authentication must be used in this mode.

The UI version of a UI if one is running, for example :code:de.blinkt.openvpn 0.5.47 for the Android app.

doc/man-sections/server-options.rst +1 -5
-   :code:`IV_SSO=[crtext,][openurl,][proxy_url]`
-          Additional authentication methods supported by the client.
 
 
-          This may be set by the client UI/GUI using ``--setenv``
 
 
-   When `--push-peer-info` is enabled the additional information consists
    of the following data:
 
    diff --git a/doc/management-notes.txt b/doc/management-notes.txt
    index 3aff6eb6..9f064764 100644
    --- a/doc/management-notes.txt
    +++ b/doc/management-notes.txt
    @@ -199,7 +199,7 @@ Command examples:
    COMMAND -- kill
 
 
-In server mode, kill a particlar client instance.
+In server mode, kill a particular client instance.

Command examples:

doc/man-sections/server-options.rst +0 -0
@@ -407,6 +407,7 @@ RECONNECTING -- A restart has occurred.

EXITING -- A graceful exit is in progress. RESOLVE -- (Client only) DNS lookup TCP_CONNECT -- (Client only) Connecting to TCP server +AUTH_PENDING -- (Client only) Authentication pending

Command examples:

doc/man-sections/server-options.rst +0 -0
@@ -437,6 +438,11 @@ Fields (e)-(h) are shown for CONNECTED state,

(e) is available starting from OpenVPN 2.1
(f)-(i) are available starting from OpenVPN 2.4

doc/man-sections/server-options.rst +5 -0
+For AUTH_PENDING, if (c) is present, it would read
+as "timeout number" where number is the number of seconds
+before authentication will timeout. It is printed as an
+unsigned integer (%u).
+

Real-time state notifications will have a ">STATE:" prefix prepended to them.

doc/man-sections/server-options.rst +0 -0
@@ -608,7 +614,7 @@ COMMAND -- client-pending-auth (OpenVPN 2.5 or higher)

Instruct OpenVPN server to send AUTH_PENDING and INFO_PRE message to signal a pending authenticating to the client. A pending auth means that the connecting requires extra authentication like a one time

doc/man-sections/server-options.rst +1 -1
-password or doing a single sign one via web.
+password or doing a single sign on via web.

client-pending-auth {CID} {EXTRA} {TIMEOUT}

doc/man-sections/server-options.rst +0 -0
@@ -624,22 +630,22 @@ the timeout proposed by the server, even if the timeout is shorter.

If the client does not receive a packet from the server for hand-window the connection times out regardless of the timeout. This ensures that the connection still times out relatively quickly in case of network problems. The client will

doc/man-sections/server-options.rst +1 -1
-continously send PULL_REQUEST messages to the server until the timeout is reached.
+continuously send PULL_REQUEST messages to the server until the timeout is reached.

This message also triggers an ACK message from the server that resets the hand-window based timeout.

Both client and server limit the maximum timeout to the smaller value of half the --tls-reneg minimum time and --hand-window time (defaults to 60s).

doc/man-sections/server-options.rst +1 -1
-For the format of EXTRA see below. For the OpenVPN server this is a stateless
+For the format of {EXTRA} see below. For OpenVPN server this is a stateless

operation and needs to be followed by a client-deny/client-auth[-nt] command (that is the result of the out of band authentication).

Before issuing a client-pending-auth to a client instead of a client-auth/client-deny, the server should check the IV_SSO

doc/man-sections/server-options.rst +3 -3
-environment variable if the method is support. The currently
-defined method are crtext for challenge/response using text
-(e.g. TOTP), openurl and proxy_url for opening an URL in the client to
+environment variable for whether the method is supported. Currently
+defined methods are crtext for challenge/response using text
+(e.g., TOTP), openurl and proxy_url for opening a URL in the client to

continue authentication. A client supporting the first two methods would set

doc/man-sections/server-options.rst +0 -0
@@ -649,17 +655,30 @@ The variable name IV_SSO is historic as AUTH_PENDING was first used

to signal single sign on support. To keep compatibility with existing implementations the name IV_SSO is kept in lieu of a better name.

doc/man-sections/server-options.rst +11 -2
+The management interface of the client receives notification of
+pending auth via
+
+>STATE:datetime,AUTH_PENDING,[timeout number]
 
-
 
+If {EXTRA} is present the client is informed using INFOMSG
+notification as
+
+>INFOMSG:{EXTRA}
 
-
 
+where {EXTRA} is formatted as received from the server.
+Currently defined formats for {EXTRA} are detailed below.
+

openurl

==============================================================================================================================

For a web based extra authentication (like for

doc/man-sections/server-options.rst +1 -1
-SSO/SAML) EXTRA should be
+SSO/SAML) {EXTRA} should be

OPEN_URL:url

doc/man-sections/server-options.rst +1 -1
-and client should ask to the user to open the URL to continue.
+and client should ask the user to open the URL to continue.

The space in a control message is limited, so this url should be kept

doc/man-sections/server-options.rst +1 -1
-short to avoid issues. If a loger url is required a URL that redirects
+short to avoid issues. If a longer url is required a URL that redirects

to the longer URL should be sent instead.

A complete documentation how URLs should be handled on the client is available

doc/man-sections/server-options.rst +0 -0
@@ -667,17 +686,18 @@ in the openvpn3 repository:
 

https://github.com/OpenVPN/openvpn3/blob/master/doc/webauth.md

doc/man-sections/server-options.rst +1 -1
-url_proxy
+proxy_url

==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

doc/man-sections/server-options.rst +5 -4
-To avoid issues with OpenVPN connection persist-tun and not able
-to reach the web server, a variant of openurl via a HTTPS
-Proxy exists. The client should announce url_proxy in its IV_SSO
-and parse the PROXY_URL message. The format is
+This is a variant of openurl that allows opening a url via an
+HTTP proxy. It could be used to avoid issues with OpenVPN connection's
+persist-tun that may cause the web server to be unreachable.
+The client should announce proxy_url in its IV_SSO and parse the
+PROXY_URL message. The format of {EXTRA} in this case is

PROXY_URL:<proxy>:<proxy_port>:<proxyuser_base64>:<proxy_password_base64>:url

doc/man-sections/server-options.rst +2 -2
-The proxy should be a literal IPv4 address or IPv6 address in [] to avoid
-ambiguity in parsing. A literal IP address is preferred as DNS might not be
+The proxy should be a literal IPv4 address or IPv6 address enclosed in [] to avoid
+ambiguity in parsing. A literal IP address is preferred as DNS might not be

available when the client needs to open the url. The IP address will usually be the address that client uses to connect to the VPN server. For dual-homed VPN servers, the server should respond with the same address that the client

doc/man-sections/server-options.rst +0 -0
@@ -685,19 +705,18 @@ connects to.
 

This address is also usually excluded from being redirected over the VPN by a host route. If the platform (like Android) uses another way of protecting

doc/man-sections/server-options.rst +1 -1
-the VPN connection routing loops the client needs to also exclude the
+the VPN connection from routing loops, the client needs to also exclude the

connection to the proxy in the same manner.

Should another IP be used, then the VPN configuration should include a route

doc/man-sections/server-options.rst +1 -1
-statement to exclude that route from being routed over the VPN.
+statement to exclude that address from being routed over the VPN.

crtext

========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

doc/man-sections/server-options.rst +1 -2
-
 
-The format of EXTRA is similar to the already used two step authentication
+The format of {EXTRA} is similar to the already used two step authentication

described in Challenge/Response Protocol section of this document. Since

doc/man-sections/server-options.rst +2 -2
-most of the fields are not necessary or can be infered only the <flags>
-and <challgenge_text> fields are used:
+most of the fields are not necessary or can be inferred, only the <flags>
+and <challenge_text> fields are used:

CR_TEXT:<flags>:<challenge_text>

doc/man-sections/server-options.rst +0 -0
@@ -707,7 +726,8 @@ and <challgenge_text> fields are used:
 

<challenge_text>: the challenge text to be shown to the user.

--

doc/man-sections/server-options.rst +2 -0
+The client should return the response to the crtext challenge
+using the cr-response command.

COMMAND -- client-deny (OpenVPN 2.1 or higher)

-----------------------------------------------------------------------------------------------------------------------------------------------

doc/man-sections/server-options.rst +3 -3
@@ -925,17 +945,18 @@ To accept connecting to the host and port directly, use this command:
 
 COMMAND -- cr-response (OpenVPN 2.5 or higher)
 
--------------------------------------------------------------------------------------------------------------------------------------------
 
-Provides support for sending responses a challenge/response
-query via INFOMSG,CR_TEXT. The response should be base64 encoded:
+Provides support for sending responses to a challenge/response
+query via INFOMSG,CR_TEXT (client-only). The response should
+be base64 encoded:
 

cr-response SGFsbG8gV2VsdCE=

doc/man-sections/server-options.rst +0 -2
-The document is intended to be used after the client received a
-CR_TEXT challenge (see send-pending-auth section). The answer is

doc/man-sections/server-options.rst

Quoted 10 lines
doc/man-sections/server-options.rst +4 -4
-the answer to the challenge and depends on the challenge itself
-for a TOTP challenge this would the number encoded as base64 or
-just a string for a challenge like "what day is it today?".
 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
+This command is intended to be used after the client receives a
+CR_TEXT challenge (see client-pending-auth section). The argument
+to cr-response is the base64 encoded answer to the challenge and
+depends on the challenge itself. For a TOTP challenge this would

Insert "be" after "this would" (Otherwise it is a bit Yoda)

doc/man-sections/server-options.rst

Quoted 3 lines
doc/man-sections/server-options.rst +2 -0
+a number encoded as base64; for a challenge like "what day is it today?"
+it would be a string encoded as base64.

-----BEGIN PGP SIGNATURE-----
Version: ProtonMail

wsBzBAEBCAAGBQJgt1K5ACEJEE+XnPZrkLidFiEECbw9RGejjXJ5xVVVT5ec 9muQuJ3QkwgApXDMefVrhrU2V5ncU6JZQTxmjMRP7/jOaJD0SvphieaxXYu/ KKoBXFlCqdeTjJm8cHaKcZcmQiV020PKRSDvn787ZCr4oJFDH+aUB+MjgouN IlRF2nlAN/rYR6Jjda781wKYcuKSfk/E7hhDNvrgO6+svyVZq6fgnzMoi8Ov mUvhRjBkN8YbHI4fsDlG1IvtYX29lWI8iGRSMv8eriYTk/ljhCiIFW+/XmPl 57bKjkh4t7BwFf+98TM3C3YX5EvOOq3wGUAdZwrfZ1LrxpB+HQPGixV4TD+t h9QPsCVzidyTmYfUkZw3AI/OST1L35F0ny1+10jUl00uifHgrNDZIA== =fKES
-----END PGP SIGNATURE-----

Acked-by on v1 1/2
#3 lore raw

Re: [Openvpn-devel] [PATCH 1/2] Improve documentation of AUTH_PENDING related directives

In reply to [email protected]...

Am 02.06.21 um 05:42 schrieb [email protected]...:

Quoted 4 lines

From: Selva Nair <[email protected]...>

Also fix some typos.

Thanks for filling out the gaps. It is always to see what is missing if you have everything in your head.

@Gert: when applying you can probably fix the one minor mistake ticantech pointed out.

Acked-by on v1 2/2
#6 lore raw

Re: [Openvpn-devel] [PATCH 2/2] Fix parsing of IV_SSO string

In reply to [email protected]...

Am 02.06.21 um 05:42 schrieb [email protected]...:

Quoted 15 lines

From: Selva Nair <[email protected]...>

Expect comma separated keywords

---
 src/openvpn/ssl_verify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl_verify.c +0 -0
index 0b41eea2..512b4f72 100644

src/openvpn/ssl_verify.c check_auth_pending_method(const char *peer_info, const char *method) · line 919

Quoted 8 lines
src/openvpn/ssl_verify.c +1 -1
@@ -913,7 +913,7 @@ check_auth_pending_method(const char *peer_info, const char *method)
             supported = true;
             break;
         }
-        client_method = strtok(NULL, ":");
+        client_method = strtok(NULL, ",");
     }
 
     gc_free(&gc);

Yes. Stupid copy&paste mistake from my side.

#8 lore raw
In reply to [email protected]...

Am 02.06.21 um 05:42 schrieb [email protected]...:

Quoted 8 lines

From: Selva Nair <[email protected]...>

I couldn't figure out the details of how to use CR_TEXT or OPEN_URL from the docs. This is an attempt to improve the documentation based on my reading of the sources and some guess-work.

I might have edited somethings wrongly. If so, please correct.

Quoted 8 lines

Also found a minor parsing bug that will trigger only if the client announces more than two keywords in IV_SSO.

Question: is the IV_SSO the keyword for PROXY_URL named proxy_url or proxyurl or url_proxy? I would ahve guessed "proxyurl" based on crtext and openurl but have settled for proxy_url. If there is no established convention as yet, I suggest proxyurl without the _.

So far proxyurl openurl_proxy or whatever we call it has not yet implemented anywhere yet. So we can still change the name.

Arne

author
#9 lore raw

Hi,

Quoted 13 lines · Arne Schwabe

Am 02.06.21 um 05:42 schrieb [email protected]...:

Quoted 11 lines

From: Selva Nair <[email protected]...>

I couldn't figure out the details of how to use CR_TEXT or OPEN_URL from the docs. This is an attempt to improve the documentation based on my reading of the sources and some guess-work.

I might have edited some things wrongly. If so, please correct.

Also found a minor parsing bug that will trigger only if the client announces more than two keywords in IV_SSO.

Quoted 8 lines
Quoted 5 lines

Question: is the IV_SSO the keyword for PROXY_URL named proxy_url or proxyurl or url_proxy? I would have guessed "proxyurl" based on crtext and openurl but have settled for proxy_url. If there is no established convention as yet, I suggest proxyurl without the _.

So far proxyurl openurl_proxy or whatever we call it has not yet implemented anywhere yet. So we can still change the name.

In the patch I wrote it as proxy_url. Shall we change it to "proxyurl" to match with "crtext" and "openurl" which have no underscore?

Selva

#7 lore raw

[Openvpn-devel] [PATCH applied] Re: Fix parsing of IV_SSO string

In reply to [email protected]...

I have not tested anything ("for the archives"), but the change makes sense, is not going to cause build failures anywhere :-) and Arne has ACKed it.

Your patch has been applied to the master branch.

commit 28240c4a6e9e8134d6a62822918436dbd62b7fde

Author: Selva Nair
Date:   Tue Jun 1 23:42:53 2021 -0400
     Fix parsing of IV_SSO string

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

--
kind regards,

Gert Doering

#4 lore raw

[Openvpn-devel] [PATCH applied] Re: Improve documentation of AUTH_PENDING related directives

In reply to [email protected]...

Your patch has been applied to the master and release/2.5 branch.

I have fixed the yoda speak as requested. On the "proxy_url" question, the bikeshed painting committee had long and intense deliberations last week, and decided that nobody really feels like deciding whether to paint this blue or green... so I left the spelling "as it is", with "_".

(Pulling this patch into 2.5 created an impressive conflict, as it pulls in the documentation part of 3f8fb2b2c1d6, which never made it to 2.5 - fixing this, we now have identical doc/management-notes.txt in release/2.5 and master. If this is not correct due to missing code capabilities, we might need to revisit 2.5 here)

commit e0f860f4b38e60c2e1ce7b069f7c6c923c52e5ca (master) commit d6ec7547198584e6053a177fbc017ffb11c16071 (release/2.5)

Author: Selva Nair
Date:   Tue Jun 1 23:42:52 2021 -0400
     Improve documentation of AUTH_PENDING related directives

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

--
kind regards,

Gert Doering