diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2009-01-10 00:49:59 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-01-10 00:49:59 +0100 |
| commit | d5c7a4c72731cc36e0e8cf4fd3a6a0811344a4d8 (patch) | |
| tree | 8a9c24f5e99acf06bab383f1c798bb0a174317a5 /plugin | |
| parent | be9c9cab62dbfe03ff6b2a44b9eefc27e8afd0b4 (diff) | |
| download | eurephia-d5c7a4c72731cc36e0e8cf4fd3a6a0811344a4d8.tar.gz eurephia-d5c7a4c72731cc36e0e8cf4fd3a6a0811344a4d8.tar.xz eurephia-d5c7a4c72731cc36e0e8cf4fd3a6a0811344a4d8.zip | |
Moved eDBsessionGetRandString(...) to a more global and independent eurephia_randstring(...) function
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | plugin/eurephia.c | 3 | ||||
| -rw-r--r-- | plugin/eurephiadb_session.c | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index bf0202d..82fbb6e 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -14,6 +14,7 @@ SET(eurephia_auth_SRC ../common/eurephiadb_session_common.c ../common/passwd.c ../common/sha512.c + ../common/randstr.c ) SET(subdirs "") IF(FW_IPTABLES) diff --git a/plugin/eurephia.c b/plugin/eurephia.c index b04af5e..cf0fce9 100644 --- a/plugin/eurephia.c +++ b/plugin/eurephia.c @@ -34,6 +34,7 @@ #include <eurephiadb_session_common.h> #include <eurephiadb_session.h> #include <certinfo.h> +#include <randstr.h> #include <passwd.h> #define MAX_ARGUMENTS 64 @@ -197,7 +198,7 @@ eurephiaCTX *eurephiaInit(const char **argv) // Get data for server_salt - which will be used for the password cache ctx->server_salt = (char *) malloc(SIZE_PWDCACHE_SALT+2); memset(ctx->server_salt, 0, SIZE_PWDCACHE_SALT+2); - if( !eDBsessionGetRandString(ctx, ctx->server_salt, SIZE_PWDCACHE_SALT) ) { + if( !eurephia_randstring(ctx, ctx->server_salt, SIZE_PWDCACHE_SALT) ) { eurephia_log(ctx, LOG_PANIC, 0 , "Could not get enough random data for password cache."); free_nullsafe(ctx->server_salt); diff --git a/plugin/eurephiadb_session.c b/plugin/eurephiadb_session.c index 58e93db..3b59f77 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 - Copyright (C) 2008 David Sommerseth <dazo@users.sourceforge.net> + * GPLv2 - Copyright (C) 2008, 2009 David Sommerseth <dazo@users.sourceforge.net> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,6 +30,7 @@ #include "eurephia_log.h" #include "eurephiadb_session.h" #include <eurephiadb_session_common.h> +#include <randstr.h> #include "sha512.h" @@ -150,7 +151,7 @@ eurephiaSESSION *eDBopen_session_seed(eurephiaCTX *ctx, const char *digest, memset(rndstr, 0, (totlen * 2)); rndlen = ((totlen * 2) - strlen_nullsafe(seed) - 2); - if( !eDBsessionGetRandString(ctx, rndstr, rndlen) ) { + if( !eurephia_randstring(ctx, rndstr, rndlen) ) { eurephia_log(ctx, LOG_PANIC, 0, "Could not generate enough random data for session key"); free_nullsafe(new_session->sessionkey); |
