diff options
Diffstat (limited to 'common/eurephiadb_session_common.c')
-rw-r--r-- | common/eurephiadb_session_common.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/common/eurephiadb_session_common.c b/common/eurephiadb_session_common.c index 9e51702..76cd1c0 100644 --- a/common/eurephiadb_session_common.c +++ b/common/eurephiadb_session_common.c @@ -1,6 +1,6 @@ /* eurephiadb_session_common.c -- Common function for handling sessions * - * 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 @@ -22,7 +22,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <openssl/rand.h> #include <eurephia_nullsafe.h> #include <eurephia_context.h> @@ -95,30 +94,6 @@ int eDBset_session_value(eurephiaCTX *ctx, eurephiaSESSION *session, const char } -// Generate some random data and return a string. -static int rand_init = 0; -int eDBsessionGetRandString(eurephiaCTX *ctx, char *rndstr, int len) { - int attempts = 0; - do { - if( !rand_init ) { - if( !RAND_load_file("/dev/urandom", 64) ) { - eurephia_log(ctx, LOG_FATAL, 0, "Could not load random data from /dev/urandom"); - return 0; - } - rand_init = 1; - } - - if( RAND_pseudo_bytes((unsigned char *) rndstr, len) ) { - return 1; - } - sleep(1); - rand_init = 0; - } while( attempts++ < 11 ); - eurephia_log(ctx, LOG_FATAL, 0, "RAND_pseudo_bytes() could not generate enough random data"); - return 0; -} - - // Free up the memory used by a session structure void eDBfree_session_func(eurephiaCTX *ctx, eurephiaSESSION *session) { if( session == NULL ) { |