Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120502145741.GA18084@openwall.com>
Date: Wed, 2 May 2012 18:57:41 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: Re: wpapsk.h warnings

Lukas -

On Wed, May 02, 2012 at 04:14:10PM +0200, Lukas Odzioba wrote:
> Code may look weird but it was intentional. I didn't want to
> parse/copy each parameter separately. I added in hccap2john and in
> _fmt files asserts(sizeof(hccap)==HCCAP_SIZE);
> I am not absolutely sure but this in my opinion catch out of struct
> error if it may occur.

OK.

> If necessary I could rewrite this method in "proper" way.

I think it is desirable to use the union approach that I described,
because otherwise we're getting a compiler warning about the
out-of-bounds access, and some other compiler might in fact make this
code refuse to compile or run for that reason.

The size check that you describe is enough to catch potential padding
issues - at least we'll know what went wrong.  So let's not deal with
that issue in any other way yet.

Thanks,

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.