Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20261120144146.GI5716@brightrain.aerifal.cx>
Date: Fri, 20 Nov 2026 09:41:46 -0500
From: Rich Felker <dalias@...c.org>
To: Solar Designer <solar@...nwall.com>
Cc: Lukas Tribus <lukas@...i.eu>, musl@...ts.openwall.com
Subject: Re: crypt: unsupported hash behavior

On Fri, Nov 20, 2026 at 01:38:25PM +0100, Solar Designer wrote:
> On Fri, Nov 20, 2026 at 07:23:14AM -0500, Rich Felker wrote:
> > On Fri, Nov 20, 2026 at 10:53:00AM +0100, Solar Designer wrote:
> > > Not addressing the issue of leaving the hash in memory yet, but I assume
> > > that's intentional not to address in this same patch?
> > 
> > Yeah I wasn't sure what to best do with that. I thought of having the
> > loop that computes the sum also xor the setting string onto the
> > output, which would be a great way to keep a dependency and avoid
> > short-circuiting the loop, but that leaks setting (good hash) on
> > failure which is even worse. I guess I could just make the loop
> > overwrite output as it runs -- that might be worthwhile.
> 
> I had thought of this too, but the problem is we don't know we need to
> overwrite output until the loop ends.  Also the early exit on
> strlen(_setting) != 13 must not skip the zeroization.

Oh, yes. In that case, I think we should probably just leave this
aspect alone for now. Leaving the hash *of the caller submitted
password* in the caller's buffer is not really a big deal anyway.

As a separate change later, I do have an idea for this: when the crypt
core produces a failure, we could have the subsequent self-test write
to the caller's output buffer instead of a test_buf. This could be
applied to all of the crypt backends, though I'm not sure if any have
other data worth clobbering.

Right now though I'd just like to finish getting a version of the
non-canonical DES salts change that can be included in the bugfix
release and that distros paranoid about related issues can go ahead
and feel good about applying.

Rich

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.