From 2231a3a5b29e2c00f597b011726ff59ffc436f6d Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Mon, 26 Aug 2013 19:00:06 -0400 Subject: [PATCH 1/3] Support include and libs in separate dirs Support Serval include directory and lib directory in separate places. Only set them in the Makefile if they are not set on the command line. --- lib/mdp/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/mdp/Makefile b/lib/mdp/Makefile index 5ba55e37..b606898c 100644 --- a/lib/mdp/Makefile +++ b/lib/mdp/Makefile @@ -43,10 +43,11 @@ PLUGIN_VER = 0.1 TOPDIR = ../.. include $(TOPDIR)/Makefile.inc -SERVALD_ROOT=/home/hawkinsw/serval/serval-dna +SERVALD_ROOT?=/home/hawkinsw/serval/serval-dna +SERVALD_LIB_ROOT?=/home/hawkinsw/serval/serval-dna CPPFLAGS+=-I$(SERVALD_ROOT)/ -I$(SERVALD_ROOT)/nacl/include -LIBS+=-L$(SERVALD_ROOT) -lservald +LIBS+=-L$(SERVALD_LIB_ROOT) -lserval default_target: $(PLUGIN_FULLNAME) From 5a317c027661ebf27f9e2c5a184d17fa66078a12 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Mon, 26 Aug 2013 19:02:10 -0400 Subject: [PATCH 2/3] Use proper type of length variable --- lib/mdp/src/olsrd_mdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mdp/src/olsrd_mdp.c b/lib/mdp/src/olsrd_mdp.c index 77d0fdba..08c80772 100644 --- a/lib/mdp/src/olsrd_mdp.c +++ b/lib/mdp/src/olsrd_mdp.c @@ -148,7 +148,7 @@ print_data(const char *label, const uint8_t *data, size_t len) static void mdp_checksum(uint8_t *data, const uint16_t data_len, uint8_t *hashbuf) { - unsigned long long signature_bytes = SIGNATURE_BYTES; + int signature_bytes = SIGNATURE_BYTES; print_data("Key", servald_key, servald_key_len); print_data("Data", data, data_len); From a624a46ce33bcb9ebc3ef406178724c3a610a9c0 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Mon, 26 Aug 2013 19:02:29 -0400 Subject: [PATCH 3/3] keyring_open_with_pins() is gone Replace it with a call to keyring_open_instance() which does almost exactly the same thing! --- lib/mdp/src/olsrd_mdp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/mdp/src/olsrd_mdp.c b/lib/mdp/src/olsrd_mdp.c index 08c80772..dd95c00a 100644 --- a/lib/mdp/src/olsrd_mdp.c +++ b/lib/mdp/src/olsrd_mdp.c @@ -1079,13 +1079,12 @@ timeout_timestamps(void *foo __attribute__ ((unused))) static int read_key_from_servald(const char *sid) { - const char *pins = {"",}; unsigned char stowedSid[SID_SIZE]; unsigned char *found_private_key = NULL; int found_private_key_len = 0; int cn = 0, in = 0, kp = 0; - keyring = keyring_open_with_pins(pins); + keyring = keyring_open_instance(); stowSid(stowedSid, 0, sid); if (!keyring_find_sid(keyring, &cn, &in, &kp, stowedSid))