Commit 01420639 authored by Milan Broz's avatar Milan Broz

Move LUKS library to lib subdir.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@366 36d66b0a-2a48-0410-832c-cd162a569da5
parent 312d8eca
EXTRA_DIST = FAQ
SUBDIRS = \
luks \
lib \
src \
man \
......
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.
......@@ -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
])
......
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 \
......
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 \
......
......@@ -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
......@@ -19,14 +19,14 @@
* 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.
*/
......
/*
* 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) {
......
/*
* LUKS - Linux Unified Key Setup
* LUKS - Linux Unified Key Setup
*
* Copyright (C) 2004-2006, Clemens Fruhwirth <clemens@endorphin.org>
*
......@@ -29,12 +29,12 @@
#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 */
......
......@@ -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,
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment