From patchwork Fri Apr 17 14:22:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 462145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F376C1402BD for ; Sat, 18 Apr 2015 01:59:40 +1000 (AEST) Received: from localhost ([::1]:42288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj8g7-0007pl-3M for incoming@patchwork.ozlabs.org; Fri, 17 Apr 2015 11:59:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj8fc-0006rv-16 for qemu-devel@nongnu.org; Fri, 17 Apr 2015 11:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj8fb-0006t5-3N for qemu-devel@nongnu.org; Fri, 17 Apr 2015 11:59:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj8fa-0006sr-SB for qemu-devel@nongnu.org; Fri, 17 Apr 2015 11:59:07 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3HFx0am018865 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 17 Apr 2015 11:59:06 -0400 Received: from localhost.localdomain.com (vpn1-5-19.ams2.redhat.com [10.36.5.19]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3HENPZJ011852; Fri, 17 Apr 2015 10:24:20 -0400 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Fri, 17 Apr 2015 15:22:13 +0100 Message-Id: <1429280557-8887-11-git-send-email-berrange@redhat.com> In-Reply-To: <1429280557-8887-1-git-send-email-berrange@redhat.com> References: <1429280557-8887-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , Gerd Hoffmann , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v1 RFC 10/34] crypto: move built-in D3DES implementation into crypto/ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org To prepare for a generic internal cipher API, move the built-in D3DES implementation into the crypto/ directory. This is not in fact a normal D3DES implementation, it is D3DES with double & triple length modes removed, and the key bytes in reversed bit order. IOW it is crippled specifically for the "benefit" of RFB, so call the new files desrfb.c instead of d3des.c to make it clear that it isn't a generally useful impl. Signed-off-by: Daniel P. Berrange --- crypto/Makefile.objs | 1 + ui/d3des.c => crypto/desrfb.c | 2 +- ui/d3des.h => include/crypto/desrfb.h | 0 ui/Makefile.objs | 2 +- ui/vnc.c | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) rename ui/d3des.c => crypto/desrfb.c (99%) rename ui/d3des.h => include/crypto/desrfb.h (100%) diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs index 9efc9b4..9f70294 100644 --- a/crypto/Makefile.objs +++ b/crypto/Makefile.objs @@ -1,3 +1,4 @@ util-obj-y += init.o util-obj-y += hash.o util-obj-y += aes.o +util-obj-y += desrfb.o diff --git a/ui/d3des.c b/crypto/desrfb.c similarity index 99% rename from ui/d3des.c rename to crypto/desrfb.c index 5bc99b8..fc20a30 100644 --- a/ui/d3des.c +++ b/crypto/desrfb.c @@ -26,7 +26,7 @@ * (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992. */ -#include "d3des.h" +#include "crypto/desrfb.h" static void scrunch(unsigned char *, unsigned long *); static void unscrun(unsigned long *, unsigned char *); diff --git a/ui/d3des.h b/include/crypto/desrfb.h similarity index 100% rename from ui/d3des.h rename to include/crypto/desrfb.h diff --git a/ui/Makefile.objs b/ui/Makefile.objs index 13b5cfb..ca3ca38 100644 --- a/ui/Makefile.objs +++ b/ui/Makefile.objs @@ -1,4 +1,4 @@ -vnc-obj-y += vnc.o d3des.o +vnc-obj-y += vnc.o vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o vnc-obj-y += vnc-enc-tight.o vnc-palette.o vnc-obj-y += vnc-enc-zrle.o diff --git a/ui/vnc.c b/ui/vnc.c index 6bfe228..39402d3 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -46,7 +46,7 @@ static const struct timeval VNC_REFRESH_STATS = { 0, 500000 }; static const struct timeval VNC_REFRESH_LOSSY = { 2, 0 }; #include "vnc_keysym.h" -#include "d3des.h" +#include "crypto/desrfb.h" static QTAILQ_HEAD(, VncDisplay) vnc_displays = QTAILQ_HEAD_INITIALIZER(vnc_displays);