On Wed, Apr 26, 2017 at 12:15:01AM +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 opening both files failed 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 initializes 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 <gm.ijew...@web.de> > --- > crypto/init.c | 6 ++++++ > crypto/random-gcrypt.c | 2 ++ > crypto/random-gnutls.c | 3 +++ > crypto/random-platform.c | 45 +++++++++++++++++++++++++++++++++++++-------- > include/crypto/random.h | 9 +++++++++ > 5 files changed, 57 insertions(+), 8 deletions(-)
Reviewed-by: Daniel P. Berrange <berra...@redhat.com> I'll add this to my queue now. 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 :|