bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] hurd: Make getrandom cache the server port


From: Samuel Thibault
Subject: Re: [PATCH v2] hurd: Make getrandom cache the server port
Date: Fri, 2 Dec 2022 10:17:10 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Hello,

Sergey Bugaev, le ven. 02 déc. 2022 12:13:51 +0300, a ecrit:
> Caveat: this new implementation does not respect the GRND_RANDOM flag
> and always uses /dev/urandom to read random data.

It should be easy to fix that?

> +static file_t random_server, random_server_nonblock;

By adding a second series of file_t

> -  if (flags & GRND_RANDOM)
> -    random_source = "/dev/random";
> +  cached_server = (flags & GRND_NONBLOCK) ? &random_server_nonblock
> +                                          : &random_server;

and multiplexing here.

Thanks for your work on this,
Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]