]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove dependency on manage.h from ssl_verify.h
authorSteffan Karger <steffan@karger.me>
Sun, 1 Jun 2014 17:58:55 +0000 (19:58 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 1 Jun 2014 18:42:22 +0000 (20:42 +0200)
verify_user_pass_enabled() is a function on a tls_session, and belongs in
ssl.c. Moving the function removes the dependency on manage.h.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401645536-27849-5-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8754
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl.c
src/openvpn/ssl_verify.h

index e9e01adf63e23b2625e84f3b4fad235f8bae5f2e..95bbb27765ac4282780f7080f070f2731e232320 100644 (file)
@@ -837,6 +837,25 @@ static inline void tls_session_set_self_referential_pointers (struct tls_session
   session->tls_auth.packet_id = &session->tls_auth_pid;
 }
 
+/**
+ * Returns whether or not the server should check for username/password
+ *
+ * @param session      The current TLS session
+ *
+ * @return             true if username and password verification is enabled,
+ *                     false if not.
+ */
+static inline bool
+tls_session_user_pass_enabled(struct tls_session *session)
+{
+  return (session->opt->auth_user_pass_verify_script
+        || plugin_defined (session->opt->plugins, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY)
+#ifdef MANAGEMENT_DEF_AUTH
+        || management_enable_def_auth (management)
+#endif
+        );
+}
+
 
 /** @addtogroup control_processor
  *  @{ */
@@ -2069,7 +2088,7 @@ key_method_2_read (struct buffer *buf, struct tls_multi *multi, struct tls_sessi
       output_peer_info_env (session->opt->es, multi->peer_info);
 #endif
 
-  if (verify_user_pass_enabled(session))
+  if (tls_session_user_pass_enabled(session))
     {
       /* Perform username/password authentication */
       if (!username_status || !password_status)
index e0bcba42c0dec61ee6d3611c2dc88f347f7165c1..601d86319d9a1555003320d9b5759ea63e38d9e2 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "syshead.h"
 #include "misc.h"
-#include "manage.h"
 #include "ssl_common.h"
 
 /* Include OpenSSL-specific code */
@@ -165,25 +164,6 @@ tls_common_name_hash (const struct tls_multi *multi, const char **cn, uint32_t *
 
 #endif
 
-/**
- * Returns whether or not the server should check for username/password
- *
- * @param session      The current TLS session
- *
- * @return             true if username and password verification is enabled,
- *                     false if not.
- *
- */
-static inline bool verify_user_pass_enabled(struct tls_session *session)
-{
-  return (session->opt->auth_user_pass_verify_script
-        || plugin_defined (session->opt->plugins, OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY)
-#ifdef MANAGEMENT_DEF_AUTH
-        || management_enable_def_auth (management)
-#endif
-        );
-}
-
 /**
  * Verify the given username and password, using either an external script, a
  * plugin, or the management interface.