Revert high CPU password hashing until separate threads are used

This commit is contained in:
Roger A. Light
2025-02-27 22:34:47 +00:00
parent 94b8dfad37
commit 1662641b25
3 changed files with 4 additions and 6 deletions

View File

@@ -99,7 +99,8 @@ endif()
find_package(cJSON REQUIRED)
find_package(argon2)
if(ARGON2_FOUND)
add_definitions("-DWITH_ARGON2")
# Disable until separate password handling thread is implemented
#add_definitions("-DWITH_ARGON2")
endif()
option(WITH_LTO "Build with link time optimizations (IPO) / interprocedural optimization (IPO) enabled." ON)

View File

@@ -146,9 +146,6 @@ WITH_SQLITE=yes
# currently only suitable for use with oss-fuzz.
WITH_FUZZING=no
# Build with argon2id support for password hashing.
WITH_ARGON2=yes
# Build using clang and with address sanitiser enabled
WITH_ASAN=no

View File

@@ -44,7 +44,7 @@ Contributors:
# define MOSQ_ARGON2_P 1
#endif
#define PW_DEFAULT_ITERATIONS 210000
#define PW_DEFAULT_ITERATIONS 1000
static int pw__encode(struct mosquitto_pw *pw);
struct mosquitto_pw{
@@ -530,10 +530,10 @@ int mosquitto_pw_hash_encoded(struct mosquitto_pw *pw, const char *password)
int rc = MOSQ_ERR_INVAL;
switch(pw->hashtype){
case MOSQ_PW_DEFAULT:
case MOSQ_PW_ARGON2ID:
rc = pw__create_argon2id(pw, password);
break;
case MOSQ_PW_DEFAULT:
case MOSQ_PW_SHA512_PBKDF2:
rc = pw__create_sha512_pbkdf2(pw, password);
break;