]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Improve documentation on user/password requirement and unicodize function
authorArne Schwabe <arne@rfc2549.org>
Thu, 15 Dec 2022 19:01:39 +0000 (20:01 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 16 Dec 2022 17:07:36 +0000 (18:07 +0100)
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20221215190143.2107896-5-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25733.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 4b6854881c36e16054878e0467ef87d925e20cae)

src/openvpn/misc.h
src/openvpn/ntlm.c

index 2a6c0b8b32f99a2b8e0bedb9e0c897ac07f8feb5..6a883f70ad87fdcb414799c58642a9664b82111f 100644 (file)
@@ -67,6 +67,7 @@ struct user_pass
 #else
 #define USER_PASS_LEN 128
 #endif
+    /* Note that username and password are expected to be null-terminated */
     char username[USER_PASS_LEN];
     char password[USER_PASS_LEN];
 };
index 72c13130a75484b1241e266c09063ee077b084c8..20527d442a7f8d53cee8572a93ba33ab35c58fff 100644 (file)
@@ -140,6 +140,19 @@ my_strupr(char *str)
     }
 }
 
+/**
+ * This function expects a null-terminated string in src and will
+ * copy it (including the terminating NUL byte),
+ * alternating it with 0 to dst.
+ *
+ * This basically will transform a ASCII string into valid UTF-16.
+ * Characters that are 8bit in src, will get the same treatment, resulting in
+ * invalid or wrong unicode code points.
+ *
+ * @note the function will blindly assume that dst has double
+ * the space of src.
+ * @return  the length of the number of bytes written to dst
+ */
 static int
 unicodize(char *dst, const char *src)
 {