Move LUKS library to lib subdir.
authorMilan Broz <gmazyland@gmail.com>
Sun, 14 Nov 2010 20:06:35 +0000 (20:06 +0000)
committerMilan Broz <gmazyland@gmail.com>
Sun, 14 Nov 2010 20:06:35 +0000 (20:06 +0000)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@366 36d66b0a-2a48-0410-832c-cd162a569da5

13 files changed:
Makefile.am
TODO
configure.in
lib/Makefile.am
lib/luks1/Makefile.am [moved from luks/Makefile.am with 71% similarity]
lib/luks1/af.c [moved from luks/af.c with 95% similarity]
lib/luks1/af.h [moved from luks/af.h with 100% similarity]
lib/luks1/keyencryption.c [moved from luks/keyencryption.c with 94% similarity]
lib/luks1/keymanage.c [moved from luks/keymanage.c with 99% similarity]
lib/luks1/luks.h [moved from luks/luks.h with 100% similarity]
lib/luks1/pbkdf.c [moved from luks/pbkdf.c with 100% similarity]
lib/luks1/pbkdf.h [moved from luks/pbkdf.h with 98% similarity]
po/POTFILES.in

index ddd102b..887dd74 100644 (file)
@@ -1,6 +1,5 @@
 EXTRA_DIST = FAQ
 SUBDIRS = \
-       luks \
        lib \
        src \
        man \
diff --git a/TODO b/TODO
index ed71fd7..e69de29 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,12 +0,0 @@
-For 1.02
-
-* Add LUKS key copy cmd: luksKeyCopy
-* Add option to supply a master key directly. For LUKS commands: luksFormat, luksOpen and luksAddKey.
-
-For 2.0
-
-* LUKS header version bump:
-  * Add LUKS partition footer. 
-    * change luks_write_phdr stuff.
-    * change luks_read_phdr stuff
-  * change hashing according to conversation with Sarah.
index 2532852..7a289b0 100644 (file)
@@ -184,9 +184,9 @@ dnl ==========================================================================
 AC_CONFIG_FILES([ Makefile
 lib/Makefile
 lib/libcryptsetup.pc
+lib/luks1/Makefile
 src/Makefile
 po/Makefile.in
-luks/Makefile
 man/Makefile
 tests/Makefile
 ])
index dc78b3c..a624e5b 100644 (file)
@@ -1,3 +1,5 @@
+SUBDIRS = luks1
+
 moduledir = $(libdir)/cryptsetup
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -5,7 +7,7 @@ pkgconfig_DATA = libcryptsetup.pc
 
 INCLUDES = \
        -I$(top_srcdir)                         \
-       -I$(top_srcdir)/luks                    \
+       -I$(top_srcdir)/lib/luks1               \
        -DDATADIR=\""$(datadir)"\"              \
        -DLIBDIR=\""$(libdir)"\"                \
        -DPREFIX=\""$(prefix)"\"                \
@@ -29,7 +31,7 @@ libcryptsetup_la_LIBADD = \
        @UUID_LIBS@                             \
        @DEVMAPPER_LIBS@                        \
        @LIBGCRYPT_LIBS@                        \
-       ../luks/libluks.la
+       luks1/libluks1.la
 
 libcryptsetup_la_SOURCES = \
        setup.c                                 \
similarity index 71%
rename from luks/Makefile.am
rename to lib/luks1/Makefile.am
index 0ff1d9f..18292c3 100644 (file)
@@ -1,10 +1,10 @@
 moduledir = $(libdir)/cryptsetup
 
-noinst_LTLIBRARIES = libluks.la
+noinst_LTLIBRARIES = libluks1.la
 
-libluks_la_CFLAGS = -Wall @LIBGCRYPT_CFLAGS@
+libluks1_la_CFLAGS = -Wall @LIBGCRYPT_CFLAGS@
 
-libluks_la_SOURCES = \
+libluks1_la_SOURCES = \
        af.c \
        pbkdf.c \
        keymanage.c \
similarity index 95%
rename from luks/af.c
rename to lib/luks1/af.c
index e86af78..aad6691 100644 (file)
--- a/luks/af.c
@@ -3,7 +3,7 @@
  * Copyright 2004, Clemens Fruhwirth <clemens@endorphin.org>
  * Copyright (C) 2009 Red Hat, Inc. All rights reserved.
  *
- * AFsplitter diffuses information over a large stripe of data, 
+ * AFsplitter diffuses information over a large stripe of data,
  * therefor supporting secure data destruction.
  *
  * This program is free software; you can redistribute it and/or
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
+
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 #include <netinet/in.h>
 #include <errno.h>
 #include <gcrypt.h>
-#include <../lib/internal.h>
+#include "internal.h"
 
 static void XORblock(char const *src1, char const *src2, char *dst, size_t n)
 {
@@ -81,7 +81,7 @@ static int diffuse(char *src, char *dst, size_t size, int hash_id)
 
 /*
  * Information splitting. The amount of data is multiplied by
- * blocknumbers. The same blocksize and blocknumbers values 
+ * blocknumbers. The same blocksize and blocknumbers values
  * must be supplied to AF_merge to recover information.
  */
 
similarity index 100%
rename from luks/af.h
rename to lib/luks1/af.h
similarity index 94%
rename from luks/keyencryption.c
rename to lib/luks1/keyencryption.c
index 6ab3819..ed18025 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * LUKS - Linux Unified Key Setup 
+ * LUKS - Linux Unified Key Setup
  *
  * Copyright (C) 2004-2006, Clemens Fruhwirth <clemens@endorphin.org>
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * version 2 as published by the Free Software Foundation.
@@ -33,9 +33,7 @@
 #include <signal.h>
 
 #include "luks.h"
-//#include "../lib/libcryptsetup.h"
-#include "../lib/internal.h"
-//#include "../lib/blockdev.h"
+#include "internal.h"
 
 #define div_round_up(a,b) ({          \
        typeof(a) __a = (a);          \
@@ -80,7 +78,7 @@ static void sigint_handler(int sig)
        if(devfd >= 0)
                close(devfd);
        devfd = -1;
-       if(cleaner_name) 
+       if(cleaner_name)
                dm_remove_device(cleaner_name, 1, cleaner_size);
 
        signal(SIGINT, SIG_DFL);
@@ -118,10 +116,10 @@ static char *_error_hint(char *cipherName, char *cipherMode, size_t keyLength)
 
 /* This function is not reentrant safe, as it installs a signal
    handler and global vars for cleaning */
-static int LUKS_endec_template(char *src, size_t srcLength, 
-                              struct luks_phdr *hdr, 
-                              char *key, size_t keyLength, 
-                              const char *device, 
+static int LUKS_endec_template(char *src, size_t srcLength,
+                              struct luks_phdr *hdr,
+                              char *key, size_t keyLength,
+                              const char *device,
                               unsigned int sector,
                               ssize_t (*func)(int, void *, size_t),
                               int mode,
@@ -130,7 +128,7 @@ static int LUKS_endec_template(char *src, size_t srcLength,
        char *name = NULL;
        char *fullpath = NULL;
        char *dmCipherSpec = NULL;
-       const char *dmDir = dm_get_dir(); 
+       const char *dmDir = dm_get_dir();
        int r = -1;
 
        if(dmDir == NULL) {
similarity index 99%
rename from luks/keymanage.c
rename to lib/luks1/keymanage.c
index 472cc69..b75e645 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * LUKS - Linux Unified Key Setup 
+ * LUKS - Linux Unified Key Setup
  *
  * Copyright (C) 2004-2006, Clemens Fruhwirth <clemens@endorphin.org>
  *
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <uuid/uuid.h>
 
 #include "luks.h"
 #include "af.h"
 #include "pbkdf.h"
-#include <uuid/uuid.h>
-#include <../lib/internal.h>
+#include "internal.h"
 
 #define div_round_up(a,b) ({           \
        typeof(a) __a = (a);          \
@@ -327,8 +327,8 @@ int LUKS_write_phdr(const char *device,
                    struct luks_phdr *hdr,
                    struct crypt_device *ctx)
 {
-       int devfd = 0; 
-       unsigned int i; 
+       int devfd = 0;
+       unsigned int i;
        struct luks_phdr convHdr;
        int r;
 
@@ -336,7 +336,7 @@ int LUKS_write_phdr(const char *device,
                sizeof(struct luks_phdr), device);
 
        devfd = open(device,O_RDWR | O_DIRECT | O_SYNC);
-       if(-1 == devfd) { 
+       if(-1 == devfd) {
                log_err(ctx, _("Cannot open device %s.\n"), device);
                return -EINVAL;
        }
@@ -696,7 +696,7 @@ int LUKS_open_key_with_hdr(const char *device,
 
                /* Do not retry for errors that are no -EPERM or -ENOENT,
                   former meaning password wrong, latter key slot inactive */
-               if ((r != -EPERM) && (r != -ENOENT)) 
+               if ((r != -EPERM) && (r != -ENOENT))
                        return r;
        }
        /* Warning, early returns above */
similarity index 100%
rename from luks/luks.h
rename to lib/luks1/luks.h
similarity index 100%
rename from luks/pbkdf.c
rename to lib/luks1/pbkdf.c
similarity index 98%
rename from luks/pbkdf.h
rename to lib/luks1/pbkdf.h
index ae602fe..9bbd8f3 100644 (file)
@@ -3,8 +3,6 @@
 
 #include <stddef.h>
 
-/* */
-
 int PBKDF2_HMAC(const char *hash,
                const char *password, size_t passwordLen,
                const char *salt, size_t saltLen, unsigned int iterations,
index 3c1ee49..343a3d2 100644 (file)
@@ -6,8 +6,8 @@ lib/setup.c
 lib/utils.c
 lib/utils_crypt.c
 lib/utils_debug.c
-luks/af.c
-luks/keyencryption.c
-luks/keymanage.c
-luks/pbkdf.c
+lib/luks1/af.c
+lib/luks1/keyencryption.c
+lib/luks1/keymanage.c
+lib/luks1/pbkdf.c
 src/cryptsetup.c