]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ntlm_smb_lm_auth build issues (#109)
authorAlexander Gozman <goal81@gmail.com>
Wed, 20 Dec 2017 12:30:58 +0000 (15:30 +0300)
committerAmos Jeffries <yadij@users.noreply.github.com>
Wed, 20 Dec 2017 12:30:58 +0000 (01:30 +1300)
Due to recent changes in commit 1d11e9b to the base64 API ntlm_smb_lm_auth helper was broken.

src/auth/ntlm/SMB_LM/ntlm_smb_lm_auth.cc

index e0b9329244b0b57bec4b82480923c43c3d89935e..2346de06ef8b09ff22c9dc22987821b8a4db2055 100644 (file)
@@ -195,7 +195,7 @@ make_challenge(char *domain, char *domain_controller)
     size_t len = sizeof(chal) - sizeof(chal.payload) + le16toh(chal.target.maxlen);
     // for lack of a good NTLM token size limit, allow up to what the helper input can be
     // validations later will expect to be limited to that size.
-    static uint8_t b64buf[HELPER_INPUT_BUFFER-10]; /* 10 for other line fields, delimiters and terminator */
+    static char b64buf[HELPER_INPUT_BUFFER-10]; /* 10 for other line fields, delimiters and terminator */
     if (base64_encode_len(len) < sizeof(b64buf)-1) {
         debug("base64 encoding of the token challenge will exceed %" PRIuSIZE " bytes", sizeof(b64buf));
         return NULL;
@@ -206,7 +206,7 @@ make_challenge(char *domain, char *domain_controller)
     size_t blen = base64_encode_update(&ctx, b64buf, len, reinterpret_cast<const uint8_t *>(&chal));
     blen += base64_encode_final(&ctx, b64buf+blen);
     b64buf[blen] = '\0';
-    return reinterpret_cast<const char*>(b64buf);
+    return b64buf;
 }
 
 /* returns NULL on failure, or a pointer to
@@ -518,7 +518,7 @@ manage_request()
         base64_decode_init(&ctx);
         size_t dstLen = 0;
         int decodedLen = 0;
-        if (!base64_decode_update(&ctx, &dstLen, reinterpret_cast<uint8_t*>(decoded), strlen(buf)-3, reinterpret_cast<const uint8_t*>(buf+3)) ||
+        if (!base64_decode_update(&ctx, &dstLen, reinterpret_cast<uint8_t*>(decoded), strlen(buf)-3, buf+3) ||
                 !base64_decode_final(&ctx)) {
             SEND("NA Packet format error, couldn't base64-decode");
             return;