Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 3 Jul 2011 01:56:01 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: Re: zip cracker patch [first cut for GSoC]

Dhiru -

On Thu, Jun 16, 2011 at 04:35:38PM -0700, Dhiru Kholia wrote:
> I couldn't get http://www.gladman.me.uk/cryptography_technology/fileencrypt/
> to work on a 64-bit machine.
> *** So this patch currently works only on 32-bit machines. ***
> 
> Steps to reproduce the bug on a 64-bit machine:
> 
> $ gcc -DTEST gladman_*.c; ./a.out # results in "key is bad" messages.

Oh, I am only reading this after having run into and fixed the bug in my
testing of what will be 1.7.8-jumbo-2. ;-)

gladman_hmac.h declared key in struct hmac_ctx as array of unsigned
char, but gladman_hmac.c would cast it to (unsigned long *) for 32-bit
accesses.  Obviously, this only worked when "unsigned long" was 32-bit
and only on machines without strict alignment requirements, or when
key[] just happened to be 32-bit aligned.  Fixed by declaring it as
array of ARCH_WORD_32 instead, and making the corresponding adjustments
in gladman_hmac.c.

Before doing the above, I got rid of gladman_sha1.c and made
gladman_sha1.h a wrapper around OpenSSL's SHA-1 implementation.
So maybe there were issues with the SHA-1 code as well - I wouldn't know.
BTW, switching to OpenSSL's resulted in a 50% speedup on a 32-bit system
where I tested the code first.

There were other issues in the code as well, such as two memory leaks in
zip_fmt.c's set_salt(), which I patched (in a quick and dirty way).

Despite of all of the above, I appreciate you sharing this early
revision of the code.  This was just appropriate for you to do (whereas
holding the code because of it being unfinished would be wrong).

Thank you!

Alexander

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.