From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d35e9-0006RQ-HJ for qemu-devel@nongnu.org; Tue, 25 Apr 2017 14:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d35e6-0007Ke-W3 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 14:57:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53472) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d35e6-0007KB-Q9 for qemu-devel@nongnu.org; Tue, 25 Apr 2017 14:57:06 -0400 Date: Tue, 25 Apr 2017 19:57:00 +0100 From: "Daniel P. Berrange" Message-ID: <20170425185700.GA8899@redhat.com> Reply-To: "Daniel P. Berrange" References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v3] crypto: qcrypto_random_bytes() now works on windows w/o any other crypto lib List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Geert Martin Ijewski Cc: QEMU Developers , Peter Maydell , eblake@redhat.com On Tue, Apr 25, 2017 at 07:28:07PM +0200, Geert Martin Ijewski wrote: > If no crypto library is included in the build, QEMU uses > qcrypto_random_bytes() to generate random data. That function tried to open > /dev/urandom or /dev/random and if openeing neither file worked it errored > out. > > Those files obviously do not exist on windows, so there the code uses > CryptGenRandom(). > > Furthermore there was some refactoring and a new function > qcrypto_random_init() was introduced. If a proper crypto library (gnutls or > libgcrypt) is included in the build, this function does nothing. If neither > is included it initalizes the (platform specific) handles that are used by > qcrypto_random_bytes(). > Either: > * a handle to /dev/urandom | /dev/random on unix like systems > * a handle to a cryptographic service provider on windows > > Signed-off-by: Geert Martin Ijewski Reviewed-by: Daniel P. Berrange I'll add this to my queue unless someone raises further comments. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|