main: reject explicit parameters when decrypting - #437
Open
woahwhattheheck wants to merge 2 commits into
Open
woahwhattheheck wants to merge 2 commits into
woahwhattheheck wants to merge 2 commits into
Conversation
This was referenced Sep 13, 2026
woahwhattheheck
added a commit
to woahwhattheheck/scrypt
that referenced
this pull request
Sep 13, 2026
Replay the focused Tarsnap#437 fix onto current fork master while preserving the fork's newer regressions.
|
Maintainer review requested for #437 (fixes #436). The current carrier is OPEN and mergeable at Please review the current head, approve the fork workflow if you want a fresh upstream run, and confirm bounty classification/payment for reporter |
woahwhattheheck
force-pushed
the
fix/dec-explicit-params
branch
from
September 21, 2026 03:02
45d7c23 to
df47104
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #436.
scrypt decaccepted--logN,-rand-p, passed them through toscryptdec_file_prep(), and died on that function's assertion withSIGABRT(exit 134, core dumped).
Explicit parameters are encryption-only —
scrypt.1already states that whendecrypting, the values always come from the encryption header. So this is
documented misuse; the bug is that it aborts instead of producing a diagnostic.
The existing checks in
main()enforce only the all-or-none rule among the threeparameters, so an incomplete set already gives a clean error and exit 1, while a
complete set on
decreached the assertion.This rejects the parameters in
main(), alongside the checks that are alreadythere. Testing
params.logNalone is sufficient because the all-or-none checksabove have already run, so at that point the three are either all zero or all
non-zero.
Before:
After:
The test goes into
tests/09-explicit-params.shnext to the existingpartially-specified-parameter checks, rather than a new file, to keep the change
small and avoid touching
Makefile.am.I did not change
scrypt info, which also ignores explicit parameters but exits 0rather than crashing; whether it should warn seems like a separate question.
Checks. Build and the full test suite pass on macOS, Ubuntu/clang and
Ubuntu/gcc, with
09-explicit-params... SUCCESS!on all three:https://github.com/woahwhattheheck/scrypt/actions/runs/34066975743