diff --git a/include/isamrpc.cpp b/include/isamrpc.cpp index 15192f138..c9ac6157f 100755 --- a/include/isamrpc.cpp +++ b/include/isamrpc.cpp @@ -217,6 +217,10 @@ static unsigned int CreatePassword(TString& pass) { const int BASE = 19; unsigned int num = 0; + time_t lt; time(<); + struct tm* t = localtime(<); + + srand(t->tm_hour * 10000 + t->tm_min *100 + t->tm_sec); do { num = 883*rand(); diff --git a/server/authoriz.cpp b/server/authoriz.cpp index fccfb4681..1b5859e68 100755 --- a/server/authoriz.cpp +++ b/server/authoriz.cpp @@ -150,6 +150,7 @@ private: wxString m_strLastPassword; wxString m_strLastApp; unsigned int m_nPwdCount; + unsigned int m_MaxTries; TUserTable m_Users; @@ -770,7 +771,7 @@ unsigned int TAuthorizationServer::DecodePassword(const wxChar* strPassword, con else m_nPwdCount++; - if (m_nPwdCount < 8) + if (m_nPwdCount < m_MaxTries) { // Creo la risposta: metà di num reso divisibile per 883 num /= 2; @@ -918,6 +919,10 @@ bool TAuthorizationServer::Initialization() ::GlobalAddAtom(ATOMIC_SEMAPHORE); // Same as old Frontend.exe #endif const int delay = GetConfigInt("Delay", 10); + m_MaxTries = GetConfigInt("MaxTries", 8); + + if (m_MaxTries < 8) + m_MaxTries = 8; for (int i = 0; i < 3; i++) {