libcli/smb: prefer AES128_CCM
authorStefan Metzmacher <metze@samba.org>
Mon, 17 Aug 2015 06:56:43 +0000 (08:56 +0200)
committerRalph Böhme <slow@samba.org>
Mon, 17 Aug 2015 15:43:36 +0000 (17:43 +0200)
Callgrind showed that we use 28,165,720,719 cpu cycles to send
a 100MB file to a client using aes-ccm.

With aes-gcm this is raises up to 723,094,413,831 cpu cycles.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/smb/smbXcli_base.c

index 6c35430c580f1455c1db79f1531191a253f56959..c1e9e586da8143206803cbe6c9fab56347ed9774 100644 (file)
@@ -4598,8 +4598,12 @@ static struct tevent_req *smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta
                }
 
                SSVAL(p, 0, 2); /* ChiperCount */
-               SSVAL(p, 2, SMB2_ENCRYPTION_AES128_GCM);
-               SSVAL(p, 4, SMB2_ENCRYPTION_AES128_CCM);
+               /*
+                * For now we preferr CCM because our implementation
+                * is faster than GCM, see bug #11451.
+                */
+               SSVAL(p, 2, SMB2_ENCRYPTION_AES128_CCM);
+               SSVAL(p, 4, SMB2_ENCRYPTION_AES128_GCM);
 
                b = data_blob_const(p, 6);
                status = smb2_negotiate_context_add(state, &c,