• Shirish Pargaonkar's avatar
    cifs: Fix broken sec=ntlmv2/i sec option (try #2) · cfbd6f84
    Shirish Pargaonkar authored
    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: default avatarShirish Pargaonkar <shirishpargaonkar@gmail.com>
    Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
    cfbd6f84
cifsencrypt.c 22.1 KB