diff options
author | Jan Huwald <jh@sotun.de> | 2012-05-21 07:11:41 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-05-21 07:11:41 (GMT) |
commit | 22670f19bd1f015bf3a0588f7d4d56b3a6415d3e (patch) | |
tree | 823fdf40d7bceb33a8eff8dd83d271521e44d8fb /common.h | |
parent | 608a3598f6eb5be4cb2305a4eb0b1b721d0617a6 (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 'common.h')
-rw-r--r-- | common.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -9,6 +9,10 @@ #include <string.h> #include <sys/socket.h> #include <sys/types.h> +#include <net/if.h> +#include <unistd.h> + +typedef unsigned char byte; /* the port users will be connecting to */ #define SERVERPORT 4950 @@ -25,4 +29,13 @@ exit(1); \ } +#define E0P(Cmd, Msg) \ + if ((Cmd) == NULL) { \ + perror(Msg); \ + exit(1); \ + } + +#define IGN(Cmd) \ + if (Cmd) {} + #endif // UDP_BROADCAST_COMMON |