All of lore.kernel.org
 help / color / mirror / Atom feed
From: <rsbecker@nexbridge.com>
To: "'Jeff King'" <peff@peff.net>,
	"'brian m. carlson'" <sandals@crustytoothpaste.net>
Cc: <git@vger.kernel.org>
Subject: RE: [PATCH 1/2] wrapper: add a helper to generate numbers from a CSPRNG
Date: Tue, 16 Nov 2021 11:01:20 -0500	[thread overview]
Message-ID: <009d01d7db03$354ecae0$9fec60a0$@nexbridge.com> (raw)
In-Reply-To: <YZPOzqU0UQDVA57R@coredump.intra.peff.net>

On November 16, 2021 10:31 AM, Jeff King wrote:
> On Tue, Nov 16, 2021 at 03:35:41AM +0000, brian m. carlson wrote:
> 
> > The order of options is also important here.  On systems with
> > arc4random, which is most of the BSDs, we use that, since, except on
> > MirBSD, it uses ChaCha20, which is extremely fast, and sits entirely
> > in userspace, avoiding a system call.  We then prefer getrandom over
> > getentropy, because the former has been available longer on Linux, and
> > finally, if none of those are available, we use /dev/urandom, because
> > most Unix-like operating systems provide that API.  We prefer options
> > that don't involve device files when possible because those work in
> > some restricted environments where device files may not be available.
> 
> I wonder if we'll need a low-quality fallback for older systems which don't
> even have /dev/urandom. Because it's going to be used in such a core part of
> the system (tempfiles), this basically becomes a hard requirement for using
> Git at all.
> 
> I can't say I'm excited in general to be introducing a dependency like this, just
> because of the portability headaches. But it may be the least bad thing
> (especially if we can fall back to the existing behavior).
> One alternative would be to build on top of the system mkstemp(), which
> makes it libc's problem. I'm not sure if we'd run into problems there, though.

None of /dev/urandom, /dev/random, or mkstemp are available on some platforms, including NonStop. This is not a good dependency to add. One variant PRNGD is used in ia64 OpenSSL, while the CPU random generator in hardware is used on x86. I cannot get behind this at all. Libc is also not used in or available to our port. I am very worried about this direction.

-Randall


  reply	other threads:[~2021-11-16 16:01 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16  3:35 [PATCH 0/2] Generate temporary files using a CSPRNG brian m. carlson
2021-11-16  3:35 ` [PATCH 1/2] wrapper: add a helper to generate numbers from " brian m. carlson
2021-11-16 15:31   ` Jeff King
2021-11-16 16:01     ` rsbecker [this message]
2021-11-16 18:22       ` Taylor Blau
2021-11-16 19:58         ` rsbecker
2021-11-16 22:41       ` brian m. carlson
2021-11-16 23:20         ` rsbecker
2021-11-17  0:47           ` Carlo Arenas
2021-11-17  3:05             ` rsbecker
2021-11-17  1:03           ` brian m. carlson
2021-11-17  1:50             ` Carlo Arenas
2021-11-17  3:04               ` Jeff King
2021-11-17  3:12                 ` rsbecker
2021-11-17  3:36                 ` Carlo Arenas
2021-11-17 20:01                   ` Jeff King
2021-11-17 20:19                     ` rsbecker
2021-11-17 23:30                       ` brian m. carlson
2021-11-17 23:34                         ` rsbecker
2021-11-17  3:03             ` rsbecker
2021-11-17  7:39   ` Junio C Hamano
2021-11-17 23:01     ` brian m. carlson
2021-11-18  7:19       ` Junio C Hamano
2021-11-18 22:16         ` brian m. carlson
2021-11-22  9:10           ` Junio C Hamano
2021-11-16  3:35 ` [PATCH 2/2] wrapper: use a CSPRNG to generate random file names brian m. carlson
2021-11-16 15:36   ` Jeff King
2021-11-16 18:28     ` Taylor Blau
2021-11-16 18:57       ` Junio C Hamano
2021-11-16 19:21         ` Jeff King
2021-11-16 19:33           ` Taylor Blau
2021-11-16 15:44 ` [PATCH 0/2] Generate temporary files using a CSPRNG Jeff King
2021-11-16 22:17   ` brian m. carlson
2021-11-16 22:29     ` rsbecker
2021-11-16 20:35 ` Ævar Arnfjörð Bjarmason
2021-11-16 21:06   ` Jeff King
2021-11-17  8:36     ` Ævar Arnfjörð Bjarmason

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='009d01d7db03$354ecae0$9fec60a0$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.