Skip to content

Commit

Permalink
ntlm fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Apr 27, 2024
1 parent be27a15 commit 05dd94d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/vauth/ntlm.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
CURLcode result = CURLE_OK;
size_t size;
unsigned char ntlmbuf[NTLM_BUFSIZE];
int lmrespoff;
unsigned int lmrespoff;
unsigned char lmresp[24]; /* fixed-size */
int ntrespoff;
unsigned int ntrespoff;
unsigned int ntresplen = 24;
unsigned char ntresp[24]; /* fixed-size */
unsigned char *ptr_ntresp = &ntresp[0];
Expand Down Expand Up @@ -600,7 +600,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,

lmrespoff = 64; /* size of the message header */
ntrespoff = lmrespoff + 0x18;
domoff = (size_t)(ntrespoff + ntresplen);
domoff = ntrespoff + ntresplen;
useroff = domoff + domlen;
hostoff = useroff + userlen;

Expand Down Expand Up @@ -683,7 +683,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
LONGQUARTET(ntlm->flags));

DEBUGASSERT(size == 64);
DEBUGASSERT(size == (size_t)lmrespoff);
DEBUGASSERT(size == lmrespoff);

/* We append the binary hashes */
if(size < (NTLM_BUFSIZE - 0x18)) {
Expand All @@ -701,7 +701,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
failf(data, "incoming NTLM message too big");
return CURLE_OUT_OF_MEMORY;
}
DEBUGASSERT(size == (size_t)ntrespoff);
DEBUGASSERT(size == ntrespoff);
memcpy(&ntlmbuf[size], ptr_ntresp, ntresplen);
size += ntresplen;

Expand Down

0 comments on commit 05dd94d

Please sign in to comment.