On Mon, Apr 24, 2017 at 03:05:40PM +0100, Peter Maydell wrote: > On 24 April 2017 at 14:57, Daniel P. Berrange <berra...@redhat.com> wrote: > > This is the extent of gnutls's code in this area > > > > https://gitlab.com/gnutls/gnutls/blob/master/lib/nettle/sysrng-windows.c > > > > Our API has the same usage scenario as this, hence my preference to mirror > > what gnutls & other crypto libraries are using. > > I see that only calls CryptAcquireContext once, not twice. > I also think we should do what that code does and use a static > variable to avoid calling CryptAcquireContext repeatedly.
Ok, fair enough. We can have the existing qcrypto_init() call a qcrypto_random_init() method to do the one-time initialization task, since that's already required to run early in order to initialize gnutls when we use it. > If we want to follow gnutls we should just borrow that code > (tweaking the function names etc as appropriate) and credit it: > gnutls is LGPL2.1 so no problem doing that. Yep 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 :|