diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-06-30 10:00:53 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-06-30 10:00:53 +0100 |
commit | 53a29c4ca785bd3d69e49d9b883796d2f1569f9f (patch) | |
tree | f65f99b638bf583bdf1720d8edd112489f435341 /tools/blktap | |
parent | 0fa687ee1d84a8e5c5d8f2a9ee837a9f4d30b4c3 (diff) | |
download | xen-53a29c4ca785bd3d69e49d9b883796d2f1569f9f.tar.gz xen-53a29c4ca785bd3d69e49d9b883796d2f1569f9f.tar.bz2 xen-53a29c4ca785bd3d69e49d9b883796d2f1569f9f.zip |
blktap: link against libgcrypt rather than libcrypto
tapdisk, part of blktap, links against libcrypto. tapdisk includes
GPLv2 (tapaio.c) and other licensed code (block-qcow.c). The license
of OpenSSL is considered incompatible with the GPL by many
people. This patch changes them to link against libgcrypt, which is
LGPL.
Signed-off-by: Bastian Blank <waldi@debian.org>
Diffstat (limited to 'tools/blktap')
-rw-r--r-- | tools/blktap/drivers/Makefile | 2 | ||||
-rw-r--r-- | tools/blktap/drivers/block-qcow.c | 17 |
2 files changed, 5 insertions, 14 deletions
diff --git a/tools/blktap/drivers/Makefile b/tools/blktap/drivers/Makefile index b2318f0e8d..548f080e7c 100644 --- a/tools/blktap/drivers/Makefile +++ b/tools/blktap/drivers/Makefile @@ -18,7 +18,7 @@ CFLAGS += -Wp,-MD,.$(@F).d DEPS = .*.d LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) -L../lib -lblktap -LDFLAGS_img := $(LIBAIO_DIR)/libaio.a -lcrypto -lpthread -lz +LDFLAGS_img := $(LIBAIO_DIR)/libaio.a -lgcrypt -lpthread -lz BLK-OBJS-y := block-aio.o BLK-OBJS-y += block-sync.o diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c index 549cc7c793..dd6c6c7c07 100644 --- a/tools/blktap/drivers/block-qcow.c +++ b/tools/blktap/drivers/block-qcow.c @@ -33,7 +33,7 @@ #include <zlib.h> #include <inttypes.h> #include <libaio.h> -#include <openssl/md5.h> +#include <gcrypt.h> #include "bswap.h" #include "aes.h" #include "tapdisk.h" @@ -149,31 +149,22 @@ static int decompress_cluster(struct tdqcow_state *s, uint64_t cluster_offset); static uint32_t gen_cksum(char *ptr, int len) { int i; - unsigned char *md; - uint32_t ret; + uint32_t md[4]; - md = malloc(MD5_DIGEST_LENGTH); - - if(!md) return 0; - /* Convert L1 table to big endian */ for(i = 0; i < len / sizeof(uint64_t); i++) { cpu_to_be64s(&((uint64_t*) ptr)[i]); } /* Generate checksum */ - if (MD5((unsigned char *)ptr, len, md) != md) - ret = 0; - else - memcpy(&ret, md, sizeof(uint32_t)); + gcry_md_hash_buffer(GCRY_MD_MD5, md, ptr, len); /* Convert L1 table back to native endianess */ for(i = 0; i < len / sizeof(uint64_t); i++) { be64_to_cpus(&((uint64_t*) ptr)[i]); } - free(md); - return ret; + return md[0]; } static int get_filesize(char *filename, uint64_t *size, struct stat *st) |