summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2012-09-13 17:34:56 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2012-09-13 17:38:38 +0200
commitea92f408ee3d103c1668f36a7d4117a3fcebbf13 (patch)
tree718b82df55baaa92201e57de644805a3cabb9c2a
parentc70f39a842eb24baed09d9249303503852036e13 (diff)
downloadeurephia-ea92f408ee3d103c1668f36a7d4117a3fcebbf13.tar.gz
eurephia-ea92f408ee3d103c1668f36a7d4117a3fcebbf13.tar.xz
eurephia-ea92f408ee3d103c1668f36a7d4117a3fcebbf13.zip
Remove VPN IP netmask from session seed
This is sometimes NULL, which is noticed more often when OpenVPN is configured in tun mode. This makes it difficult to identify the proper session key, as the seed isn't consistent. It does not affect much in regarding to the seed itself, as the netmask is most likely going to be the same for all clients anyhow. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r--plugin/eurephiadb_session.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/eurephiadb_session.c b/plugin/eurephiadb_session.c
index f6c7faa..0cbf1e5 100644
--- a/plugin/eurephiadb_session.c
+++ b/plugin/eurephiadb_session.c
@@ -1,6 +1,6 @@
/* eurephiadb_session.c -- Functions for handling sessions from eurephia-auth
*
- * GPLv2 only - Copyright (C) 2008 - 2010
+ * GPLv2 only - Copyright (C) 2008 - 2012
* David Sommerseth <dazo@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or
@@ -94,7 +94,7 @@ eurephiaSESSION *eDBopen_session_seed(eurephiaCTX *ctx, const char *digest,
new_session->type = ((vpnipaddr == NULL) && (vpnipmask == NULL) ? stAUTHENTICATION : stSESSION);
// Build up a string containing all elements for the session seed
- totlen = MAXLEN_TLSDIGEST + MAXLEN_CNAME + MAXLEN_USERNAME + MAXLEN_POOLIPADDR + MAXLEN_POOLNETMASK
+ totlen = MAXLEN_TLSDIGEST + MAXLEN_CNAME + MAXLEN_USERNAME + MAXLEN_POOLIPADDR
+ MAXLEN_TRUSTEDIP + MAXLEN_TRUSTEDPORT + 5 + 15;
// max length of: digest + cname + username + vpnipaddr + vpnipmask
// + remipaddr + remport + pid + extra buffer
@@ -104,8 +104,8 @@ eurephiaSESSION *eDBopen_session_seed(eurephiaCTX *ctx, const char *digest,
free_nullsafe(ctx, new_session);
return NULL;
}
- snprintf(seeddata, totlen, "%.60s%.64s%.34s%.34s%.34s%.34s%.6s%05i",
- digest, cname, username, vpnipaddr, vpnipmask, remipaddr, remport, getpid());
+ snprintf(seeddata, totlen, "%.60s%.64s%.34s%.34s%.34s%.6s%05i",
+ digest, cname, username, vpnipaddr, remipaddr, remport, getpid());
// Generate a SHA512 version of session seed
memset(&sha, 0, sizeof(SHA512Context));