Document -I option for sha512-pbkdf2 iterations

Signed-off-by: Mikkel Kirkgaard Nielsen <miki+eclipse@mikini.dk>
This commit is contained in:
Mikkel Kirkgaard Nielsen 2026-02-11 18:14:28 +01:00
parent 5753dafaee
commit 96f62ce260
2 changed files with 21 additions and 4 deletions

View file

@ -118,11 +118,11 @@ static void print_usage(void)
{
printf("mosquitto_passwd is a tool for managing password files for mosquitto.\n\n");
#ifndef WITH_ARGON2
printf("Usage: mosquitto_passwd [-H sha512 | -H sha512-pbkdf2] [-c | -D] passwordfile username\n");
printf(" mosquitto_passwd [-H sha512 | -H sha512-pbkdf2] [-c] -b passwordfile username password\n");
printf("Usage: mosquitto_passwd [-H sha512 | -H sha512-pbkdf2] [-I iterations] [-c | -D] passwordfile username\n");
printf(" mosquitto_passwd [-H sha512 | -H sha512-pbkdf2] [-I iterations] [-c] -b passwordfile username password\n");
#else
printf("Usage: mosquitto_passwd [-H argon2id | -H sha512-pbkdf2] [-c | -D] passwordfile username\n");
printf(" mosquitto_passwd [-H argon2id | -H sha512-pbkdf2] [-c] -b passwordfile username password\n");
printf("Usage: mosquitto_passwd [-H argon2id | -H sha512-pbkdf2] [-I iterations] [-c | -D] passwordfile username\n");
printf(" mosquitto_passwd [-H argon2id | -H sha512-pbkdf2] [-I iterations] [-c] -b passwordfile username password\n");
#endif
printf(" mosquitto_passwd -U passwordfile\n");
printf(" -b : run in batch mode to allow passing passwords on the command line.\n");
@ -135,6 +135,7 @@ static void print_usage(void)
printf(" Mosquitto 2.x and earlier defaulted to sha512-pbkdf2.\n"); // FIXME - substitute last version with pbkdf2 default
#endif
printf(" Mosquitto 1.6 and earlier defaulted to sha512.\n");
printf(" -I : specify the number of iterations for sha512-pbkdf2 algorithm. Defaults to 1000.\n");
printf(" -U : update a plain text password file to use hashed passwords.\n");
printf("\nSee https://mosquitto.org/ for more information.\n\n");
}

View file

@ -20,6 +20,9 @@
<group>
<arg choice='plain'><option>-H</option> <replaceable>hash</replaceable></arg>
</group>
<group>
<arg choice='plain'><option>-I</option> <replaceable>iterations</replaceable></arg>
</group>
<group>
<arg choice='plain'><option>-c</option></arg>
<arg choice='plain'><option>-D</option></arg>
@ -32,6 +35,9 @@
<group>
<arg choice='plain'><option>-H</option> <replaceable>hash</replaceable></arg>
</group>
<group>
<arg choice='plain'><option>-I</option> <replaceable>iterations</replaceable></arg>
</group>
<arg choice='plain'><option>-b</option></arg>
<arg choice='plain'><replaceable>passwordfile</replaceable></arg>
<arg choice='plain'><replaceable>username</replaceable></arg>
@ -109,6 +115,16 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-I</option></term>
<listitem>
<para>
Specify the number of iterations to use for
generating <replaceable>sha512-pbkdf2</replaceable>
hashes. Defaults to 1000.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-U</option></term>
<listitem>