forked from pool/cryptsetup
118 lines
4.0 KiB
Diff
118 lines
4.0 KiB
Diff
fix implicit function declarations
|
|
|
|
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
|
|
|
|
Index: cryptsetup-luks-1.0.4_SVN30/lib/internal.h
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/lib/internal.h
|
|
+++ cryptsetup-luks-1.0.4_SVN30/lib/internal.h
|
|
@@ -62,6 +62,9 @@ int hash(const char *backend_name, const
|
|
struct setup_backend *get_setup_backend(const char *name);
|
|
void put_setup_backend(struct setup_backend *backend);
|
|
|
|
+void hexprint(char *d, int n);
|
|
+
|
|
+int sector_size_for_device(const char *device);
|
|
ssize_t write_blockwise(int fd, const void *buf, size_t count);
|
|
ssize_t read_blockwise(int fd, void *_buf, size_t count);
|
|
ssize_t write_lseek_blockwise(int fd, const char *buf, size_t count, off_t offset);
|
|
Index: cryptsetup-luks-1.0.4_SVN30/lib/libcryptsetup.h
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/lib/libcryptsetup.h
|
|
+++ cryptsetup-luks-1.0.4_SVN30/lib/libcryptsetup.h
|
|
@@ -45,6 +45,8 @@ int crypt_luksDelKey(struct crypt_option
|
|
int crypt_luksAddKey(struct crypt_options *options);
|
|
int crypt_luksUUID(struct crypt_options *options);
|
|
int crypt_isLuks(struct crypt_options *options);
|
|
+int crypt_luksFormat(struct crypt_options *options);
|
|
+int crypt_luksDump(struct crypt_options *options);
|
|
|
|
void crypt_get_error(char *buf, size_t size);
|
|
void crypt_put_options(struct crypt_options *options);
|
|
Index: cryptsetup-luks-1.0.4_SVN30/lib/setup.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/lib/setup.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/lib/setup.c
|
|
@@ -107,7 +107,7 @@ static int interactive_pass(const char *
|
|
{
|
|
struct termios orig, tmp;
|
|
int failed = -1;
|
|
- int infd, outfd;
|
|
+ int infd = STDIN_FILENO, outfd;
|
|
|
|
if (maxlen < 1)
|
|
goto out_err;
|
|
Index: cryptsetup-luks-1.0.4_SVN30/lib/utils.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/lib/utils.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/lib/utils.c
|
|
@@ -9,6 +9,7 @@
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
+#include <sys/ioctl.h>
|
|
#include <fcntl.h>
|
|
|
|
#include "libcryptsetup.h"
|
|
Index: cryptsetup-luks-1.0.4_SVN30/luks/af.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/luks/af.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/luks/af.c
|
|
@@ -30,6 +30,7 @@
|
|
#include <errno.h>
|
|
#include "sha1.h"
|
|
#include "XORblock.h"
|
|
+#include "random.h"
|
|
|
|
/* diffuse: Information spreading over the whole dataset with
|
|
* the help of sha512.
|
|
Index: cryptsetup-luks-1.0.4_SVN30/luks/keyencryption.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/luks/keyencryption.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/luks/keyencryption.c
|
|
@@ -40,6 +40,9 @@
|
|
(__a - 1) / __b + 1; \
|
|
})
|
|
|
|
+static inline int round_up_modulo(int x, int m) {
|
|
+ return div_round_up(x, m) * m;
|
|
+}
|
|
|
|
static int setup_mapping(const char *cipher, const char *name,
|
|
const char *device, unsigned int payloadOffset,
|
|
Index: cryptsetup-luks-1.0.4_SVN30/luks/keymanage.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/luks/keymanage.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/luks/keymanage.c
|
|
@@ -141,7 +141,7 @@ int LUKS_write_phdr(const char *device,
|
|
return r;
|
|
}
|
|
|
|
-inline int round_up_modulo(int x, int m) {
|
|
+static inline int round_up_modulo(int x, int m) {
|
|
return div_round_up(x, m) * m;
|
|
}
|
|
|
|
Index: cryptsetup-luks-1.0.4_SVN30/src/cryptsetup.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/src/cryptsetup.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/src/cryptsetup.c
|
|
@@ -4,6 +4,7 @@
|
|
#include <stdint.h>
|
|
#include <inttypes.h>
|
|
#include <errno.h>
|
|
+#include <unistd.h>
|
|
#include <assert.h>
|
|
|
|
#include <libcryptsetup.h>
|
|
@@ -13,6 +14,9 @@
|
|
|
|
#include "cryptsetup.h"
|
|
|
|
+// XXX!
|
|
+int LUKS_is_last_keyslot(const char *device, unsigned int keyIndex);
|
|
+
|
|
static int opt_verbose = 1;
|
|
static char *opt_cipher = NULL;
|
|
static char *opt_hash = DEFAULT_HASH;
|