From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cejG3-0003dF-HB for qemu-devel@nongnu.org; Fri, 17 Feb 2017 09:11:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cejG2-0003Wx-CX for qemu-devel@nongnu.org; Fri, 17 Feb 2017 09:11:35 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36550) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cejG2-0003WE-5c for qemu-devel@nongnu.org; Fri, 17 Feb 2017 09:11:34 -0500 Received: by mail-wm0-x229.google.com with SMTP id c85so16156762wmi.1 for ; Fri, 17 Feb 2017 06:11:34 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20170217140505.GB11399@redhat.com> References: <1487334159-19664-1-git-send-email-peter.maydell@linaro.org> <20170217140505.GB11399@redhat.com> From: Peter Maydell Date: Fri, 17 Feb 2017 14:11:12 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] bcm2835_rng: Use qcrypto_random_bytes() rather than rand() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-arm , QEMU Developers , "patches@linaro.org" , Marcin Chojnacki , =?UTF-8?B?QWxleCBCZW5uw6ll?= On 17 February 2017 at 14:05, Daniel P. Berrange wrote: > On Fri, Feb 17, 2017 at 12:22:39PM +0000, Peter Maydell wrote: >> We should probably improve crypto/random-platform.c to use >> getentropy() if available, which would fix the "BSD or OSX >> host and not using gcrypt or gnutls" case which I think is >> the most likely cause of qcrypto_random_bytes() failing. > > randopm-platform.c currentl uses /dev/urandom or /dev/random, > so that should work when GNUTLS/gcrypt are both disabled at > build time. Ah, and OSX and the BSDs have those devices. (I had mistakenly assumed they were a linuxism.) > What would fail, is uses it from a chroot with an empty /dev > of course. Yes; replacing the rand() in linux-user/main.c would require this I think (unless we're willing to fall back to rand ;-)) thanks -- PMM