[gnutls-devel] GnuTLS | gnutls_memset: use explicit_bzero (d087db43)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Aug 7 17:25:30 CEST 2018


Tim Rühsen started a new discussion on lib/safe-memfuncs.c:

>   * This function will operate similarly to memset(), but will
>   * not be optimized out by the compiler.
>   *
> - * Returns: void.
> - *
>   * Since: 3.4.0
>   **/
>  void gnutls_memset(void *data, int c, size_t size)
>  {
> -	volatile unsigned volatile_zero = 0;
> +	volatile unsigned volatile_zero;
>  	volatile char *vdata = (volatile char*)data;
> +#ifdef HAVE_EXPLICIT_BZERO
> +	if (c == 0) {
> +		explicit_bzero(data, size);

What makes explicit_bzero() save from being optimized out ?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/commit/d087db43e07c9b9df115ae9467bede5fa796c302#note_93035926
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/20180807/ed1e0ed0/attachment-0001.html>


More information about the Gnutls-devel mailing list