added: possibility to encode the session cookie (added files core/sessionidmanager.h and core/sessionidmanager.cpp)

added: config options:
       // whether or not we should encode the session cookie
       // (we have a special algorithm)
       // default: false
       bool session_cookie_encode;

       // if session_cookie_encode is true then you should provide
       // a file where AES keys will be stored
       std::wstring session_keys_file;

       // each session has an index -- an unsigned int value
       // this value is sent in the cookie string (is encoded)
       // and is incremented when session_index_time_increment time is passed since the last incrementing
       // if a client sent the cookie back the difference between
       // current index and the index in the cookie should be less than or equal to session_allow_index_difference
       // default: 8
       size_t session_allow_index_difference;

       // the time which should pass after the session index is incremented
       // default: 30
       // (session_allow_index_difference + 1) * session_index_time_increment should be less than a time
       // load of a page and all elements on it such as images (of course it depends on client's download too)
       time_t session_index_time_increment;

       // time in seconds after a new AES key pair should be generated
       // we have 256 pairs of keys so this time multiplied by 256 should not be less than
       // the max time of a session (session_remember_max_idle),
       // by default: 256 * 2 days = 512 days = 1.4 year > 3 months (session_remember_max_idle)
       // default: 172800 = 2 days (max: 2678400 = 1 month, min: 10)
       size_t session_key_renew_time;

changed: when printing the time of a request we print only two non-zero digits






git-svn-id: svn://ttmath.org/publicrep/winix/trunk@994 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2014-11-22 15:30:56 +00:00
parent 3547d326b8
commit 76314aab10
28 changed files with 1360 additions and 240 deletions

View File

@@ -65,6 +65,8 @@ createticket.o: ../../../winix/core/timezone.h
createticket.o: ../../../winix/core/sessionmanager.h
createticket.o: ../../../winix/core/sessioncontainer.h
createticket.o: ../../../winix/core/ipbancontainer.h
createticket.o: ../../../winix/core/sessionidmanager.h
createticket.o: ../../../tito/src/base64.h ../../../tito/src/aes.h
createticket.o: ../../../winix/functions/functions.h
createticket.o: ../../../winix/functions/functionbase.h
createticket.o: ../../../winix/core/request.h ../../../winix/core/system.h
@@ -222,6 +224,8 @@ editticket.o: ../../../winix/core/timezones.h
editticket.o: ../../../winix/core/sessionmanager.h
editticket.o: ../../../winix/core/sessioncontainer.h
editticket.o: ../../../winix/core/ipbancontainer.h
editticket.o: ../../../winix/core/sessionidmanager.h
editticket.o: ../../../tito/src/base64.h ../../../tito/src/aes.h
editticket.o: ../../../winix/templates/templates.h
editticket.o: ../../../winix/templates/patterncacher.h
editticket.o: ../../../winix/templates/indexpatterns.h
@@ -324,6 +328,8 @@ funticket.o: ../../../winix/core/timezones.h
funticket.o: ../../../winix/core/sessionmanager.h
funticket.o: ../../../winix/core/sessioncontainer.h
funticket.o: ../../../winix/core/ipbancontainer.h
funticket.o: ../../../winix/core/sessionidmanager.h
funticket.o: ../../../tito/src/base64.h ../../../tito/src/aes.h
funticket.o: ../../../winix/templates/templates.h
funticket.o: ../../../winix/templates/patterncacher.h
funticket.o: ../../../winix/templates/indexpatterns.h
@@ -412,7 +418,8 @@ init.o: ../../../winix/core/threadmanager.h ../../../winix/core/timezones.h
init.o: ../../../winix/core/sessionmanager.h
init.o: ../../../winix/core/sessioncontainer.h
init.o: ../../../winix/core/ipbancontainer.h
init.o: ../../../winix/templates/templates.h
init.o: ../../../winix/core/sessionidmanager.h ../../../tito/src/base64.h
init.o: ../../../tito/src/aes.h ../../../winix/templates/templates.h
init.o: ../../../winix/templates/patterncacher.h
init.o: ../../../winix/templates/indexpatterns.h
init.o: ../../../winix/templates/patterns.h
@@ -532,6 +539,8 @@ showtickets.o: ../../../winix/core/timezones.h
showtickets.o: ../../../winix/core/sessionmanager.h
showtickets.o: ../../../winix/core/sessioncontainer.h
showtickets.o: ../../../winix/core/ipbancontainer.h
showtickets.o: ../../../winix/core/sessionidmanager.h
showtickets.o: ../../../tito/src/base64.h ../../../tito/src/aes.h
showtickets.o: ../../../winix/templates/templates.h
showtickets.o: ../../../winix/templates/patterncacher.h
showtickets.o: ../../../winix/templates/indexpatterns.h
@@ -637,6 +646,8 @@ templates.o: ../../../winix/core/timezones.h
templates.o: ../../../winix/core/sessionmanager.h
templates.o: ../../../winix/core/sessioncontainer.h
templates.o: ../../../winix/core/ipbancontainer.h
templates.o: ../../../winix/core/sessionidmanager.h
templates.o: ../../../tito/src/base64.h ../../../tito/src/aes.h
templates.o: ../../../winix/templates/templates.h
templates.o: ../../../winix/templates/patterncacher.h
templates.o: ../../../winix/templates/indexpatterns.h
@@ -749,6 +760,8 @@ ticketinfo.o: ../../../winix/core/timezones.h
ticketinfo.o: ../../../winix/core/sessionmanager.h
ticketinfo.o: ../../../winix/core/sessioncontainer.h
ticketinfo.o: ../../../winix/core/ipbancontainer.h
ticketinfo.o: ../../../winix/core/sessionidmanager.h
ticketinfo.o: ../../../tito/src/base64.h ../../../tito/src/aes.h
ticketinfo.o: ../../../winix/templates/templates.h
ticketinfo.o: ../../../winix/templates/patterncacher.h
ticketinfo.o: ../../../winix/templates/indexpatterns.h