openwall / openwall/john

Tunable cost names containing string ", "

Open
#4,712 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

From formats.h:

/*
 * Descriptions (names) of tunable cost parameters for this format
 *
 * These names shouldn't contain ',', because ", " is used
 * as a separator when listing tunable cost parameters
 * in --list=format-details and --list=format-all-details.
 * The sequence of names should match the sequence of functions
 * returning tunable cost values.
 */
	char *tunable_cost_name[FMT_TUNABLE_COSTS];

Nevertheless, several formats have tunable cost names which contain , (especially formats which report a list of different algorithms as a tunable cost.

I intend to fix the offending formats, e.g. by replacing

"algorithm [0=AES, 1=TwoFish, 2=ChaCha]"

with

"algorithm [0=AES 1=TwoFish 2=ChaCha]"

and then enhancing format self test (fail if a tunable cost contains , (or even just ,), and fail if a tunable cost name i empty or if the number of elements in tunable_cost_value[] and tunable_cost_name[] differ.

Any objections?

Should this test be executed only for `full_lvl >= 0
Probably it is best to but all these tunable cost specific into a separate function.

Anything else related to tunable costs that needs to be tested?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tunable_cost_name definition and comments in formats.h, then locate the format self test and the --list=format-details output it protects. Identify format names containing ", ", update the offending entries, and make the self test reject comma-containing or empty names and mismatched tunable cost arrays.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.