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

@@ -109,7 +109,8 @@ adduser.o: ../../winix/core/pluginmsg.h ../../winix/core/system.h
adduser.o: ../../winix/core/sessionmanager.h
adduser.o: ../../winix/core/sessioncontainer.h
adduser.o: ../../winix/core/ipbancontainer.h
adduser.o: ../../winix/functions/functions.h
adduser.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
adduser.o: ../../tito/src/aes.h ../../winix/functions/functions.h
adduser.o: ../../winix/templates/templates.h
adduser.o: ../../winix/templates/patterncacher.h
adduser.o: ../../winix/templates/indexpatterns.h
@@ -365,8 +366,10 @@ cp.o: ../../winix/core/timezones.h ../../winix/core/synchro.h
cp.o: ../../winix/core/misc.h ../../winix/core/plugin.h
cp.o: ../../winix/core/pluginmsg.h ../../winix/core/system.h
cp.o: ../../winix/core/sessionmanager.h ../../winix/core/sessioncontainer.h
cp.o: ../../winix/core/ipbancontainer.h ../../winix/functions/functions.h
cp.o: ../../winix/templates/templates.h ../../winix/templates/patterncacher.h
cp.o: ../../winix/core/ipbancontainer.h ../../winix/core/sessionidmanager.h
cp.o: ../../tito/src/base64.h ../../tito/src/aes.h
cp.o: ../../winix/functions/functions.h ../../winix/templates/templates.h
cp.o: ../../winix/templates/patterncacher.h
cp.o: ../../winix/templates/indexpatterns.h ../../winix/templates/patterns.h
cp.o: ../../winix/templates/changepatterns.h
cp.o: ../../winix/templates/htmltextstream.h
@@ -752,7 +755,8 @@ functions.o: ../../winix/core/pluginmsg.h ../../winix/core/system.h
functions.o: ../../winix/core/sessionmanager.h
functions.o: ../../winix/core/sessioncontainer.h
functions.o: ../../winix/core/ipbancontainer.h
functions.o: ../../winix/functions/functions.h
functions.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
functions.o: ../../tito/src/aes.h ../../winix/functions/functions.h
functions.o: ../../winix/templates/templates.h
functions.o: ../../winix/templates/patterncacher.h
functions.o: ../../winix/templates/indexpatterns.h
@@ -1313,7 +1317,9 @@ mkdir.o: ../../winix/core/timezones.h ../../winix/core/synchro.h
mkdir.o: ../../winix/core/plugin.h ../../winix/core/pluginmsg.h
mkdir.o: ../../winix/core/system.h ../../winix/core/sessionmanager.h
mkdir.o: ../../winix/core/sessioncontainer.h
mkdir.o: ../../winix/core/ipbancontainer.h ../../winix/functions/functions.h
mkdir.o: ../../winix/core/ipbancontainer.h
mkdir.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
mkdir.o: ../../tito/src/aes.h ../../winix/functions/functions.h
mkdir.o: ../../winix/templates/templates.h
mkdir.o: ../../winix/templates/patterncacher.h
mkdir.o: ../../winix/templates/indexpatterns.h
@@ -1420,8 +1426,9 @@ mv.o: ../../winix/core/timezones.h ../../winix/core/synchro.h
mv.o: ../../winix/core/plugin.h ../../winix/core/pluginmsg.h
mv.o: ../../winix/core/system.h ../../winix/core/sessionmanager.h
mv.o: ../../winix/core/sessioncontainer.h ../../winix/core/ipbancontainer.h
mv.o: ../../winix/functions/functions.h ../../winix/templates/templates.h
mv.o: ../../winix/templates/patterncacher.h
mv.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
mv.o: ../../tito/src/aes.h ../../winix/functions/functions.h
mv.o: ../../winix/templates/templates.h ../../winix/templates/patterncacher.h
mv.o: ../../winix/templates/indexpatterns.h ../../winix/templates/patterns.h
mv.o: ../../winix/templates/changepatterns.h
mv.o: ../../winix/templates/htmltextstream.h
@@ -1838,8 +1845,9 @@ rm.o: ../../winix/core/timezones.h ../../winix/core/synchro.h
rm.o: ../../winix/core/plugin.h ../../winix/core/pluginmsg.h
rm.o: ../../winix/core/system.h ../../winix/core/sessionmanager.h
rm.o: ../../winix/core/sessioncontainer.h ../../winix/core/ipbancontainer.h
rm.o: ../../winix/functions/functions.h ../../winix/templates/templates.h
rm.o: ../../winix/templates/patterncacher.h
rm.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
rm.o: ../../tito/src/aes.h ../../winix/functions/functions.h
rm.o: ../../winix/templates/templates.h ../../winix/templates/patterncacher.h
rm.o: ../../winix/templates/indexpatterns.h ../../winix/templates/patterns.h
rm.o: ../../winix/templates/changepatterns.h
rm.o: ../../winix/templates/htmltextstream.h
@@ -1899,7 +1907,9 @@ rmuser.o: ../../winix/core/log.h ../../winix/core/misc.h
rmuser.o: ../../winix/core/plugin.h ../../winix/core/pluginmsg.h
rmuser.o: ../../winix/core/system.h ../../winix/core/sessionmanager.h
rmuser.o: ../../winix/core/sessioncontainer.h
rmuser.o: ../../winix/core/ipbancontainer.h ../../winix/functions/functions.h
rmuser.o: ../../winix/core/ipbancontainer.h
rmuser.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
rmuser.o: ../../tito/src/aes.h ../../winix/functions/functions.h
rmuser.o: ../../winix/templates/templates.h
rmuser.o: ../../winix/templates/patterncacher.h
rmuser.o: ../../winix/templates/indexpatterns.h
@@ -2007,7 +2017,9 @@ sort.o: ../../winix/core/timezones.h ../../winix/core/synchro.h
sort.o: ../../winix/core/plugin.h ../../winix/core/pluginmsg.h
sort.o: ../../winix/core/system.h ../../winix/core/sessionmanager.h
sort.o: ../../winix/core/sessioncontainer.h ../../winix/core/ipbancontainer.h
sort.o: ../../winix/functions/functions.h ../../winix/templates/templates.h
sort.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
sort.o: ../../tito/src/aes.h ../../winix/functions/functions.h
sort.o: ../../winix/templates/templates.h
sort.o: ../../winix/templates/patterncacher.h
sort.o: ../../winix/templates/indexpatterns.h
sort.o: ../../winix/templates/patterns.h
@@ -2175,7 +2187,8 @@ subject.o: ../../winix/core/plugin.h ../../winix/core/pluginmsg.h
subject.o: ../../winix/core/system.h ../../winix/core/sessionmanager.h
subject.o: ../../winix/core/sessioncontainer.h
subject.o: ../../winix/core/ipbancontainer.h
subject.o: ../../winix/functions/functions.h
subject.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
subject.o: ../../tito/src/aes.h ../../winix/functions/functions.h
subject.o: ../../winix/templates/templates.h
subject.o: ../../winix/templates/patterncacher.h
subject.o: ../../winix/templates/indexpatterns.h
@@ -2442,7 +2455,9 @@ upload.o: ../../winix/core/misc.h ../../winix/core/plugin.h
upload.o: ../../winix/core/pluginmsg.h ../../winix/core/system.h
upload.o: ../../winix/core/sessionmanager.h
upload.o: ../../winix/core/sessioncontainer.h
upload.o: ../../winix/core/ipbancontainer.h ../../winix/functions/functions.h
upload.o: ../../winix/core/ipbancontainer.h
upload.o: ../../winix/core/sessionidmanager.h ../../tito/src/base64.h
upload.o: ../../tito/src/aes.h ../../winix/functions/functions.h
upload.o: ../../winix/templates/templates.h
upload.o: ../../winix/templates/patterncacher.h
upload.o: ../../winix/templates/indexpatterns.h