mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2252] using enc_utf16() in prepare() and valid() functions is not working right. #1508
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1508
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jfoug on GitHub (Aug 31, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2252
Reference original issue #2243
Known formats using utf encoding in prepare/valid functions (note gpu will/should have same issue)
These appear to be the formats currently standing, which want to use the enc_to_utf16*() type functions (I did not check things like strlen16() or other unicode usages).
@magnumripper commented on GitHub (Aug 31, 2016):
Here's some things the current, messy, implementation tries to achieve:
The list will grow as I recall more 😵
@magnumripper commented on GitHub (Aug 31, 2016):
Please note that any core changes related to this issue has to go to a topic branch. That includes myself. This is really really tricky shit, I know that from the past. There are sooo many parameters and ways of starting john (let alone resuming).
@jfoug commented on GitHub (Aug 31, 2016):
I figured as much. This 'seems' like not that big of a deal, but I know that encoding issues is MESSY.
@jfoug commented on GitHub (Aug 31, 2016):
I agree on the branch. There was no way I was going to make any change, only to have 9 months go by before obscure stuff shows up totally busted.
@jfoug commented on GitHub (Sep 1, 2016):
From #2243
I think if we make sure that all current formats are properly protected from this issue (formats listed in OP of this thread) then at least we buy time to look at this. Encoding is very powerful, but damn, it sux digging through complexities. Kinda like having something obscure in dynamic not work. Some little looking issue can end up being 100 lines changed in 8 places.
@magnumripper commented on GitHub (Sep 1, 2016):
IRL this is much less of an issue than it may seem. I believe the problems are only showing up when using input files that are not encoded in UTF-8? At least that was the case in #2243.
All the affected formats are best used with UTF-8 input files. In the unlikely case a user picked some legacy encoding instead, he really should specify it on the command line and not rely on any heuristics (the heuristics are mainly for LM which is somewhat of a special case for several reasons).
So possibly this is a "solution":
@magnumripper commented on GitHub (Sep 4, 2016):
Please test
cd4cf0dd. It now bails with error like this:Similar fixes made to mscash and oracle formats.
@magnumripper commented on GitHub (Sep 4, 2016):
An even simpler fix made to as400-ssha1 in
33e4c9f.@jfoug commented on GitHub (Sep 9, 2016):
Are you sure you want to error() in this valid? I would think a 1 time message, and then return 0 for the bad hashes would be more proper for valid. If the user calls john with no -format= then each format's valid gets blindly called. Would suck to have an input file that john bailed out on, especially since the format does NOT know if it is being used, OR if it is just being queried for validity.
@jfoug commented on GitHub (Sep 10, 2016):
9037a83and2684366@magnumripper commented on GitHub (Sep 10, 2016):
You are right. Thanks!
@jfoug commented on GitHub (Sep 10, 2016):
Ok, this 'buys' us a bandage, until we can figure out a real solution, OR close this with a document listing that encoding usage is not valid until after init() has been called.
@magnumripper commented on GitHub (Oct 7, 2016):
Documented in https://github.com/magnumripper/JohnTheRipper/wiki/split()-vs.-prepare()