Skip to contentSkip to conversation

Last-minute fixes to auth-token-hmac patch series

PATCH In review David Sommerseth 2 participants 7 messages Sep 27, 2019 – Oct 1, 2019

lore
Share & tools
lore
#0 lore raw

cover Last-minute fixes to auth-token-hmac patch series

During the review of the auth-token-hmac patches from Arne Schwabe, there were still a few minor issues left out. To avoid holding back further inclusion, we decided to add these patches on top of the patches from Arne.

The first patch, --disable-server fix, is only needed when running ./configure with --disable-server. Otherwise the existing patches works fine.

The second patch, --disable-management fix, just fixes a long outstanding compiler warning.

And the final patch with comment updates are just clarifications and minor improvements.

David Sommerseth (3):
auth-token: Fix building with --disable-server
auth-token: Fix compiler complaints with --disable-management Improve the comments related to auth-token-hmac patches

 src/openvpn/auth_token.h | 2 --
 src/openvpn/push.c       | 2 ++
 src/openvpn/ssl.h        | 4 ++--
 src/openvpn/ssl_common.h | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
#1 lore raw

PATCH 1/3 auth-token: Fix building with --disable-server

The final patches of the auth-token hmac support patches had a typo in the P2MP_SERVER fencing breaking --disable-server builds. It used #if instead of #ifdef.

While at it, also fix another missing P2MP_SERVER fencing causing the compiler to complain about an unused variable in push.c

---
 src/openvpn/push.c       | 2 ++
 src/openvpn/ssl_common.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
src/openvpn/push.c +2 -0
index dc1a536a..49b9d1be 100644
@@ -39,7 +39,9 @@
 
 #if P2MP
 
+#ifdef P2MP_SERVER
 static char push_reply_cmd[] = "PUSH_REPLY";
+#endif
 
 /*
  * Auth username/password
src/openvpn/ssl_common.h +1 -1
index 406601bc..5e21009e 100644
@@ -530,7 +530,7 @@ struct tls_multi
     time_t tas_last;
 #endif
 
-#if P2MP_SERVER
+#ifdef P2MP_SERVER
     /*
      * An error message to send to client on AUTH_FAILED
      */
Signature · 1 line
2.17.1
Acked-by on v1 1/3
#2 lore raw

[Openvpn-devel] [PATCH applied] Re: auth-token: Fix building with --disable-server

"Does what it says on the lid" :-)

Your patch has been applied to the master branch.

commit c20434a8c718ed577b62d96200a6c30472edadd6

Author: David Sommerseth
Date:   Sat Sep 28 00:45:34 2019 +0200
     auth-token: Fix building with --disable-server

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg18875.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#3 lore raw

PATCH 2/3 auth-token: Fix compiler complaints with --disable-management

In reply to David Sommerseth

When building with --disable-management, the compiler complains with implicit declaration of function ‘ssl_clean_auth_token’. This is due to the ssl_clean_auth_token() function being declared inside an #ifdef ENABLE_MANAGEMENT fence where it should not be.

---
 src/openvpn/ssl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/openvpn/ssl.h +2 -2
index e98c54c7..a944ca3a 100644
@@ -431,6 +431,8 @@ void ssl_purge_auth(const bool auth_user_pass_only);
 
 void ssl_set_auth_token(const char *token);
 
+bool ssl_clean_auth_token(void);
+
 #ifdef ENABLE_MANAGEMENT
 /*
  * ssl_get_auth_challenge will parse the server-pushed auth-failed
@@ -439,8 +441,6 @@ void ssl_set_auth_token(const char *token);
  */
 void ssl_purge_auth_challenge(void);
 
-bool ssl_clean_auth_token(void);
-
 void ssl_put_auth_challenge(const char *cr_str);
 
 #endif
Signature · 1 line
2.17.1
Acked-by on v1 2/3
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: auth-token: Fix compiler complaints with --disable-management

Not tested, but looks reasonable.

Your patch has been applied to the master branch.

commit f706d00f7f0cbcf26d2f8e58a684889cf3b9cf7d

Author: David Sommerseth
Date:   Sat Sep 28 00:45:35 2019 +0200
     auth-token: Fix compiler complaints with --disable-management

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg18873.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw

PATCH 3/3 Improve the comments related to auth-token-hmac patches

In reply to David Sommerseth

A couple of places the documentation was not clear enough or not even correct. Just improve this to avoid confusion later on.

---
 src/openvpn/auth_token.h | 2 --
 src/openvpn/ssl_common.h | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
src/openvpn/auth_token.h +0 -2
index c10afde9..4b014d44 100644
@@ -61,8 +61,6 @@ generate_auth_token(const struct user_pass *up, struct tls_multi *multi);
  * Verifies the auth token to be in the format that generate_auth_token
  * create and checks if the token is valid.
  *
- * Also calls generate_auth_token to update the auth-token to extend
- * its validity
  */
 unsigned
 verify_auth_token(struct user_pass *up, struct tls_multi *multi,
src/openvpn/ssl_common.h +1 -1
index 5e21009e..8dd08862 100644
@@ -559,7 +559,7 @@ struct tls_multi
      * Auth-token is only valid for an empty username
      * and not the username actually supplied from the client
      *
-     * OpenVPN 3 clients sometimes the empty username with a
+     * OpenVPN 3 clients sometimes wipes or replaces the username with a
      * username hint from their config.
      */
     int auth_token_state_flags;
Signature · 1 line
2.17.1
Acked-by on v1 3/3
#6 lore raw

[Openvpn-devel] [PATCH applied] Re: Improve the comments related to auth-token-hmac patches

Not sure if it really enables anyone outside ovpn tech to understand the comment about OVPN3 any better, but at least the first hunk is easy to verify & correct :-)

Your patch has been applied to the master branch.

commit 48a4c81b91bb5978cf21213fe5a85b80962025ee

Author: David Sommerseth
Date:   Sat Sep 28 00:45:36 2019 +0200
     Improve the comments related to auth-token-hmac patches

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg18874.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering