aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2013-06-25 16:33:41 -0400
committerSteve French <smfrench@gmail.com>2013-06-26 18:31:50 -0400
commit5d875cc928aa7c95c8c1e89497a9a644f32213d4 (patch)
treea336203c4ab0b60aea478d2beb67a0057ba8f7fa /fs/cifs
parentfdf96a907c1fbb93c633e2b7ede3b8df26d6a4c0 (diff)
When server doesn't provide SecurityBuffer on SMB2Negotiate pick default
According to MS-SMB2 section 2.2.4: if no blob, client picks default which for us will be ses->sectype = RawNTLMSSP; but for time being this is also our only auth choice so doesn't matter as long as we include this fix (which does not treat the empty SecurityBuffer as an error as the code had been doing). We just found a server which sets blob length to zero expecting raw so this fixes negotiation with that server. Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/smb2pdu.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index c0d102615d0a..f9b74daf962a 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -416,18 +416,22 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
416 416
417 security_blob = smb2_get_data_area_len(&blob_offset, &blob_length, 417 security_blob = smb2_get_data_area_len(&blob_offset, &blob_length,
418 &rsp->hdr); 418 &rsp->hdr);
419 if (blob_length == 0) { 419 /*
420 cifs_dbg(VFS, "missing security blob on negprot\n"); 420 * See MS-SMB2 section 2.2.4: if no blob, client picks default which
421 rc = -EIO; 421 * for us will be
422 goto neg_exit; 422 * ses->sectype = RawNTLMSSP;
423 } 423 * but for time being this is our only auth choice so doesn't matter.
424 * We just found a server which sets blob length to zero expecting raw.
425 */
426 if (blob_length == 0)
427 cifs_dbg(FYI, "missing security blob on negprot\n");
424 428
425 rc = cifs_enable_signing(server, ses->sign); 429 rc = cifs_enable_signing(server, ses->sign);
426#ifdef CONFIG_SMB2_ASN1 /* BB REMOVEME when updated asn1.c ready */ 430#ifdef CONFIG_SMB2_ASN1 /* BB REMOVEME when updated asn1.c ready */
427 if (rc) 431 if (rc)
428 goto neg_exit; 432 goto neg_exit;
429 433 if (blob_length)
430 rc = decode_neg_token_init(security_blob, blob_length, 434 rc = decode_neg_token_init(security_blob, blob_length,
431 &server->sec_type); 435 &server->sec_type);
432 if (rc == 1) 436 if (rc == 1)
433 rc = 0; 437 rc = 0;