cifs: Fix broken sec=ntlmv2/i sec option (try #2)
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>
Thu, 25 Aug 2011 04:05:46 +0000 (23:05 -0500)
committerSteve French <sfrench@us.ibm.com>
Tue, 20 Sep 2011 02:16:58 +0000 (21:16 -0500)
commitcfbd6f84c2e26c13ded16b6bb0871edb7d75974f
tree395e9fb411b4501fcc85d00ecd7b19d4256e5edb
parentc9c7fa0064f4afe1d040e72f24c2256dd8ac402d
cifs: Fix broken sec=ntlmv2/i sec option (try #2)

Fix sec=ntlmv2/i authentication option during mount of Samba shares.

cifs client was coding ntlmv2 response incorrectly.
All that is needed in temp as specified in MS-NLMP seciton 3.3.2

"Define ComputeResponse(NegFlg, ResponseKeyNT, ResponseKeyLM,
CHALLENGE_MESSAGE.ServerChallenge, ClientChallenge, Time, ServerName)

as
Set temp to ConcatenationOf(Responserversion, HiResponserversion,
Z(6), Time, ClientChallenge, Z(4), ServerName, Z(4)"

is MsvAvNbDomainName.

For sec=ntlmsspi, build_av_pair is not used, a blob is plucked from
type 2 response sent by the server to use in authentication.

I tested sec=ntlmv2/i and sec=ntlmssp/i mount options against
Samba (3.6) and Windows - XP, 2003 Server and 7.
They all worked.

Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsencrypt.c