Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 02 Jan 2014 12:28:47 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: ./john --test=0 --format=crypt --subformat=sun-md5
 FAILED

On 2014-01-02 10:05, Frank Dittrich wrote:
> On 01/02/2014 04:08 AM, magnum wrote:
>> I can't reproduce but made some changes (implementation of crypt()
>> varies). Unless c42e5e9 fixes it, please make a debug -O0 build and
>> print a backtrace.
>
> With linux-x86-64 and linux-x86-64-clang, I still get "FAILED (prepare)"
> again.
> What could I do to help debug it?

formats.c:249
	if (!current->fields[1])
		current->fields[1] = current->ciphertext;
	ciphertext = format->methods.prepare(current->fields, format);
	if (!ciphertext || strlen(ciphertext) < 7)
		return "prepare";

I suppose we get a result shorter than 7. Replace that last line with eg:
		printf("prepare: '%s'\n", ciphertext);

> With linux-x86-native, the segfault is gone.
>
> $ ./john --test=0 --format=crypt --subformat=sun-md5
> sun-md5 not supported on this system
>
>
> It might be somewhat confusing for users, that the output for
> --subformat=sun-md5 is the same as for --subformat=invalid, since
> sun-md5 is suggested as valid by bash completion.
>
> Would it be possible to drop the " on this system" part if the subformat
> is invalid?

There's simply no way to tell an invalid salt from one that is simply 
not supported by *our* crypt(). We could rephrase things though.

> Also, I wouldn't treat invalid subformat names of length 1 different
> than others.
> So, either add that line for every invalid subformat (but not for
> subformats which are just not supported on the current system), or print
> that line only for --subformat='?' (legacy support) and for
> --subformat=help.

I'll do it for '?' only then.

The purpose of my weird handling of subformat is that it will work with 
future/non-hardcoded formats. Eg. on AIX supplying a salt like this:

./john -t -form:crypt -subformat:'{ssha512}01$................$'

...so we'll be able to use crypt for future formats without recompliling.

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.