From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3031 invoked from network); 24 Nov 2022 13:20:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Nov 2022 13:20:02 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669296002; b=HZ42QnGdDh1z5L/70ZSppHU2dK62IkjbFPhUKnxOeolk4k3CFOnJJ873Mk83FQ3xGQwQx3Dqbu 5ONsD6xZySWhV2Rny9nkfNKo8IQCZzYGnrcI6IIcBs4at1kYs8fDoLdtiBLAQ1y4yj8FAP5JYm pcgJB2qvIhJzVCorYmwgzlq5NUaXnLRwJhJWc4eRK0KGlYzhodlUK9G/Ok7SXPlst8aGPRnAL3 H7WBnEFe4YAMTdrGSzU6XCkGUmKPnYiIN8I2KwXkfgEjE2STjfEiAOhw6MkVj9irPcKt3A81Hc uJV0+AwecRR5j9BkLDjKi81fUUqlQiFMGVvqKDB1VpQYaA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1669296002; bh=ph61vEd9pUbcMfTKzV6IgCQF0ytW7YH7kkrH2YLJvaQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=HmKk0Rf83x9hWcmxcamFXFm150fnxZic6g2UBxAsgTYF+KeVJonPSEA5No0vE1ur3L+j3MMG/r keE9fxXiENfGcJBSdp/g4Vf91ZVXiYFVvXgXwjQe6Ra/xwAf0hcFL481+pKfcgAyv0IDaHv9eJ ThJZZLXRh0bOVzYpXJS4kevhk7/nO5nmmmB4xQ2wB5EYU+6Rht5eFO+MP0yaxMGbY7wGr6KPGo NwJTjwnxF49z7yHwM6Ca9daRM4fKo0ikZjnI4FsSkeZCTXz8peg4U3aOSo8el6YHQNY2oG0qd9 HFmCqw105ZYM1/zlRK3T/X8LnK7sBg7+S/+L5D4tvl4lcw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ph61vEd9pUbcMfTKzV6IgCQF0ytW7YH7kkrH2YLJvaQ=; b=WtQoY/F0TaUgS7Z7wosRwMURw8 LXGWxen+njSr4wR+bxemRJxnwoxFJNTaUsVysoKXJfqbW8vJ0CAy1qgiqloU63FIqPGb5Yn5KELnb rKZN9Kr8aqdJI0T5Vejs9PefUswFUoywxOjZiq7+epqfABeet5NxClRPgxI6PfapKz24TScVIq3to GWVoc6XPHNfIHoINWwwZZVZXfJl+BSAk6B3AaX8rX6rJR9E7Eh/q4w6M4N/U8HNCPqyjTX1IpdVGI xtJUNfgQ9PEdJPczr7xarcWR/Kvw+DmKKCxZTOq3fSEvn6O3MLL0vYK/Ijhag266hNxkHrtvjHWIz EgZpjamA==; Received: by zero.zsh.org with local id 1oyC93-0009Vd-4s; Thu, 24 Nov 2022 13:20:01 +0000 Authentication-Results: zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none Received: from iris.zentaur.org ([198.58.127.206]:51454) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1oyC8P-0009AO-Fk; Thu, 24 Nov 2022 13:19:22 +0000 Received: from iris.zentaur.org (localhost [127.0.0.1]) by iris.zentaur.org (Postfix) with ESMTP id 4NHz9M5tggz3wZj for ; Thu, 24 Nov 2022 13:19:19 +0000 (UTC) Authentication-Results: iris.zentaur.org (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=zentaur.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zentaur.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:references:to:content-language:subject:subject :user-agent:mime-version:date:date:message-id; s=dkim20200120; t=1669295959; x=1669299560; bh=ph61vEd9pUbcMfTKzV6IgCQF0ytW7YH7 kkrH2YLJvaQ=; b=SxC+AuxEq+PE6K14v9x36XFP9rwCjh91zRxec9FnYEHg5gzl SWOf3y8NZ3A2xJwUMxziuuc6c3urfKh7sH7p/iryO2/HeUh0ylIRUR1pKpCLJD5X yL1B7wT7cDtKlGa3H3PVBIBlXWpf6HW4n+uROzDUoXMA5LJIAnYVgGYi+hjmrsy/ PBTuIMU6XckSexigOBKj/PeJfUzMUsQTg4LOfAmHQoMks7BDzCRHTWt57O7x3hIv a4cPrRrR+ljuvan75Fii5jWcwIJJoLhrN0RvWycLiznGCqIF82YAJMbTPsFmLUlZ XalM2clPpp6FRGT/4/IdqzRFiXIi4nO82ZGW/g== X-Virus-Scanned: amavisd-new at iris.zentaur.org Received: from iris.zentaur.org ([127.0.0.1]) by iris.zentaur.org (iris.zentaur.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BDYLczMi2mlF for ; Thu, 24 Nov 2022 13:19:19 +0000 (UTC) Received: from [192.168.78.67] (173-207-53-93.cpe.cableone.net [173.207.53.93]) by iris.zentaur.org (Postfix) with ESMTPSA id 4NHz9M08Lmz3wZb for ; Thu, 24 Nov 2022 13:19:18 +0000 (UTC) Message-ID: <2ad1bb62-7de1-9685-54fc-56f3e3b7946f@zentaur.org> Date: Thu, 24 Nov 2022 07:19:10 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] zsh/random module [UPDATED] Content-Language: en-US To: zsh-workers@zsh.org References: <741b77be-b679-76cc-f8ec-49c9d89323c1@zentaur.org> <1e8ea669-7a25-b321-6024-72dbc43ac023@zentaur.org> <41205a86-8aad-4821-baa4-1d2ac9bf3c5d@app.fastmail.com> <1b2cafe6-b4b5-c59a-11f3-4dbc1e99e2bc@zentaur.org> <6275a5ac-3a47-f591-7b3c-380ec4fed5ac@zentaur.org> <20221123194658.GM27622@tarpaulin.shahaf.local2> <4e500f9c-48ef-e1eb-ed7c-5895bd5473ab@zentaur.org> <126127ef-2c52-ec4e-7bfe-6000ebe29bf9@bureaucracy.de> From: Clinton Bunch In-Reply-To: <126127ef-2c52-ec4e-7bfe-6000ebe29bf9@bureaucracy.de> Content-Type: text/plain; charset=UTF-8; format=flowed X-Antivirus: Avast (VPS 221124-2, 11/24/2022), Outbound message X-Antivirus-Status: Clean Content-Transfer-Encoding: quoted-printable X-Seq: 51061 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 11/24/2022 4:07 AM, nimaje+zml@bureaucracy.de wrote: > > > On 11/24/22 03:58, Clinton Bunch wrote: >> [snip] >>>> +/**/ >>>> +int >>>> +setup_(UNUSED(Module m)) >>>> +{ >>>> +#ifdef USE_URANDOM >>>> +=C2=A0=C2=A0=C2=A0 /* Check for the existence of /dev/urandom */ >>>> + >>>> +=C2=A0=C2=A0=C2=A0 struct stat st; >>>> + >>>> +=C2=A0=C2=A0=C2=A0 if (lstat("/dev/urandom",&st) < 0) { >>> Why not stat()? >> Is it appropriate for /dev/urandom to be a symlink? > > Yes, for example that is the case on freebsd where urandom is just a=20 > symlink to random for compatibility with programs that expect urandom=20 > to be there (random blocks until the randomness pool is seeded and=20 > then doesn't block anymore). On FreeBSD it doesn't use urandom, so it didn't show up in my testing.=C2= =A0=20 It only uses urandom if arc4random() or getrandom() doesn't exist > >>> >>>> +=C2=A0=C2=A0=C2=A0 zwarn("No kernel random pool found."); >>>> +=C2=A0=C2=A0=C2=A0 return 1; >>>> +=C2=A0=C2=A0=C2=A0 } >>>> + >>>> +=C2=A0=C2=A0=C2=A0 if (!(S_ISCHR(st.st_mode)) ) { >>>> +=C2=A0=C2=A0=C2=A0 zwarn("No kernel random pool found."); >>>> +=C2=A0=C2=A0=C2=A0 return 1; >>>> +=C2=A0=C2=A0=C2=A0 } > > So this check would be wrong on freebsd (or use random directly and=20 > give an option to use urandom on systems where random starts to block=20 > for some reason after being seeded, but no idea if there is a good=20 > reason for random being a symlink). On most systems random is defined to block if the randomness pool falls=20 below a certain threshold until more random data is available > >> [snip] >