mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Solar Designer <solar@openwall.com>
To: musl@lists.openwall.com
Subject: Re: Todo for release?
Date: Tue, 14 Aug 2012 02:20:58 +0400	[thread overview]
Message-ID: <20120813222058.GB8817@openwall.com> (raw)
In-Reply-To: <20120813213154.GI20243@port70.net>

On Mon, Aug 13, 2012 at 11:31:54PM +0200, Szabolcs Nagy wrote:
> the sha2 based crypt seems to be designed recently
> and the spec has a public domain implementation
> http://www.akkadia.org/drepper/SHA-crypt.txt

Unfortunately, the reference implementation uses alloca() on both salt
and key strings.  glibc has recently fixed that by using malloc() and
returning NULL on its failure, but that's not great.

Also, if potentially unreasonably long running time is a concern, it
should be noted that for md5crypt and sha*crypt it is roughly
proportional to password length (modulo block size of the underlying
primitive).  So e.g. a 1 million char password (which may realistically
be passed to libc's crypt() e.g. via a scripting language) may take
thousands of times longer to be hashed than the sysadmin had intended by
tuning the iteration count.

I'm not sure whether and how a libc should deal with that.  In a sense,
it is similar to the issue of high iteration counts, but it's worse in
that the input that may trigger the issue very often comes from a remote
system.

For the extended DES-based crypt() hashes that we now support, this
issue mostly does not arise since the password (even if very long, which
is supported) is passed through just one instance of DES block-by-block,
which is quick.  The multiple iterations loop is then applied to the
"compressed" version of the password.

For bcrypt hashes, the issue does not arise because they truncate
passwords at 72 characters (not great, but that's how they're defined,
and it's good enough for practical purposes so far).

Alexander


  parent reply	other threads:[~2012-08-13 22:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 18:53 Rich Felker
2012-08-13 21:31 ` Szabolcs Nagy
2012-08-13 21:53   ` Rich Felker
2012-08-13 22:06     ` Solar Designer
2012-08-14 15:02       ` Szabolcs Nagy
2012-08-15  0:30         ` Szabolcs Nagy
2012-08-13 22:20   ` Solar Designer [this message]
2012-08-14  1:46     ` Rich Felker
2012-08-14  2:13       ` Solar Designer
2012-08-14  2:35         ` Rich Felker
2012-08-14  2:49           ` Solar Designer
2012-08-14  2:58             ` Rich Felker
2012-08-14  3:35               ` Solar Designer
2012-08-14  4:49                 ` Rich Felker
2012-08-15  4:08 ` Rich Felker
2012-08-15  8:55   ` Daniel Cegiełka
2012-08-15 10:20     ` Szabolcs Nagy
2012-08-15 10:53       ` Daniel Cegiełka
2012-08-15 13:10         ` John Spencer
2012-08-15 13:23           ` Daniel Cegiełka
2012-08-15 13:32       ` Szabolcs Nagy
2012-08-15 14:36         ` Rich Felker
2012-08-17  9:49           ` Szabolcs Nagy
2012-08-17 12:10             ` Rich Felker
2012-08-22 17:45               ` Daniel Cegiełka
2012-08-22 18:57                 ` Rich Felker
2012-08-22 19:15                   ` Daniel Cegiełka
2012-08-22 20:24                   ` Richard Pennington
2012-08-22 22:44                     ` Rich Felker
2012-08-15 12:36     ` Rich Felker
2012-08-15 12:57   ` Luca Barbato
2012-08-15 14:34     ` Rich Felker
2012-08-15 18:28       ` Luca Barbato
2012-08-15 18:35         ` Rich Felker
2012-08-15 21:25         ` Rich Felker
2012-08-16 17:11           ` Luca Barbato
2012-08-15 13:27   ` Richard Pennington
2012-08-15 22:44 ` boris brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120813222058.GB8817@openwall.com \
    --to=solar@openwall.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).