libcli/smb: try to negotiate SMB2_ENCRYPTION_AES128_GCM
authorStefan Metzmacher <metze@samba.org>
Tue, 7 Oct 2014 13:59:48 +0000 (15:59 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 16 Oct 2014 19:53:32 +0000 (21:53 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 16 21:53:32 CEST 2014 on sn-devel-104

libcli/smb/smbXcli_base.c

index bb586ab50dfb689d896f1343ee8fbcca15ad16a8..61ac6f04f127dd6d67e409abf5236d6b8b79f673 100644 (file)
@@ -4434,10 +4434,11 @@ static struct tevent_req *smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta
                        return NULL;
                }
 
-               SSVAL(p, 0, 1); /* ChiperCount */
-               SSVAL(p, 2, SMB2_ENCRYPTION_AES128_CCM);
+               SSVAL(p, 0, 2); /* ChiperCount */
+               SSVAL(p, 2, SMB2_ENCRYPTION_AES128_GCM);
+               SSVAL(p, 4, SMB2_ENCRYPTION_AES128_CCM);
 
-               b = data_blob_const(p, 4);
+               b = data_blob_const(p, 6);
                status = smb2_negotiate_context_add(state, &c,
                                        SMB2_ENCRYPTION_CAPABILITIES, b);
                if (!NT_STATUS_IS_OK(status)) {
@@ -4720,8 +4721,11 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq)
 
                        cipher_selected = SVAL(cipher->data.data, 2);
 
-                       if (cipher_selected == SMB2_ENCRYPTION_AES128_CCM) {
+                       switch (cipher_selected) {
+                       case SMB2_ENCRYPTION_AES128_GCM:
+                       case SMB2_ENCRYPTION_AES128_CCM:
                                conn->smb2.server.cipher = cipher_selected;
+                               break;
                        }
                }
        }