From: "Daniel P. Berrange" <berrange@redhat.com>
To: Geert Martin Ijewski <gm.ijewski@web.de>
Cc: qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <20170426130925.GW18933@redhat.com> (raw)
In-Reply-To: <1493158501-22284-1-git-send-email-gm.ijewski@web.de>
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.ijewski@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 <berrange@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 :|
prev parent reply other threads:[~2017-04-26 13:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 22:15 [Qemu-devel] [PATCH v5] crypto: qcrypto_random_bytes() now works on windows w/o any other crypto libs Geert Martin Ijewski
2017-04-26 13:06 ` Eric Blake
2017-04-26 13:09 ` Daniel P. Berrange [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170426130925.GW18933@redhat.com \
--to=berrange@redhat.com \
--cc=gm.ijewski@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.