From 05dbd3b47a728acada971b545df458ae0e082ec5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Aug 2015 08:56:43 +0200 Subject: [PATCH] libcli/smb: prefer AES128_CCM 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 Reviewed-by: Ralph Boehme --- libcli/smb/smbXcli_base.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 6c35430c580..c1e9e586da8 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -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, -- 2.11.4.GIT