magnumripper/JohnTheRipper — pull request #121 by claudioandre (2012-12-07 22:14:15+00:00)
Title: Fix a bug inside get_salt.

Magnum, this is a bug (at least) in CPU sha256crypt and sha256crypt formats.

In the situation below srounds = 939.
$5$rounds=939$LKO/Ute40T3FNF95$U0prpBQd4PloSGU0pnpM4z9wKn4vZ1.jsrzQfPqxph9

Then:
out.rounds = srounds < ROUNDS_MIN ? ROUNDS_MIN : srounds; => out.rounds = 1000 (ok); srounds = 939.

But:
out.rounds = srounds > ROUNDS_MAX ? ROUNDS_MAX : srounds; => out.bounds = 939 (wrong, must use the corrected value)