[gnutls-devel] GnuTLS | use bcrypt for the windows random generator instead of wincrypt (!1255)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Sun May 24 21:17:37 CEST 2020




Dmitry Baryshkov started a new discussion on lib/nettle/sysrng-windows.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1255#note_348027234

>   */
>  
>  #include <windows.h>
> +#ifdef HAVE_BCRYPT_ALG_HANDLE
> +#include <bcrypt.h>
> +#else
>  #include <wincrypt.h>
> +#endif
>  
>  get_entropy_func _rnd_get_system_entropy = NULL;
>  
> +#ifdef HAVE_BCRYPT_ALG_HANDLE
> +static BCRYPT_ALG_HANDLE device_fd = 0;
> +#else
>  static HCRYPTPROV device_fd = 0;
> +#endif

This file is small enough. I'd suggest to introduce two separate versions: one for WinCrypt API, one for BCrypy API instead of putting `#ifdef` everywhere. Then one can select between them in `Makefile.am` using a conditional.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1255#note_348027234
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20200524/078ddc50/attachment-0001.html>


More information about the Gnutls-devel mailing list