summaryrefslogtreecommitdiffstats
path: root/database/sqlite/edb-sqlite.c
diff options
context:
space:
mode:
Diffstat (limited to 'database/sqlite/edb-sqlite.c')
-rw-r--r--database/sqlite/edb-sqlite.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/database/sqlite/edb-sqlite.c b/database/sqlite/edb-sqlite.c
index 02d15e0..30959e1 100644
--- a/database/sqlite/edb-sqlite.c
+++ b/database/sqlite/edb-sqlite.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include <assert.h>
#define DRIVERVERSION "1.1"
@@ -269,8 +270,7 @@ int eDBauth_user(eurephiaCTX *ctx, const int certid, const char *username, const
pwdok = 0;
} else {
crpwd = eurephia_pwd_crypt(ctx, passwd, dbpwd);
- assert(crpwd != NULL);
- pwdok = (strcmp(crpwd, dbpwd) == 0 ? 1 : 0);
+ pwdok = ((crpwd != NULL) && (strcmp(crpwd, dbpwd) == 0) ? 1 : 0);
memset(crpwd, 0, strlen_nullsafe(crpwd));
memset(dbpwd, 0, strlen_nullsafe(dbpwd));
free_nullsafe(crpwd);
@@ -297,6 +297,7 @@ int eDBauth_user(eurephiaCTX *ctx, const int certid, const char *username, const
} else if( pwdok != 1 ) {
eurephia_log(ctx, LOG_WARNING, 0,"Authentication failed for user '%s'. Wrong password.",
username);
+ sleep(2);
uicid = -1;
} else {
dbresult *upd = NULL;
@@ -317,6 +318,7 @@ int eDBauth_user(eurephiaCTX *ctx, const int certid, const char *username, const
} else {
eurephia_log(ctx, LOG_WARNING, 0, "Authentication failed for user '%s'. "
"Could not find user or user-certificate link.", username);
+ sleep(2);
uicid = 0;
}
sqlite_free_results(res);