From 17c87c1148ceb2075d9dad690594e457d46b2fb2 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Fri, 16 Apr 2010 14:51:09 +0000 Subject: [PATCH] Fix minor errors - undefined variable - properly closinf file descriptorif totpology not detected - fix IV mode to test run on RHEL5 git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@201 36d66b0a-2a48-0410-832c-cd162a569da5 --- lib/utils.c | 4 ++-- src/cryptsetup.c | 2 +- tests/apitest.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/utils.c b/lib/utils.c index 508347b..9893056 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -713,7 +713,7 @@ void get_topology_alignment(const char *device, if (ioctl(fd, BLKIOMIN, &min_io_size) == -1) { log_dbg("Topology info for %s not supported, using default offset %lu bytes.", device, default_alignment); - return; + goto out; } /* optimal io size */ @@ -734,6 +734,6 @@ void get_topology_alignment(const char *device, log_dbg("Topology: IO (%lu/%lu), offset = %lu; Required alignment is %lu bytes.", min_io_size, opt_io_size, *alignment_offset, *required_alignment); - +out: (void)close(fd); } diff --git a/src/cryptsetup.c b/src/cryptsetup.c index 62ee18a..53ecbca 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -459,7 +459,7 @@ static int action_luksRemoveKey(int arg) static int _action_luksAddKey_useMK() { - int r = -EINVAL, keysize; + int r = -EINVAL, keysize = 0; char *key = NULL; struct crypt_device *cd = NULL; diff --git a/tests/apitest.c b/tests/apitest.c index a13f66a..9e5e517 100644 --- a/tests/apitest.c +++ b/tests/apitest.c @@ -473,7 +473,7 @@ void DeviceResizeGame(void) co.size = 0; co.offset = 444; co.skip = 555; - co.cipher = "aes-cbc-benbi"; + co.cipher = "aes-cbc-essiv:sha256"; OK_(crypt_update_device(&co)); EQ_(_get_device_size(DMDIR CDEVICE_2), (orig_size - 444)); @@ -481,7 +481,7 @@ void DeviceResizeGame(void) co.icb = &cmd_icb, co.name = CDEVICE_2; EQ_(crypt_query_device(&co), 1); - EQ_(strcmp(co.cipher, "aes-cbc-benbi"), 0); + EQ_(strcmp(co.cipher, "aes-cbc-essiv:sha256"), 0); EQ_(co.key_size, 128 / 8); EQ_(co.offset, 444); EQ_(co.skip, 555); -- 2.7.4