Change password timeout from 1 seconds to 500000 microseconds.
authorJanusz Kozerski <j.kozerski@samsung.com>
Wed, 20 Mar 2013 10:27:28 +0000 (11:27 +0100)
committerJanusz Kozerski <j.kozerski@samsung.com>
Wed, 20 Mar 2013 10:27:28 +0000 (11:27 +0100)
[Issue#]    N/A
[Bug]       N/A
[Cause]     N/A
[Solution]  N/A

[Verification] Run all security-server tests.

src/include/security-server-common.h
src/server/security-server-password.c

index 03893d2..7874384 100644 (file)
@@ -74,7 +74,9 @@
 #define SECURITY_SERVER_HISTORY_FILE_NAME      "history"
 #define SECURITY_SERVER_MAX_PASSWORD_LEN               32
 #define SECURITY_SERVER_HASHED_PWD_LEN                 32  /* SHA256 */
-#define SECURITY_SERVER_PASSWORD_RETRY_TIMEOUT_SECOND          1
+#define SECURITY_SERVER_PASSWORD_RETRY_TIMEOUT_SECOND       1        /* Deprecated. Will be removed. */
+#define SECURITY_SERVER_PASSWORD_RETRY_TIMEOUT_MICROSECOND  500000   /* = 500 milliseconds */
+
 #define SECURITY_SERVER_MAX_PASSWORD_HISTORY   50
 #define SECURITY_SERVER_NUM_THREADS                    10
 
index 367b5d6..bedfb56 100644 (file)
@@ -573,11 +573,11 @@ int check_retry(const struct timeval cur_try)
        interval_sec = cur_try.tv_sec - prev_try.tv_sec;
        interval_usec = cur_try.tv_usec - prev_try.tv_usec;
        prev_try = cur_try;
-       if(interval_sec > SECURITY_SERVER_PASSWORD_RETRY_TIMEOUT_SECOND)
+       if(interval_sec == 0
+               && interval_usec > SECURITY_SERVER_PASSWORD_RETRY_TIMEOUT_MICROSECOND)
                return SECURITY_SERVER_SUCCESS;
 
-       if(interval_sec == SECURITY_SERVER_PASSWORD_RETRY_TIMEOUT_SECOND
-                       && interval_usec >= 0)
+       if(interval_sec > 0)
                return SECURITY_SERVER_SUCCESS;
 
        SEC_SVR_DBG("%s", "retry timer hit");