summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2012-05-21 07:11:41 (GMT)
committerJan Huwald <jh@sotun.de>2012-05-21 07:11:41 (GMT)
commit22670f19bd1f015bf3a0588f7d4d56b3a6415d3e (patch)
tree823fdf40d7bceb33a8eff8dd83d271521e44d8fb /Makefile
parent608a3598f6eb5be4cb2305a4eb0b1b721d0617a6 (diff)
add optional assymetric payload encryption
This patch uses the NaCL library to en-/decrypt and authenticate the payload suitable private and public keys are found. It - adds crypto.h, containing all crypto logic (including the detection if the packet is to be en-/decrypted) - adds nacl dependency to Makefile (including a switch between internal and external nacl) It also - changes Makefile to build with -Werror -Wextra - builds warning-free
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1509435..87a65e8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,13 @@
BIN=hbbpd hbbpc
+
+ifndef EXTERNAL_NACL
+CFLAGS += -Inacl/include/
+LDFLAGS += -Lnacl/lib/
+NACL_DEP = nacl/include
+endif
+
+CFLAGS +=-std=c99 -Wall -Wextra -fwhole-program -Os
+LDFLAGS +=-lnacl nacl/lib/randombytes.o
all: $(BIN)
@@ -6,6 +15,9 @@ all: $(BIN)
clean:
rm -f $(BIN) *~
+%: %.c common.h crypto.h $(NACL_DEP)
+ $(CC) -o $@ $< $(LDFLAGS) $(CFLAGS)
+
nacl/include:
mkdir nacl
wget http://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 -O - | tar jxf - -C nacl
contact: Jan Huwald // Impressum