Branch: Tag:

2001-01-06

2001-01-06 07:24:26 by Martin Nilsson <mani@lysator.liu.se>

Added function that creates a unique, hard to guess id. Essentially Kai Voigts sessionid_create()

Rev: server/base_server/global_variables.pike:1.57
Rev: server/base_server/roxen.pike:1.607
Rev: server/base_server/roxenloader.pike:1.225

4:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.606 2001/01/04 08:48:57 nilsson Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.607 2001/01/06 07:24:26 nilsson Exp $";      // Used when running threaded to find out which thread is the backend thread,   // for debug purposes only.
1553:   #endif   }    -  +    int increase_id()   {    if(!current_user_id_file)
1571:    return current_user_id_number;   }    + private int unique_id_counter; + string create_unique_id() + { +  object md5 = Crypto.md5(); +  md5->update(query("server_salt") + (unique_id_counter++) + time(1)); +  return Crypto.string_to_hex(md5->digest()); + }    -  +    #ifndef __NT__   static int abs_started;