Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test $6$rounds=10$roundstoolow fails with libxcrypt #13

Open
mweinelt opened this issue Oct 2, 2022 · 1 comment
Open

Test $6$rounds=10$roundstoolow fails with libxcrypt #13

mweinelt opened this issue Oct 2, 2022 · 1 comment

Comments

@mweinelt
Copy link

mweinelt commented Oct 2, 2022

Hi,

we are replacing glibc's crypt functionality with that of libxcrypt in nixpkgs and we are seeing one test failure.

Would you mind looking into that?

crypt-sha> Running 1 test suites...
crypt-sha> Test suite example: RUNNING...
crypt-sha> Tests
crypt-sha>   cryptSHA512
crypt-sha>     $6$saltstring:                        OK
crypt-sha>     $6$rounds=10000$saltstringsaltstring: OK
crypt-sha>     $6$rounds=5000$toolongsaltstring:     OK
crypt-sha>     $6$rounds=1400$anotherlongsaltstring: OK
crypt-sha>     $6$rounds=77777$short:                OK (0.05s)
crypt-sha>     $6$rounds=123456$asaltof16chars..:    OK (0.05s)
crypt-sha>     $6$rounds=10$roundstoolow:            OK
crypt-sha>     $6$saltstring:                        OK
crypt-sha>     $6$saltstring:                        OK
crypt-sha>     $6$saltstring:                        OK
crypt-sha>   cryptSHA512Raw
crypt-sha>     saltstring Nothing:                   OK
crypt-sha>     saltstringsaltstring Just 10000:      OK
crypt-sha>     toolongsaltstring Just 5000:          OK
crypt-sha>     anotherlongsaltstring Just 1400:      OK
crypt-sha>     short Just 77777:                     OK (0.05s)
crypt-sha>     asaltof16chars.. Just 123456:         OK (0.05s)
crypt-sha>     roundstoolow Just 10:                 OK
crypt-sha>   crypt
crypt-sha>     $6$saltstring:                        OK
crypt-sha>     $6$rounds=10000$saltstringsaltstring: OK
crypt-sha>     $6$rounds=5000$toolongsaltstring:     OK
crypt-sha>     $6$rounds=1400$anotherlongsaltstring: OK
crypt-sha>     $6$rounds=77777$short:                OK (0.05s)
crypt-sha>     $6$rounds=123456$asaltof16chars..:    OK (0.04s)
crypt-sha>     $6$rounds=10$roundstoolow:            FAIL
crypt-sha>       test/Example.hs:96:
crypt-sha>       expected: Just "$6$rounds=1000$roundstoolow$kUMsbe306n21p9R.FRkW3IGn.S9NPN0x50YhH1xhLsPuWGsUSklZt58jaTfF4ZEQpyUNGc0dqbpBYYBaHHrsX."
crypt-sha>        but got: Nothing
crypt-sha>       Use -p '/crypt.$6$rounds=10$roundstoolow/' to rerun this test only.
crypt-sha>     $6$saltstring:                        OK
crypt-sha>     $6$saltstring:                        OK
crypt-sha>     $6$saltstring:                        OK
crypt-sha>   glibc and native impl comparison:       OK (0.51s)
crypt-sha>     +++ OK, passed 100 tests.
crypt-sha> 
crypt-sha> 1 out of 28 tests failed (0.86s)
crypt-sha> Test suite example: FAIL
crypt-sha> Test suite logged to: dist/test/crypt-sha512-0-example.log
crypt-sha> 0 of 1 test suites (0 of 1 test cases) passed.
error: builder for '/nix/store/43qcy1vr31zsknf2j5lg3sq2nwgpvyz6-crypt-sha512-0.drv' failed with exit code 1;
@phadej
Copy link
Owner

phadej commented Oct 2, 2022

This looks like a difference between libxcrypt and glibc's crypt implementation, and libxcrypt implementation doesn't mention anything about round too low behavior differences.

I consider this a bug in libxcrypt until there is a reference showing it's intended behavior and why so.

mweinelt added a commit to mweinelt/nixpkgs that referenced this issue Oct 9, 2022
and disable tests due to different ehaviour exhibited compared to
glibc when a low number of rounds is passed.

phadej/crypt-sha512#13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants