Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 17 Jan 2013 18:01:20 +0100
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Unused functions in mozilla_des.c (was: NSS not needed)

On 01/17/2013 03:48 PM, Dhiru Kholia wrote:
> On Thu, Jan 17, 2013 at 7:52 PM, Frank Dittrich
> <frank_dittrich@...mail.com> wrote:
>> On 01/17/2013 01:22 PM, magnum wrote:
>>> On 16 Jan, 2013, at 4:14 , Dhiru Kholia <dhiru.kholia@...il.com> wrote:
>>>> Yes,  the format can be built without NSS.
>>>>
>>>> I suspected this earlier and now you have confirmed it.

May be I should have questioned this statement earlier.
I just assumed *you* had a look and found out that you can build mozilla
without NSS.

>>>> I will take a look at it soon. Thanks Frank.
>>>
>>> This would be nice for Jumbo-8, please commit to unstable if you fix it. Remove all references to HAVE_NSS in Makefile too.
> 
> I took a quick look but it doesn't seem to be that trivial (to me).
> 
> I am planning to re-write mozilla format at some point (like pdf
> format got re-written).
> 
>> Before we finally get rid of HAVE_NSS, we would need to make sure the
>> format works for different architectures (e.g., we don't have endianness
>> or other issues).
> 
> I removed the unused functions (and cleaned up includes, removed
> HAVE_NSS from format) but then unstable-jumbo doesn't build if
> HAVE_NSS is not defined.
> 
> Doing the same worked for Frank because maybe the NSS header files
> were in standard enough location on his system.
> 
> Frank,
> 
> Do you have a working patch I can test?

Obviously, there was some misunderstanding here.

What I meant with

| Removing DES_Encrypt() from mozilla_des.c and mozilla_des.h still
| allows building john, with or without -DHAVE_NSS.
|
| DES_Decrypt, DES_DestroyContext and possibly other functions seem
| to be unused as well.

was not that I got --format=mozilla working without HAVE_NSS.

Instead I meant that I removed DES_Encrypt(), then I built john (with
HAVE_NSS) and made sure
$ ./john --test --format=mozilla
still works.
Afterwards, I just disabled HAVE_NSS and built a new john version, to
make sure it still works (but this time without mozilla format.


So, I suggest to follow magnum's suggestion and just remove unused
functions. (We might need DES_DestroyContext in future versions, though.
Just in case we have proper cleanup functions in the format definition.)

The attached has #if 0 ... #endif around unused functions in
mozilla_des.c, and unused functions in mozilla_des.h commented out using
//, even for DES_DestroyContext, which we might need in future.

BTW:
Should the mozilla_des.[ch] and lowpbe.[ch] comments include a pointer
to the web address where source came from before it has been integrated
into john?

Frank

View attachment "mozilla.diff" of type "text/x-patch" (3249 bytes)

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.