diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5bce2778163b..9dcdb0c707ea 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -2681,8 +2681,6 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2681 | /* NTLMSSP_NEGOTIATE_ALWAYS_SIGN | */ NTLMSSP_NEGOTIATE_128; | 2681 | /* NTLMSSP_NEGOTIATE_ALWAYS_SIGN | */ NTLMSSP_NEGOTIATE_128; |
2682 | if (sign_CIFS_PDUs) | 2682 | if (sign_CIFS_PDUs) |
2683 | negotiate_flags |= NTLMSSP_NEGOTIATE_SIGN; | 2683 | negotiate_flags |= NTLMSSP_NEGOTIATE_SIGN; |
2684 | /* if (ntlmv2_support) | ||
2685 | negotiate_flags |= NTLMSSP_NEGOTIATE_NTLMV2;*/ | ||
2686 | /* setup pointers to domain name and workstation name */ | 2684 | /* setup pointers to domain name and workstation name */ |
2687 | bcc_ptr += SecurityBlobLength; | 2685 | bcc_ptr += SecurityBlobLength; |
2688 | 2686 | ||
@@ -2780,9 +2778,10 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, | |||
2780 | memcpy(ses->server->cryptKey, | 2778 | memcpy(ses->server->cryptKey, |
2781 | SecurityBlob2->Challenge, | 2779 | SecurityBlob2->Challenge, |
2782 | CIFS_CRYPTO_KEY_SIZE); | 2780 | CIFS_CRYPTO_KEY_SIZE); |
2783 | if (SecurityBlob2->NegotiateFlags & | 2781 | /* NTLMV2 flag is not for NTLMv2 password hash */ |
2782 | /* if (SecurityBlob2->NegotiateFlags & | ||
2784 | cpu_to_le32(NTLMSSP_NEGOTIATE_NTLMV2)) | 2783 | cpu_to_le32(NTLMSSP_NEGOTIATE_NTLMV2)) |
2785 | *pNTLMv2_flag = true; | 2784 | *pNTLMv2_flag = true; */ /* BB wrong */ |
2786 | 2785 | ||
2787 | if ((SecurityBlob2->NegotiateFlags & | 2786 | if ((SecurityBlob2->NegotiateFlags & |
2788 | cpu_to_le32(NTLMSSP_NEGOTIATE_ALWAYS_SIGN)) | 2787 | cpu_to_le32(NTLMSSP_NEGOTIATE_ALWAYS_SIGN)) |
@@ -3012,11 +3011,10 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, | |||
3012 | bcc_ptr += SecurityBlobLength; | 3011 | bcc_ptr += SecurityBlobLength; |
3013 | negotiate_flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_REQUEST_TARGET | | 3012 | negotiate_flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_REQUEST_TARGET | |
3014 | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_TARGET_INFO | | 3013 | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_TARGET_INFO | |
3015 | 0x80000000 | NTLMSSP_NEGOTIATE_128; | 3014 | NTLMSSP_NEGOTIATE_56 | NTLMSSP_NEGOTIATE_128 | |
3015 | NTLMSSP_NEGOTIATE_EXTENDED_SEC; | ||
3016 | if (sign_CIFS_PDUs) | 3016 | if (sign_CIFS_PDUs) |
3017 | negotiate_flags |= /* NTLMSSP_NEGOTIATE_ALWAYS_SIGN |*/ NTLMSSP_NEGOTIATE_SIGN; | 3017 | negotiate_flags |= /* NTLMSSP_NEGOTIATE_ALWAYS_SIGN |*/ NTLMSSP_NEGOTIATE_SIGN; |
3018 | if (ntlmv2_flag) | ||
3019 | negotiate_flags |= NTLMSSP_NEGOTIATE_NTLMV2; | ||
3020 | 3018 | ||
3021 | /* setup pointers to domain name and workstation name */ | 3019 | /* setup pointers to domain name and workstation name */ |
3022 | 3020 | ||
@@ -3438,12 +3436,19 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3438 | 3436 | ||
3439 | /* above now done in SendReceive */ | 3437 | /* above now done in SendReceive */ |
3440 | if ((rc == 0) && (tcon != NULL)) { | 3438 | if ((rc == 0) && (tcon != NULL)) { |
3439 | bool is_unicode; | ||
3440 | |||
3441 | tcon->tidStatus = CifsGood; | 3441 | tcon->tidStatus = CifsGood; |
3442 | tcon->need_reconnect = false; | 3442 | tcon->need_reconnect = false; |
3443 | tcon->tid = smb_buffer_response->Tid; | 3443 | tcon->tid = smb_buffer_response->Tid; |
3444 | bcc_ptr = pByteArea(smb_buffer_response); | 3444 | bcc_ptr = pByteArea(smb_buffer_response); |
3445 | bytes_left = BCC(smb_buffer_response); | 3445 | bytes_left = BCC(smb_buffer_response); |
3446 | length = strnlen(bcc_ptr, bytes_left - 2); | 3446 | length = strnlen(bcc_ptr, bytes_left - 2); |
3447 | if (smb_buffer->Flags2 & SMBFLG2_UNICODE) | ||
3448 | is_unicode = true; | ||
3449 | else | ||
3450 | is_unicode = false; | ||
3451 | |||
3447 | 3452 | ||
3448 | /* skip service field (NB: this field is always ASCII) */ | 3453 | /* skip service field (NB: this field is always ASCII) */ |
3449 | if (length == 3) { | 3454 | if (length == 3) { |
@@ -3464,9 +3469,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
3464 | 3469 | ||
3465 | /* mostly informational -- no need to fail on error here */ | 3470 | /* mostly informational -- no need to fail on error here */ |
3466 | tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, | 3471 | tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, |
3467 | bytes_left, | 3472 | bytes_left, is_unicode, |
3468 | smb_buffer->Flags2 & | ||
3469 | SMBFLG2_UNICODE, | ||
3470 | nls_codepage); | 3473 | nls_codepage); |
3471 | 3474 | ||
3472 | cFYI(1, ("nativeFileSystem=%s", tcon->nativeFileSystem)); | 3475 | cFYI(1, ("nativeFileSystem=%s", tcon->nativeFileSystem)); |