qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5] crypto: qcrypto_random_bytes() now works on


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH v5] crypto: qcrypto_random_bytes() now works on windows w/o any other crypto libs
Date: Wed, 26 Apr 2017 14:09:25 +0100
User-agent: Mutt/1.7.1 (2016-10-04)

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 <address@hidden>
> ---
>  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 <address@hidden>

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 :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]