aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Quartulli2017-07-10 12:34:40 +0800
committerDavid Sommerseth2017-08-11 20:38:15 +0200
commit90f2edcbb7c1e890de96a9a44c87ca58dbd60b96 (patch)
treeb9d97df51f6b468d77e3362ff09ccaf94469e733
parent3ace1139e7aa00580300fb5bef37ac6d47378630 (diff)
downloadopenvpn-90f2edcbb7c1e890de96a9a44c87ca58dbd60b96.zip
openvpn-90f2edcbb7c1e890de96a9a44c87ca58dbd60b96.tar.gz
ntlm: restyle compressed multiple function calls
The gen_md4_hash() function is receiving as first argument a buffer that is filled by a function invoked when evaluating the second argument. Although this is proper C, it makes the call invocation a bit obscure because it is not immediately easy to grasp how the 'pwbuf' buffer is filled. Unroll the multiple function call onto lines and make the core more readable. Signed-off-by: Antonio Quartulli <a@unstable.cc> Acked-by: Steffan Karger <steffan@karger.me> Message-Id: <20170710043441.24770-4-a@unstable.cc> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15030.html Signed-off-by: David Sommerseth <davids@openvpn.net> (cherry picked from commit c2d08916f1b7933bec81422d1f14f84e9b1ef878)
-rw-r--r--src/openvpn/ntlm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/ntlm.c b/src/openvpn/ntlm.c
index 393368e..8c322f7 100644
--- a/src/openvpn/ntlm.c
+++ b/src/openvpn/ntlm.c
@@ -247,8 +247,8 @@ ntlm_phase_3(const struct http_proxy_info *p, const char *phase_2, struct gc_are
/* fill 1st 16 bytes with md4 hash, disregard terminating null */
- gen_md4_hash((uint8_t *)pwbuf, unicodize(pwbuf, p->up.password) - 2,
- md4_hash);
+ int unicode_len = unicodize(pwbuf, p->up.password) - 2;
+ gen_md4_hash((uint8_t *)pwbuf, unicode_len, md4_hash);
/* pad to 21 bytes */
memset(md4_hash + MD4_DIGEST_LENGTH, 0, 5);