Fix minor errors
authorMilan Broz <gmazyland@gmail.com>
Fri, 16 Apr 2010 14:51:09 +0000 (14:51 +0000)
committerMilan Broz <gmazyland@gmail.com>
Fri, 16 Apr 2010 14:51:09 +0000 (14:51 +0000)
- 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
src/cryptsetup.c
tests/apitest.c

index 508347b..9893056 100644 (file)
@@ -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);
 }
index 62ee18a..53ecbca 100644 (file)
@@ -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;
 
index a13f66a..9e5e517 100644 (file)
@@ -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);