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=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16042 invoked from network); 25 Nov 2022 08:53:51 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Nov 2022 08:53:51 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669366431; b=AOeOs+uAscJnGyezfcmn7Vilb0Ce1J0Kv3eYjgGF327IX0e21Kvqj5bmN0AWprF5axK1z1cxHr CKsaz+aPFCsQS6buC4aUkhCV0ohzHx06+CvO8JXuPYfzGXzbS7SQ1B53UwBfeEeVYYsaDwyuNh +/pgjRvLisKUh+KSqd9VMr1CJCilTNt0pm+FGrODj/hke/26V8GLxq+65YZI3Z53T1V2up7n/A 9eaIm+ytulThEmHT65MVfsUxPdUJIXYJZk4oOp7f8q5HTECIRSZ6VgcwT6ea7ydxyV4OGIVOIu 4S+6DjeURJaPmBiYz2mRDJpblANdP/StsYzaefqWGqJemw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1669366431; bh=IcN+fyLNFLPgwvUYjR/h+EKhhy8aqtHszIyijtkWKao=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature; b=ezkc+f4d1Y9zb1UXEXd88bp98aya9P4gL0CxFGFBmunpI5+4k/2VwtzMg01EyLfHavG0Oqa5bh EmWhhJ+tck0HUVWSJIwVmElHLHE7I0Rg0GkWaRk01d34ZYSvZZ1EI+NxAS3bVz0L2XPcYWsaJ3 BVzBG7pxjRymRceXZ9KU2KUQraROyoXCOo6tMelRbgzQk/V/2pi+OMipYgJBBuZyq+l77vYBbJ 0VF0q+yx9UuFa8PaEVyiQWO7ae4B4oV+ncPFhNQkiSOnhIvoQtClhcrLUfYpGM0RJY8wLIRHyD J2c0Saqd8oOg407K7GpGUWbOTcDOvPeX5JvkyQJtFTzIbQ==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=jwEXdFfSTpIpPPhMD6DuGu1PXksDBDtN4tiE/4mnw1Q=; b=E6niHp3KO1bnx1mX2oe62Hgvyl fmSbyPhow91ORRIcXqdU3nB098C/UQnO+5DPfpd2a/sRoWtq/5eBPrjjh/dUlJzsGI/W7eatICtmG wuPWVRE9UUfrZEDOQJeXzaQ09wGHh/83CB/HKp8nCW6huBlVy/KaiLfAoI9UCFfIJ6ZJixb84iuxR SVZKe7O9nuVx8AEWmZ/peahJbbWJjRt+NeR3hzmuLESCIl7rHI8aXri6iWekaW/e0hQJCBfZbl3FZ uNdHYKE9c2QrVRa3KQlIXkjVJffB2+frvsVnbKJSuBFhylLxf+JA2bRRM+pFnY30MeRswTUdcdx3y dZ4DYeMg==; Received: by zero.zsh.org with local id 1oyUT0-000GVa-1C; Fri, 25 Nov 2022 08:53:50 +0000 Authentication-Results: zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53927) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1oyUSP-000GAg-Bt; Fri, 25 Nov 2022 08:53:14 +0000 Received: (Authenticated sender: stephane@chazelas.org) by mail.gandi.net (Postfix) with ESMTPSA id 535CF40006; Fri, 25 Nov 2022 08:53:11 +0000 (UTC) Date: Fri, 25 Nov 2022 08:53:11 +0000 From: Stephane Chazelas To: Clinton Bunch Cc: zsh-workers@zsh.org Subject: Re: [PATCH] zsh/random module [UPDATED] Message-ID: <20221125085311.qbia75bcmqwylt54@chazelas.org> Mail-Followup-To: Clinton Bunch , zsh-workers@zsh.org References: <1b2cafe6-b4b5-c59a-11f3-4dbc1e99e2bc@zentaur.org> <6275a5ac-3a47-f591-7b3c-380ec4fed5ac@zentaur.org> <20221118162325.7i3qzqljyx4a7z3h@chazelas.org> <20221118181253.cdejvepmnsmia7jm@chazelas.org> <20221123195222.GO27622@tarpaulin.shahaf.local2> <20221124161958.jh3xlzq7hiyw6vut@chazelas.org> <7235d036-0a4e-4957-0e09-ae074181008f@zentaur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7235d036-0a4e-4957-0e09-ae074181008f@zentaur.org> X-Seq: 51069 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: 2022-11-24 16:39:07 -0600, Clinton Bunch: [...] > If we move SRANDOM into zsh core, we'll need to define the behavior if > urandom is not found. [...] Since that would be for bash compatibility, we can do the same as they do there. >From what I can tell, if getrandom(), called with GRND_NONBLOCK is not supported or fails (including with EAGAIN), it falls back to arc4random if supported or with the same pseudo-generator as $RANDOM if not (though seeded in each subshell with the time of the day with µs precision and also looping until the value is different from the previous one (!? is that a guarantee also given by getrandom()?)). On GNU/Linux, since bash's "configure" doesn't look for arc4random() in libbsd, you get the same pseudo-generator as $RANDOM as fallback (zsh's configure has the same problem AFAICT; note that libbsd is used by xorg server, iproute2 at least, so is likely to be present and pre-loaded on most GNU/Linux systems). -- Stephane