warp-vpn

point to point VPN implementation
git clone git://git.2f30.org/warp-vpn
Log | Files | Refs | README

commit 609add01f90f6aa39198fcaf6060e55709f81d31
parent cd801d3eefc9654dd2f56d4944eaa245eb581c9f
Author: sin <sin@2f30.org>
Date:   Tue, 12 Apr 2016 16:53:54 +0100

pass cipher type to cryptoinit()

Diffstat:
Mcrypto.c | 2+-
Mstun.c | 2+-
Mstun.h | 3+--
3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/crypto.c b/crypto.c @@ -41,7 +41,7 @@ derivekey(char *pw) } void -cryptoinit(char *pw) +cryptoinit(char *cipher, char *pw) { setcipher(cipher); derivekey(pw); diff --git a/stun.c b/stun.c @@ -163,7 +163,7 @@ main(int argc, char *argv[]) /* initialize crypto engine */ if (!(pw = getenv("STUNPW"))) logerr("STUNPW is not set"); - cryptoinit(pw); + cryptoinit(cipher, pw); memset(pw, 0, strlen(pw)); /* initialize networking engine */ diff --git a/stun.h b/stun.h @@ -20,7 +20,6 @@ enum { /* stun.c */ extern int devtype; extern int debug; -extern char *cipher; /* auth.c */ int challenge(int); @@ -30,7 +29,7 @@ int response(int); int clientconnect(char *, char *); /* crypto.c */ -void cryptoinit(char *); +void cryptoinit(char *, char *); size_t cryptononcelen(void); size_t cryptotaglen(void); int cryptoseal(unsigned char *, size_t *, size_t, const unsigned char *,