From ea92f408ee3d103c1668f36a7d4117a3fcebbf13 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 13 Sep 2012 17:34:56 +0200 Subject: 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 --- plugin/eurephiadb_session.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugin') 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 * * 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)); -- cgit