Fix build for WITH_TLS=no WITH_ARGON2=yes WITH_ASAN=yes

This commit is contained in:
Roger A. Light
2026-02-05 10:43:39 +00:00
parent 502dfb75d6
commit 5ce4f07f6a
+4 -3
View File
@@ -104,9 +104,10 @@ static int pw__create_argon2id(struct mosquitto_pw *pw, const char *password)
#ifdef WITH_ARGON2
pw->hashtype = MOSQ_PW_ARGON2ID;
pw->params.argon2id.salt_len = HASH_LEN;
int rc = RAND_bytes(pw->params.argon2id.salt, (int)pw->params.argon2id.salt_len);
if(!rc){
return MOSQ_ERR_UNKNOWN;
int rc = mosquitto_getrandom(pw->params.argon2id.salt, (int)pw->params.argon2id.salt_len);
if(rc){
return rc;
}
size_t encoded_len = argon2_encodedlen(MOSQ_ARGON2_T, MOSQ_ARGON2_M, MOSQ_ARGON2_P,