Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120713000552.GA20363@openwall.com>
Date: Fri, 13 Jul 2012 04:05:52 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: keys alignment and wordlist mode (was: asan report)

magnum -

On Sat, Jun 30, 2012 at 12:14:18PM +0200, magnum wrote:
> I think we currently guarantee that the strings passed to set_key() are
> aligned unless ARCH_ALLOWS_UNALIGNED.

No, we don't, at least not intentionally.

> There is extra code for this in wordlist.c when using buffer mode iirc.

The alignment of buffers in wordlist.c comes from core (so it's not
specific/related to the memory buffering) and it is there to support
fast comparison against the previous mangled word in rules_apply():

		if (length >= ARCH_SIZE - 1) {
			if (*(ARCH_WORD *)in != *(ARCH_WORD *)last)
				return in;

but this is actually wrong since I totally forgot about filter()
possibly modifying the word.  So we're comparing pre-filter() words with
post-filter() ones, which is a bug that is non-trivial to fix without
performance impact (hence not fixed for a while now).

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.