diff --git a/CHANGELOG.md b/CHANGELOG.md index faa252e..c6129dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Dates are omitted for releases predating this file; see the git tags for exact timing. +## [2.14.2] - 2026-07-25 + +### Changed + +- Renamed the internal `_omen_pick_training_wordlist` helper to + `_pick_training_wordlist`, since it is shared by the OMEN, Markov-adjacent, + and LLM (wordlist mode) attacks rather than being OMEN-specific. + ## [2.14.1] - 2026-07-25 ### Fixed diff --git a/hate_crack/attacks.py b/hate_crack/attacks.py index 9df54e6..837bbce 100644 --- a/hate_crack/attacks.py +++ b/hate_crack/attacks.py @@ -592,7 +592,7 @@ def ollama_attack(ctx: Any) -> None: ) return elif choice == "2": - path = _omen_pick_training_wordlist(ctx, title="LLM Sample Wordlists") + path = _pick_training_wordlist(ctx, title="LLM Sample Wordlists") if not path: return ctx.hcatOllama(ctx.hcatHashType, ctx.hcatHashFile, "wordlist", path) @@ -606,7 +606,7 @@ def ollama_attack(ctx: Any) -> None: print("\t[!] Invalid selection.") -def _omen_pick_training_wordlist(ctx: Any, title: str = "Training Wordlists"): +def _pick_training_wordlist(ctx: Any, title: str = "Training Wordlists"): """Show wordlist picker. Returns path or None (user cancelled with 'q').""" wordlist_files = ctx.list_wordlist_files(ctx.hcatWordlists) # Print the grid once, outside the retry loop: a wordlists directory can @@ -682,7 +682,7 @@ def omen_attack(ctx: Any) -> None: print("\n\tNo valid OMEN model found. Training is required.") if need_training: - training_file = _omen_pick_training_wordlist(ctx) + training_file = _pick_training_wordlist(ctx) if not training_file: return if not ctx.hcatOmenTrain(training_file): @@ -709,7 +709,7 @@ def _markov_pick_training_source(ctx: Any): has_cracked = os.path.isfile(out_path) and os.path.getsize(out_path) > 0 wordlist_files = ctx.list_wordlist_files(ctx.hcatWordlists) - # Print the grid once, outside the retry loop — see _omen_pick_training_wordlist. + # Print the grid once, outside the retry loop — see _pick_training_wordlist. entries = [] if has_cracked: entries.append("0) Cracked passwords (current session)") diff --git a/tests/test_attacks_behavior.py b/tests/test_attacks_behavior.py index ae7186b..5436dba 100644 --- a/tests/test_attacks_behavior.py +++ b/tests/test_attacks_behavior.py @@ -532,7 +532,7 @@ class TestOllamaAttack: class TestOmenPickTrainingWordlistReprompt: - """_omen_pick_training_wordlist re-prompts on invalid input instead of aborting.""" + """_pick_training_wordlist re-prompts on invalid input instead of aborting.""" def _make_ctx(self, wordlist_files=None): ctx = MagicMock() @@ -542,29 +542,29 @@ class TestOmenPickTrainingWordlistReprompt: return ctx def test_invalid_input_reprompts_then_valid_pick(self) -> None: - from hate_crack.attacks import _omen_pick_training_wordlist + from hate_crack.attacks import _pick_training_wordlist ctx = self._make_ctx(["rockyou.txt"]) # First input is invalid, second is valid with patch("builtins.input", side_effect=["bad", "1"]): - result = _omen_pick_training_wordlist(ctx) + result = _pick_training_wordlist(ctx) assert result is not None assert "rockyou.txt" in result def test_cancel_with_q_returns_none(self) -> None: - from hate_crack.attacks import _omen_pick_training_wordlist + from hate_crack.attacks import _pick_training_wordlist ctx = self._make_ctx(["rockyou.txt"]) with patch("builtins.input", return_value="q"): - result = _omen_pick_training_wordlist(ctx) + result = _pick_training_wordlist(ctx) assert result is None def test_multiple_invalid_inputs_then_cancel(self) -> None: - from hate_crack.attacks import _omen_pick_training_wordlist + from hate_crack.attacks import _pick_training_wordlist ctx = self._make_ctx(["rockyou.txt"]) with patch("builtins.input", side_effect=["99", "abc", "q"]): - result = _omen_pick_training_wordlist(ctx) + result = _pick_training_wordlist(ctx) assert result is None diff --git a/tests/test_custom_path_autocomplete.py b/tests/test_custom_path_autocomplete.py index 26e5c92..271aad3 100644 --- a/tests/test_custom_path_autocomplete.py +++ b/tests/test_custom_path_autocomplete.py @@ -41,7 +41,7 @@ class TestOmenCustomPath: ctx = _make_ctx() ctx.select_file_with_autocomplete.return_value = "/data/custom.txt" with patch("builtins.input", side_effect=["p"]): - result = attacks._omen_pick_training_wordlist(ctx) + result = attacks._pick_training_wordlist(ctx) ctx.select_file_with_autocomplete.assert_called_once() assert result == "/data/custom.txt" @@ -50,7 +50,7 @@ class TestOmenCustomPath: ctx = _make_ctx() ctx.select_file_with_autocomplete.return_value = None with patch("builtins.input", side_effect=["p"]): - result = attacks._omen_pick_training_wordlist(ctx) + result = attacks._pick_training_wordlist(ctx) assert result is None