Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140623231735.GA4835@openwall.com>
Date: Tue, 24 Jun 2014 03:17:35 +0400
From: Solar Designer <solar@...nwall.com>
To: musl@...ts.openwall.com
Subject: Re: Recommended way to probe for bcrypt support?

On Mon, Jun 23, 2014 at 06:33:39PM -0400, Rich Felker wrote:
> On Mon, Jun 23, 2014 at 02:53:58PM -0700, Isaac Dunham wrote:
> > I'm wondering if there's a recommended way to probe for bcrypt support;
> > it would be nice to add this to toybox so mkpasswd could use blowfish on
> > musl or OWL systems.
> 
> The best way to do this is with runtime detection: simply attempt to
> use crypt or crypt_r with a setting string that requests bcrypt and
> see if it works.

Sure.  This works for ./configure when we're fine with static
compile-time detection.  Unfortunately, at runtime detecting bcrypt in
this way is a bit slow since the minimum cost setting is 4 (meaning 16
iterations of the eksBlowfish loop).  For mkpasswd it is acceptable -
so do it - but e.g. in phpass I am reluctant to do it that way.

There's a way to detect crypt_blowfish-style error returns quicker, and
infer whether bcrypt support is likely present or not from that, but
there are systems that support bcrypt yet don't use these error returns,
so it won't detect bcrypt support present on those systems (including
OpenBSD, and that's unacceptable because bcrypt originates from there).

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.