From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AOt8C4/DqWKWmQAAbAwnHQ (envelope-from ) for ; Wed, 15 Jun 2022 13:33:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qNBnC4/DqWJYDAEA9RJhRA (envelope-from ) for ; Wed, 15 Jun 2022 13:33:35 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CB7DF47693 for ; Wed, 15 Jun 2022 13:33:34 +0200 (CEST) Received: from localhost ([::1]:59704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1RHB-0004BX-SN for larch@yhetil.org; Wed, 15 Jun 2022 07:33:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1A9p-0002ei-Rt for guix-devel@gnu.org; Tue, 14 Jun 2022 13:16:50 -0400 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]:33748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1A9o-0006q9-3A for guix-devel@gnu.org; Tue, 14 Jun 2022 13:16:49 -0400 Received: by mail-qt1-x82a.google.com with SMTP id i25so6606213qtq.0 for ; Tue, 14 Jun 2022 10:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=2tqzy3yAoc2a2NX7seLqy6sMtu18fvbf9x6UGpRFBkY=; b=B3ss2gSUfNaHQUHTN1tFsyX4ZtgMv01SGxb4yR/8qioZkJdTzi6y9obEmuoHpL7YfX v5od4abV0y7e8EVcJQt7rMNlejun8YJ/s7Ro+Ve3jJ+/tEzUlhHn7Dyv4Lr3EoesFoPW 4gaAMXcJxdy0rfbFVpZeRQVcvclHFY5QBtw+vkDse+FnlREv/DzU3Nj8dme0wocowWM/ pQNPO7STGHSmWFEricXTX3+gunZrbKnRXGYSPfKA6MBI1aR85duefcPxs7oXVYI0zeox 0YN1+y6enDEueHSy8eiyEz0nZc0/NuYzRvR6QaoOA4yO2J0iyEwTj6o7uYJkTgNcCxyR IMvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=2tqzy3yAoc2a2NX7seLqy6sMtu18fvbf9x6UGpRFBkY=; b=jRYx64H3DWLlGFZTEiJ1UgxnDvujbBcoKsCNcMhnBCTJNEUiKylGpdBIizFGkf0mcl W9wWDA4C0cuOPPah7JtXLcuwm/u8kbZwPrLWuqV2cdQggPPnSVUKYhg7tGaVb6hb1Su6 iEpnIXjhdf7covrlmyOXWduCBzRfszzH5XxTtJJVG0xA7fiGD7/fzgu6ynV/9BPgzDMJ KIAPFnqMABQNXH+HFObtVOytPtOjtSX8aXb5a3Isfmsump9Apn6EbDZqsAy57/KKRLuC y2M+M8lLO20wo1muMgBdDqdyhgZ5pkvNkf8YBkl+eowD3lTf0WbeAUrXxui2X0MkKozQ RgAg== X-Gm-Message-State: AOAM531da4e9zeaneYJEnWrwizIDixYlqlSPDvXmwNcxg8cundczotGQ SCHSXW+g/d2D8GRhIDdvXerQz+rXsDULrA== X-Google-Smtp-Source: ABdhPJyxyUDdGuTW0CApwBEdNYfI5ka9agiefzhmlN30SkyHpXQITHdYJ5s7Zh8nhnuIGchui2lAhg== X-Received: by 2002:ac8:57c9:0:b0:304:fd1b:df4e with SMTP id w9-20020ac857c9000000b00304fd1bdf4emr5081831qta.512.1655227006628; Tue, 14 Jun 2022 10:16:46 -0700 (PDT) Received: from [192.168.45.36] (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with ESMTPSA id h9-20020a05620a244900b006a75e8d920bsm10738119qkn.88.2022.06.14.10.16.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 10:16:45 -0700 (PDT) Message-ID: <5ee4b604-9921-7e50-b1c8-e0c7a63ffcda@gmail.com> Date: Tue, 14 Jun 2022 13:16:44 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: maradns reproducibility fixes and the merits of picking a random number Content-Language: en-US To: Vagrant Cascadian , Arun Isaac , Guix Devel References: <87pmjlfdjl.fsf@contorta> <87sfofkl8o.fsf@systemreboot.net> <87czfigaxb.fsf@contorta> From: Philip McGrath In-Reply-To: <87czfigaxb.fsf@contorta> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=philip.mcgrath@gmail.com; helo=mail-qt1-x82a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 15 Jun 2022 07:32:01 -0400 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655292814; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2tqzy3yAoc2a2NX7seLqy6sMtu18fvbf9x6UGpRFBkY=; b=FE8nT6QH/03qPq2Y/P+Z9nHLstaKT3Q7SfQ55cTGi8wIIWZLsmfAbNYwITpkSP976NzIOv L6CT1KrR62SEjpJ6+TROWJGseGy/w2hbFzrMfEcAT71uIhcF8oWuddp34VQjlJmH2OKa3E 1c9r51MUySq6QX5k/ZSN8S+BLCIZhlrtD6erBNmRl7NuDBZ6HoSatyQfb283XkSaATn+LC +fbL4h9HaKd3C3IF+lZyVuOb7tmeNgvl5O6sreV2R9pGhWFrIYNpr7EYJWjltBVIfgw3M9 c5cW/aLIkx4A8cZuwwtNC/3FCQUAJh5dmOUyOhQKKQ7FTKUTpd9hwLDo3AG/8A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655292814; a=rsa-sha256; cv=none; b=YwWL3+DMI9+fJuzdJVuS8HU4ATauou6aDMGvy061W1IJCF97dokoLs1rVcMwG7FKKWsLmw uImdKpwm85h7DNdUmpu09xJVfeRkMOjFqHTYCsTyB5ap5yXj9hD2cOL7xhaJWBQOA/iOFM cowR9PRGKxjRJqugTmDVBVngjll2gwHeDg0l4njon6Ns+WgPfD0INxxCvKUf9XCfDuY5vP DISpWCtUAOGVYlu7Ejl85xcNoJTS0GnaRpOR5/Joh44qWL8QFLKQB3cbLB9qzRLWPnSp14 c37rf3O4PqWebBsf+HAlrsTiQIKcMO5zHjPUDY9jDmucuMqKTEhhDkROXhJbZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=B3ss2gSU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=B3ss2gSU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CB7DF47693 X-Spam-Score: -9.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: rfBhHvnJUqPj Hi, On 6/8/22 16:25, Vagrant Cascadian wrote: > On 2022-06-09, Arun Isaac wrote: >> Hi Vagrant, >> >>> But there's one nervous-making issue this revealed; maradns embeds a >>> random number at build time ... allegedly for systems that don't have >>> /dev/urandom... see >>> maradns-3.5.0020/deadwood-3.5.0020/src/Makefile.ubuntu2004: >>> >>> # Since some systems may not have /dev/urandom (Windows, *cough* *cough*), we >>> # keep a randomly generated prime around >>> >>> So it's got some code to generate a random number at build time and >>> embed it in the binary. Now, if there's anything I know about good >>> practices about random numbers, this sort of thing is generally a very >>> large red flag! It also makes the package build differently every >>> time! >> >> Wow, great find! Has this issue been reported to maradns upstream? If >> upstream fixes it or provides us a compile flag to disable this >> "feature", it would be even better in the long run. > > That does sound like the best long-term approach, definitely! > > Will take the issue upstream... > Not sure if this is useful—I've never used MaraDNS, and I know just barely enough about Windows to try to keep free software portable—but, on Windows XP and later, you can get cryptographic-quality randomness by dynamically loading SystemFunction036 from Advapi32.dll, sometimes known as RtlGenRandom. Racket uses this to implement crypto-random-bytes, which uses /dev/urandom on Unix-like systems. It's also apparently used by Chromium, Firefox, and many others. Racket example: https://github.com/racket/racket/blob/master/racket/collects/racket/private/windows-rand.rkt C example from Microsoft: http://web.archive.org/web/20180929235240/https://blogs.msdn.microsoft.com/michael_howard/2005/01/14/cryptographically-secure-random-number-on-windows-without-using-cryptoapi/ Documentation, such as it is: https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom Mozilla thread explaining why the warnings in that documentation are irrelevant: https://bugzilla.mozilla.org/show_bug.cgi?id=504270#c4 -Philip