From dde90f1d4746a2efef20fc227cd38bbcb58d546c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 17 Jul 2025 17:34:14 +0200 Subject: libbb.h: increase MAX_PW_SALT_LEN Signed-off-by: Denys Vlasenko --- include/libbb.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 79427fb31..4f44680aa 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1825,14 +1825,14 @@ extern int obscure(const char *old, const char *newval, const struct passwd *pwd extern int crypt_make_rand64encoded(char *p, int cnt /*, int rnd*/) FAST_FUNC; /* Size of char salt[] to hold randomly-generated salt string * sha256/512: - * "$5$" - * "$6$" - * #define MAX_PW_SALT_LEN (3 + 16 + 1) + * "$5$" ["rounds=999999999$"] "" + * "$6$" ["rounds=999999999$"] "" + * #define MAX_PW_SALT_LEN (3 + sizeof("rounds=999999999$")-1 + 16 + 1) * yescrypt: - * "$y$" "$" - * (84 chars are ascii64-encoded 64 binary bytes) + * "$y$" "$" + * (86 chars are ascii64-encoded 64 binary bytes) */ -#define MAX_PW_SALT_LEN (3 + 8*6 + 1 + 84 + 1) +#define MAX_PW_SALT_LEN (3 + 8*6 + 1 + 86 + 1) extern char* crypt_make_pw_salt(char p[MAX_PW_SALT_LEN], const char *algo) FAST_FUNC; /* Returns number of lines changed, or -1 on error */ -- cgit v1.2.3-55-g6feb