From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#23605: /dev/urandom not seeded across reboots Date: Sat, 28 May 2016 15:51:58 +0200 Message-ID: <87inxymgsh.fsf@gnu.org> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160528011201.GA1753@jasmine> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6efr-00014M-Kz for bug-guix@gnu.org; Sat, 28 May 2016 09:53:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6efm-00074X-Mb for bug-guix@gnu.org; Sat, 28 May 2016 09:53:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6efm-00074T-Ji for bug-guix@gnu.org; Sat, 28 May 2016 09:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6efm-0001MZ-BE for bug-guix@gnu.org; Sat, 28 May 2016 09:53:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20160528011201.GA1753@jasmine> (Leo Famulari's message of "Fri, 27 May 2016 21:12:01 -0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Leo Famulari Cc: 23605@debbugs.gnu.org Leo Famulari skribis: > On Tue, May 24, 2016 at 02:24:59PM +0200, Ludovic Court=C3=A8s wrote: >> Leo Famulari skribis: >>=20 >> > I realized that we don't seem to be saving any of the entropy in the >> > kernel's random pool [0] across reboots. >> > >> > This means that for some period after boot, /dev/urandom may not be sa= fe >> > to use. From random(4): >>=20 >> Good catch! >>=20 >> Some comments: >>=20 >> > +(define %urandom-seed-activation >> > + ;; Activation gexp for the urandom seed >> > + #~(begin >> > + (use-modules (guix build utils)) >> > + >> > + (mkdir-p "/var/run") >> > + (close-port (open-file "/var/run/urandom-seed" "a0b")) >>=20 >> Or simply =E2=80=98open-output-file=E2=80=99. > > I don't see a way to use (open-output-file) in "append" mode as with > (open-file). Without that, the file is cleared before it is read in the > following lines. You=E2=80=99re right, sorry for the confusion. Ludo=E2=80=99.