Conversation
counter == 0 for LessPass compatibilitycounter == 0 for LessPass compatibility
|
Thank you and sorry for the slow response! Could you add lesspass.rs/tests/make-blackbox-tests.sh Line 14 in 7befe4b |
…ator - Fix logical case when counter equals 0 in salt generation - Fix CLI argument mismatch (--no-lower instead of --no-lowercase) in `make-blackbox-tests.sh` - Regenerate `blackbox.rs` with proper boilerplates and full test vectors
|
Done! I've updated the While I was at it, I also noticed that the generator script was using legacy CLI flags ( The test file has been fully regenerated and the entire history was cleaned up via a force-push. |
71
left a comment
There was a problem hiding this comment.
Thank you and sorry for the slow response again. I will squash before merging anyway, so please push new commits instead of rebasing so it's easy to see a diff between revisions.
| @@ -1,4 +1,4 @@ | |||
| #/bin/sh | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
nit: if bash is needed, I'd rather use
| #!/bin/bash | |
| #!/usr/bin/env -S bash -euo pipefail |
I used /bin/sh to remove dependencies and keep things simple, but if that's not an option, I prefer the stricter / env-dependent shebang.
| exit 2 | ||
| fi | ||
|
|
||
| # Выводим заголовок, импорты и тестовый раннер |
There was a problem hiding this comment.
Can you remove the non-English comments, please?
There was a problem hiding this comment.
To avoid the large diff, could you format this file please? And possibly add cargo fmt or something like that to the end of make-blackbox-tests.sh to make sure this is done automatically.
Fixes the bug where counter = 0 produces an incorrect salt.
Description
There is a bug in salt generation when
counteris set to0. It breaks compatibility with the official LessPass implementation.For any
counter >= 1, the generated passwords match perfectly. However, forcounter = 0, the generated passwords diverge.Steps to Reproduce
With counter = 0 (Bug):
With counter >= 1 (Works correctly):
Root Cause
The issue is located in the
generate_salt_to_uninitfunction (line 138). Whencounteris0, thewhile counter != 0loop condition is immediately false, so the loop never executes. As a result, it returns an empty buffer instead of"0".