Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 05 May 2015 23:37:10 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: get_binary_*() and get_hash_*() methods

On 2015-05-05 23:19, Aleksey Cherepanov wrote:
> On Tue, May 05, 2015 at 10:40:24PM +0200, magnum wrote:
>> On 2015-05-05 21:53, Aleksey Cherepanov wrote:
>>> Though some formats define get_hash_6 as "return 0;".
>>
>> Sounds like a bug to me. I think there should be no get_hash_6 in that case
>> (ie. the function pointer should be NULL).
>
> I must have confused something with it. Sorry!
>
> Though there is 1 format that can return 0 from get_hash*:
>
> $ grep 'get_hash.*return 0;' JohnTheRipper/src/*
> JohnTheRipper/src/office_fmt_plug.c:static int get_hash_0(int index) { if (cur_salt->version!=2007) return 0; return crypt_key[index][0] & 0xf; }
> JohnTheRipper/src/office_fmt_plug.c:static int get_hash_1(int index) { if (cur_salt->version!=2007) return 0; return crypt_key[index][0] & 0xff; }
> JohnTheRipper/src/office_fmt_plug.c:static int get_hash_2(int index) { if (cur_salt->version!=2007) return 0; return crypt_key[index][0] & 0xfff; }
> JohnTheRipper/src/office_fmt_plug.c:static int get_hash_3(int index) { if (cur_salt->version!=2007) return 0; return crypt_key[index][0] & 0xffff; }
> JohnTheRipper/src/office_fmt_plug.c:static int get_hash_4(int index) { if (cur_salt->version!=2007) return 0; return crypt_key[index][0] & 0xfffff; }
> JohnTheRipper/src/office_fmt_plug.c:static int get_hash_5(int index) { if (cur_salt->version!=2007) return 0; return crypt_key[index][0] & 0xffffff; }
> JohnTheRipper/src/office_fmt_plug.c:static int get_hash_6(int index) { if (cur_salt->version!=2007) return 0; return crypt_key[index][0] & 0x7ffffff; }
>
>
> Formatted get_hash_6():
>
> static int get_hash_6(int index) {
>      if (cur_salt->version!=2007)
>          return 0;
>      return crypt_key[index][0] & 0x7ffffff;
> }

Yes, that's OK. Only 2007 use a proper binary.

magnum


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.