diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2025-07-07 17:26:47 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2025-07-07 17:26:47 +0200 |
| commit | 479d8db99faa005783fc483d0830314d6156e51f (patch) | |
| tree | 2b26f9bba88ddf1f32532e5de9bcae0886cc81d3 /libbb | |
| parent | 75758c73608f3c6be9ea2d338a199a8aa11c51e2 (diff) | |
libbb/yescrypt: fix salts ending in dots (corresponding to binary zeros)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
| -rw-r--r-- | libbb/yescrypt/alg-yescrypt-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/yescrypt/alg-yescrypt-common.c b/libbb/yescrypt/alg-yescrypt-common.c index 1e896df64..262fe82fb 100644 --- a/libbb/yescrypt/alg-yescrypt-common.c +++ b/libbb/yescrypt/alg-yescrypt-common.c @@ -94,7 +94,7 @@ static const uint8_t *decode64( store: dbg_dec64(" storing bits:%d v:%08x", bits, (int)SWAP_BE32(value)); //BE to see lsb first while (dstpos < *dstlen) { - if (srclen == 0 && value == 0) { + if (srclen == 0 && value == 0 && bits < 8) { /* Example: mkpasswd PWD '$y$j9T$123': * the "123" is bits:18 value:03,51,00 * is considered to be 2 bytes, not 3! |
