[Openvpn-devel] Add better documentation for CAS_* states

Message ID 20220214003140.3741349-1-arne@rfc2549.org
State Accepted
Headers show
Series
  • [Openvpn-devel] Add better documentation for CAS_* states
Related show

Commit Message

Arne Schwabe Feb. 14, 2022, 12:31 a.m.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 src/openvpn/ssl_common.h | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Gert Doering Feb. 14, 2022, 7:22 a.m. | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Helpful!

Your patch has been applied to the master branch.

commit b9451bef6a8658f085d95c7c88947f21b97afe86
Author: Arne Schwabe
Date:   Mon Feb 14 01:31:40 2022 +0100

     Add better documentation for CAS_* states

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220214003140.3741349-1-arne@rfc2549.org>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23776.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/ssl_common.h b/src/openvpn/ssl_common.h
index 42b63cd0..10a3f730 100644
--- a/src/openvpn/ssl_common.h
+++ b/src/openvpn/ssl_common.h
@@ -522,9 +522,10 @@  struct tls_session
 #define KEY_SCAN_SIZE 3
 
 
-/* client authentication state, CAS_SUCCEEDED must be 0 since
- * non multi code path still checks this variable but does not initialise it
- * so the code depends on zero initialisation */
+/* multi state (originally client authentication state (=CAS))
+ * CAS_NOT_CONNECTED must be 0 since non multi code paths still check
+ * this variable but do not explicitly initialise it and depend
+ * on zero initialisation */
 
 /* CAS_NOT_CONNECTED is the initial state for every context. When the *first*
  * tls_session reaches S_ACTIVE, this state machine moves to CAS_PENDING (server)
@@ -532,11 +533,11 @@  struct tls_session
  * connect scripts/plugins */
 enum multi_status {
     CAS_NOT_CONNECTED,
-    CAS_WAITING_AUTH,               /**< TLS connection established but deferred auth not finished */
-    CAS_PENDING,
-    CAS_PENDING_DEFERRED,
-    CAS_PENDING_DEFERRED_PARTIAL,   /**< at least handler succeeded, no result yet*/
-    CAS_FAILED,
+    CAS_WAITING_AUTH,               /**< Initial TLS connection established but deferred auth is not yet finished */
+    CAS_PENDING,                    /**< Options import (Connect script/plugin, ccd,...) */
+    CAS_PENDING_DEFERRED,           /**< Waiting on an async option import handler */
+    CAS_PENDING_DEFERRED_PARTIAL,   /**< at least handler succeeded but another is still pending */
+    CAS_FAILED,                     /**< Option import failed or explicitly denied the client */
     CAS_WAITING_OPTIONS_IMPORT,     /**< client with pull or p2p waiting for first time options import */
     CAS_CONNECT_DONE,
 };