[PATCH xdm] Missed on arc4random() conversion.

Alan Coopersmith alan.coopersmith at oracle.com
Tue Jan 5 14:49:44 PST 2016


On 01/ 5/16 12:34 PM, Matthieu Herrb wrote:
> Signed-off-by: Matthieu Herrb <matthieu at herrb.eu>
> ---
>   xdm/genauth.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git xdm/genauth.c xdm/genauth.c
> index 5db7315..f50be3b 100644
> --- xdm/genauth.c
> +++ xdm/genauth.c
> @@ -408,15 +408,20 @@ GenerateAuthData (char *auth, int len)
>       static int	    xdmcpAuthInited;
>       long	    ldata[2];
>
> -# ifdef ITIMER_REAL
> +# ifndef HAVE_ARC4RANDOM
> +#  ifdef ITIMER_REAL
>       struct timeval  now;
>
>       X_GETTIMEOFDAY (&now);
>       ldata[0] = now.tv_usec;
>       ldata[1] = now.tv_sec;
> -# else
> +#  else
>       ldata[0] = time ((long *) 0);
>       ldata[1] = getpid ();
> +#  endif
> +# else
> +    ldata[0] = arc4random();
> +    ldata[1] = arc4random();
>   # endif
>
>       longtochars (ldata[0], data+0);
>

Does it matter that arc4random is only providing 32-bits of data into
a long?

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list