cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/1918?usp=email )

Change subject: Improve auth token related comments
......................................................................

Improve auth token related comments

Change-Id: Ibf7238bade2aed81ac7fe4fda2af58e091dc8cd0
Signed-off-by: Arne Schwabe <[email protected]>
Acked-by: Razvan Cojocaru <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1918
Message-Id: <[email protected]>
URL: 
https://www.mail-archive.com/[email protected]/msg39269.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/auth_token.c
M src/openvpn/auth_token.h
2 files changed, 4 insertions(+), 6 deletions(-)




diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c
index f928a41..b457b6f 100644
--- a/src/openvpn/auth_token.c
+++ b/src/openvpn/auth_token.c
@@ -22,7 +22,7 @@
 #define AUTH_TOKEN_SESSION_ID_BASE64_LEN 
(OPENVPN_BASE64_LENGTH(AUTH_TOKEN_SESSION_ID_LEN))

 /* We want our token to be a multiple of 3 bytes to avoid the base64 padding */
-static_assert(AUTH_TOKEN_SESSION_ID_LEN % 3 == 0, "AUTH_TOKEN_SESSION_ID_LEN 
needs to be multiple a 3");
+static_assert(AUTH_TOKEN_SESSION_ID_LEN % 3 == 0, "AUTH_TOKEN_SESSION_ID_LEN 
must be multiple of 3");

 #define AUTH_TOKEN_HMAC_LEN   SHA256_DIGEST_LENGTH
 /* Size of the data of the token (not b64 encoded and without prefix) */
@@ -34,7 +34,7 @@

 /* Ensure that TOKEN_DATA_LEN is a multiple of 3 so the we avoid the base64
  * padding */
-static_assert(TOKEN_DATA_LEN % 3 == 0, "TOKEN_DATA_BASE64_LEN is not a 
multiple of 3");
+static_assert(TOKEN_DATA_LEN % 3 == 0, "TOKEN_DATA_LEN is not a multiple of 
3");

 bool
 is_auth_token(const char *password)
diff --git a/src/openvpn/auth_token.h b/src/openvpn/auth_token.h
index fd8317d..62ac012 100644
--- a/src/openvpn/auth_token.h
+++ b/src/openvpn/auth_token.h
@@ -109,16 +109,14 @@
 #define SESSION_ID_PREFIX "SESS_ID_AT_"

 /**
- * Return if the password string has the format of a password.
+ * Return if the password string has the format of an auth token.
  *
- * This function will always read as many bytes as SESSION_ID_PREFIX is longer
- * the caller needs ensure that password memory is at least that long (true for
- * calling with struct user_pass)
  * @param password
  * @return whether the password string starts with the session token prefix
  */
 bool
 is_auth_token(const char *password);
+
 /**
  * Checks if a client should be sent a new auth token to update its
  * current auth-token

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1918?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ibf7238bade2aed81ac7fe4fda2af58e091dc8cd0
Gerrit-Change-Number: 1918
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: razvanc <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to