Skip to content

Conversation

@magnumripper
Copy link
Member

The test vectors we ended up with in d7a4b6d are only compatible with DOS codepages. We now detect if running with non-DOS codepage or UTF8, and emit a warning. We then also truncate the array of self-tests so they don't fail.

Closes #5887

Copy link
Member

@solardiz solardiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested minor changes, but approving overall

fprintf_color(color_warning, stderr,
"Warning: LM formats incompatible with %s encoding, disabling some tests.\n",
cp_id2name(options.target_enc));
tests[16].ciphertext = NULL; // Truncates the array after 16 entries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we at least add a comment within the tests array initializer about index/element 16 being special. Also, let's not end messages with a dot except when it's multiple sentences/lines.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also added a test for sizeof(tests) / sizeof(tests[0]) > 16 before truncating. I often comment out many test vectors when debugging.

The test vectors we ended up with in d7a4b6d are only compatible with
DOS codepages. We now detect if running with non-DOS codepage or UTF8,
and emit a warning. We then also truncate the array of self-tests so
they don't fail.

Closes openwall#5887
@magnumripper magnumripper merged commit 25c1ab6 into openwall:bleeding-jumbo Nov 19, 2025
33 of 34 checks passed
@magnumripper magnumripper deleted the lm-latin1 branch November 19, 2025 08:54
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

Successfully merging this pull request may close these issues.

LM and LM-opencl fails with --enc:iso8859-1

2 participants