Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2345?usp=email
to review the following change.
Change subject: ssl_verify: fail deferred auth if AUTH_PENDING cannot be sent
......................................................................
ssl_verify: fail deferred auth if AUTH_PENDING cannot be sent
key_state_check_auth_pending_file() ignored the return value of
send_auth_pending_messages(). When it failed, e.g. on an oversized
INFO_PRE, the client got no INFO_PRE, yet auth stayed deferred until
the deferred window ran out.
Fail the auth instead and tell the client why, as for an unsupported
pending method. Document the EXTRA length limit.
Change-Id: I8799b8f81945d643bb340a334b1891a5e625c2b9
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M doc/man-sections/script-options.rst
M include/openvpn-plugin.h.in
M src/openvpn/ssl_verify.c
3 files changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/2345/1
diff --git a/doc/man-sections/script-options.rst
b/doc/man-sections/script-options.rst
index 474c7fd..bc8ac2b 100644
--- a/doc/man-sections/script-options.rst
+++ b/doc/man-sections/script-options.rst
@@ -149,7 +149,8 @@
:code:`auth_pending_file`. The first line must be the timeout in
seconds, the required method on the second line (e.g. crtext) and
third line must be the EXTRA as documented in the
- ``client-pending-auth`` section of ``doc/management.txt``.
+ ``client-pending-auth`` section of ``doc/management.txt``. The EXTRA
+ must not exceed 1014 bytes; if it does, authentication fails.
This directive is designed to enable a plugin-style interface for
extending OpenVPN's authentication capabilities.
diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in
index dde5dea..d108779 100644
--- a/include/openvpn-plugin.h.in
+++ b/include/openvpn-plugin.h.in
@@ -575,6 +575,7 @@
* line 1: timeout in seconds
* line 2: Pending auth method the client needs to support (e.g. openurl)
* line 3: EXTRA (e.g. WEBAUTH::http://www.example.com)
+ * at most 1014 bytes, otherwise authentication fails
*
* In addition the OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER and
* OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER_V2 are called when OpenVPN tries to
diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c
index 2f81968..d48483b 100644
--- a/src/openvpn/ssl_verify.c
+++ b/src/openvpn/ssl_verify.c
@@ -966,10 +966,12 @@
pending_method);
ret = false;
}
- else
+ else if (!send_auth_pending_messages(multi, session,
BSTR(extra_buf),
+ (unsigned int)timeout))
{
- send_auth_pending_messages(multi, session, BSTR(extra_buf),
- (unsigned int)timeout);
+ auth_set_client_reason(multi, "Authentication failed, pending
auth "
+ "request could not be sent");
+ ret = false;
}
}
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2345?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8799b8f81945d643bb340a334b1891a5e625c2b9
Gerrit-Change-Number: 2345
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel