aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.c
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2018-04-22 16:14:58 -0400
committerSteve French <stfrench@microsoft.com>2018-04-24 11:07:14 -0400
commit23657ad7305ee8b263d27335abdd00917764c9cf (patch)
tree2827d1147ef01e88692057e2be8f94d078260cc4 /fs/cifs/smb2pdu.c
parent117e3b7fed552eba96ae0b3b92312fe8c5b0bfdd (diff)
SMB3: Fix 3.11 encryption to Windows and handle encrypted smb3 tcon
Temporarily disable AES-GCM, as AES-CCM is only currently enabled mechanism on client side. This fixes SMB3.11 encrypted mounts to Windows. Also the tree connect request itself should be encrypted if requested encryption ("seal" on mount), in addition we should be enabling encryption in 3.11 based on whether we got any valid encryption ciphers back in negprot (the corresponding session flag is not set as it is in 3.0 and 3.02) Signed-off-by: Steve French <smfrench@gmail.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> CC: Stable <stable@vger.kernel.org>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r--fs/cifs/smb2pdu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 0f044c4a2dc9..9aea138dd71f 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -383,10 +383,10 @@ static void
383build_encrypt_ctxt(struct smb2_encryption_neg_context *pneg_ctxt) 383build_encrypt_ctxt(struct smb2_encryption_neg_context *pneg_ctxt)
384{ 384{
385 pneg_ctxt->ContextType = SMB2_ENCRYPTION_CAPABILITIES; 385 pneg_ctxt->ContextType = SMB2_ENCRYPTION_CAPABILITIES;
386 pneg_ctxt->DataLength = cpu_to_le16(6); 386 pneg_ctxt->DataLength = cpu_to_le16(4); /* Cipher Count + le16 cipher */
387 pneg_ctxt->CipherCount = cpu_to_le16(2); 387 pneg_ctxt->CipherCount = cpu_to_le16(1);
388 pneg_ctxt->Ciphers[0] = SMB2_ENCRYPTION_AES128_GCM; 388/* pneg_ctxt->Ciphers[0] = SMB2_ENCRYPTION_AES128_GCM;*/ /* not supported yet */
389 pneg_ctxt->Ciphers[1] = SMB2_ENCRYPTION_AES128_CCM; 389 pneg_ctxt->Ciphers[0] = SMB2_ENCRYPTION_AES128_CCM;
390} 390}
391 391
392static void 392static void
@@ -444,6 +444,7 @@ static int decode_encrypt_ctx(struct TCP_Server_Info *server,
444 return -EINVAL; 444 return -EINVAL;
445 } 445 }
446 server->cipher_type = ctxt->Ciphers[0]; 446 server->cipher_type = ctxt->Ciphers[0];
447 server->capabilities |= SMB2_GLOBAL_CAP_ENCRYPTION;
447 return 0; 448 return 0;
448} 449}
449 450