1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r1612: Fix bug #1571 found by Guenter Kukkukk <guenter.kukkukk@kukkukk.com>

(Botched LANMAN2 session setup code)

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2004-07-30 11:14:47 +00:00 committed by Gerald (Jerry) Carter
parent 4fd619d7e1
commit 3baa4ef6c5

View File

@ -81,7 +81,10 @@ static BOOL cli_session_setup_lanman2(struct cli_state *cli, const char *user,
if (passlen > 0 && (cli->sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) && passlen != 24) {
/* Encrypted mode needed, and non encrypted password supplied. */
lm_response = data_blob(NULL, 24);
SMBencrypt(pass, cli->secblob.data,(uchar *)lm_response.data);
if (!SMBencrypt(pass, cli->secblob.data,(uchar *)lm_response.data)) {
DEBUG(1, ("Password is > 14 chars in length, and is therefore incompatible with Lanman authentication\n"));
return False;
}
} else if ((cli->sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) && passlen == 24) {
/* Encrypted mode needed, and encrypted password supplied. */
lm_response = data_blob(pass, passlen);
@ -106,7 +109,7 @@ static BOOL cli_session_setup_lanman2(struct cli_state *cli, const char *user,
p = smb_buf(cli->outbuf);
memcpy(p,lm_response.data,lm_response.length);
p += passlen;
p += lm_response.length;
p += clistr_push(cli, p, user, -1, STR_TERMINATE|STR_UPPER);
p += clistr_push(cli, p, workgroup, -1, STR_TERMINATE|STR_UPPER);
p += clistr_push(cli, p, "Unix", -1, STR_TERMINATE);