From 310b7a57bc03db660874eed67b049a910de369fd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 29 Dec 2014 19:33:09 +0100 Subject: introduce config.h We now have configuration in just one place. --- bin/Makefile | 4 ++-- bin/ykfde-cpio.c | 5 +---- bin/ykfde.c | 8 ++------ 3 files changed, 5 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/Makefile b/bin/Makefile index 4fcd6fb..6e77de8 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -7,10 +7,10 @@ CFLAGS += -std=c11 -O2 -fpic -pie -Wall -Werror all: ykfde ykfde-cpio -ykfde: ykfde.c +ykfde: ykfde.c ../config.h $(CC) $(CFLAGS) -lykpers-1 -lyubikey -liniparser -lcryptsetup $(LDFLAGS) -o ykfde ykfde.c -ykfde-cpio: ykfde-cpio.c +ykfde-cpio: ykfde-cpio.c ../config.h $(CC) $(CFLAGS) -larchive $(LDFLAGS) -o ykfde-cpio ykfde-cpio.c install: ykfde ykfde-cpio diff --git a/bin/ykfde-cpio.c b/bin/ykfde-cpio.c index ca6f61b..3122a1f 100644 --- a/bin/ykfde-cpio.c +++ b/bin/ykfde-cpio.c @@ -22,10 +22,7 @@ #include #include -#define CONFIGFILE "/etc/ykfde.conf" -#define CHALLENGEDIR "/etc/ykfde.d/" -#define CPIOFILE "/boot/ykfde-challenges.img" -#define CPIOTMPFILE CPIOFILE "-XXXXXX" +#include "../config.h" int add_dir(struct archive *archive, const char * path) { struct stat st; diff --git a/bin/ykfde.c b/bin/ykfde.c index 77bb86b..30a4665 100644 --- a/bin/ykfde.c +++ b/bin/ykfde.c @@ -27,18 +27,14 @@ #include +#include "../config.h" + /* challenge is 64 byte, * HMAC-SHA1 response is 40 byte */ #define CHALLENGELEN 64 #define RESPONSELEN SHA1_MAX_BLOCK_SIZE #define PASSPHRASELEN SHA1_DIGEST_SIZE * 2 -#define CONFIGFILE "/etc/ykfde.conf" -#define CHALLENGEDIR "/etc/ykfde.d/" -#define CONFYKSLOT "yk slot" -#define CONFLUKSSLOT "luks slot" -#define CONFDEVNAME "device name" - int main(int argc, char **argv) { char challenge_old[CHALLENGELEN + 1], challenge_new[CHALLENGELEN + 1], -- cgit v1.2.3-70-g09d2