aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvpn')
-rw-r--r--src/openvpn/misc.h1
-rw-r--r--src/openvpn/ntlm.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h
index 2a6c0b8..6a883f7 100644
--- a/src/openvpn/misc.h
+++ b/src/openvpn/misc.h
@@ -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];
};
diff --git a/src/openvpn/ntlm.c b/src/openvpn/ntlm.c
index 72c1313..20527d4 100644
--- a/src/openvpn/ntlm.c
+++ b/src/openvpn/ntlm.c
@@ -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)
{